i3
|
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <xcb/xcb.h>
#include <xcb/xcb_icccm.h>
#include "xcb.h"
#include "data.h"
#include "util.h"
#include "i3.h"
#include "table.h"
#include "config.h"
#include "handlers.h"
#include "layout.h"
#include "manage.h"
#include "floating.h"
#include "client.h"
#include "workspace.h"
#include "log.h"
#include "ewmh.h"
Go to the source code of this file.
Functions | |
void | manage_existing_windows (xcb_connection_t *conn, xcb_property_handlers_t *prophs, xcb_window_t root) |
Go through all existing windows (if the window manager is restarted) and manage them. | |
void | restore_geometry (xcb_connection_t *conn) |
Restores the geometry of each window by reparenting it to the root window at the position of its frame. | |
void | manage_window (xcb_property_handlers_t *prophs, xcb_connection_t *conn, xcb_window_t window, xcb_get_window_attributes_cookie_t cookie, bool needs_to_be_mapped) |
Do some sanity checks and then reparent the window. | |
void | reparent_window (xcb_connection_t *conn, xcb_window_t child, xcb_visualid_t visual, xcb_window_t root, uint8_t depth, int16_t x, int16_t y, uint16_t width, uint16_t height, uint32_t border_width) |
reparent_window() gets called when a new window was opened and becomes a child of the root window, or it gets called by us when we manage the already existing windows at startup. |
void manage_existing_windows | ( | xcb_connection_t * | conn, |
xcb_property_handlers_t * | prophs, | ||
xcb_window_t | root | ||
) |
Go through all existing windows (if the window manager is restarted) and manage them.
Definition at line 40 of file manage.c.
References manage_window(), and smalloc().
Referenced by main().
void manage_window | ( | xcb_property_handlers_t * | prophs, |
xcb_connection_t * | conn, | ||
xcb_window_t | window, | ||
xcb_get_window_attributes_cookie_t | cookie, | ||
bool | needs_to_be_mapped | ||
) |
Do some sanity checks and then reparent the window.
Definition at line 92 of file manage.c.
References _NET_WM_NAME, atoms, by_child, ELOG, reparent_window(), table_get(), and WM_CLIENT_LEADER.
Referenced by handle_map_request(), and manage_existing_windows().
void reparent_window | ( | xcb_connection_t * | conn, |
xcb_window_t | child, | ||
xcb_visualid_t | visual, | ||
xcb_window_t | root, | ||
uint8_t | depth, | ||
int16_t | x, | ||
int16_t | y, | ||
uint16_t | width, | ||
uint16_t | height, | ||
uint32_t | border_width | ||
) |
reparent_window() gets called when a new window was opened and becomes a child of the root window, or it gets called by us when we manage the already existing windows at startup.
Essentially, this is the point where we take over control.
Definition at line 151 of file manage.c.
References _NET_WM_NAME, _NET_WM_STATE, _NET_WM_STATE_FULLSCREEN, _NET_WM_STRUT_PARTIAL, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_UTILITY, Assignment::ASSIGN_FLOATING, Assignment::ASSIGN_FLOATING_ONLY, assignments, atoms, by_child, by_parent, c_ws, CHILD_EVENT_MASK, CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_TAIL, client_init_border(), client_is_floating(), client_map(), client_set_below_floating(), client_toggle_fullscreen(), Container::col, config, Client::container, create_window(), CUR_CELL, Workspace::current_col, Workspace::current_row, xoutput::current_workspace, Container::currently_focused, Config::default_border, DLOG, Client::dock, ewmh_update_active_window(), Assignment::floating, Config::font, FRAME_EVENT_MASK, get_matching_client(), get_output_containing(), handle_clientleader_change(), handle_windowclass_change(), handle_windowname_change(), handle_windowname_change_legacy(), Font::height, Rect::height, height, load_font(), LOG, max(), min(), xoutput::name, Workspace::num, Workspace::output, Client::rect, Workspace::rect, redecorate_window(), render_container(), render_layout(), reposition_client(), resize_client(), Container::row, scalloc(), SLIST_INSERT_AFTER, SLIST_INSERT_HEAD, Workspace::table, table_get(), table_put(), TAILQ_FOREACH, TAILQ_INSERT_TAIL, UINT32_MAX, Workspace::urgent, Rect::width, width, Assignment::windowclass_title, WM_CLIENT_LEADER, Assignment::workspace, Container::workspace, Client::workspace, workspace_get(), workspace_initialize(), workspace_is_visible(), x, Rect::x, XCB_CURSOR_LEFT_PTR, xcb_raise_window(), y, and Rect::y.
Referenced by manage_window().
void restore_geometry | ( | xcb_connection_t * | conn | ) |
Restores the geometry of each window by reparenting it to the root window at the position of its frame.
This is to be called *only* before exiting/restarting i3 because of evil side-effects which are to be expected when continuing to run i3.
Definition at line 74 of file manage.c.
References Client::child, DLOG, Client::rect, root, SLIST_FOREACH, TAILQ_FOREACH, workspaces, Rect::x, and Rect::y.
Referenced by i3_restart(), and parse_command().