i3
manage.c File Reference
#include "all.h"
Include dependency graph for manage.c:

Go to the source code of this file.

Macros

#define GET_PROPERTY(atom, len)
 

Functions

static xcb_window_t _match_depth (i3Window *win, Con *con)
 
static void _remove_matches (Con *con)
 
void manage_existing_windows (xcb_window_t root)
 Go through all existing windows (if the window manager is restarted) and manage them.
 
void restore_geometry (void)
 Restores the geometry of each window by reparenting it to the root window at the position of its frame.
 
void manage_window (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.
 
static Conplaceholder_for_con (Con *con)
 
Conremanage_window (Con *con)
 Remanages a window: performs a swallow check and runs assignments.
 

Macro Definition Documentation

◆ GET_PROPERTY

#define GET_PROPERTY ( atom,
len )
Value:
xcb_get_property(conn, false, window, atom, XCB_GET_PROPERTY_TYPE_ANY, 0, len)
xcb_connection_t * conn
XCB connection and root screen.
Definition main.c:54

Referenced by manage_window().

Function Documentation

◆ _match_depth()

static xcb_window_t _match_depth ( i3Window * win,
Con * con )
static

Definition at line 17 of file manage.c.

References Con::depth, Window::depth, Con::frame, surface_t::id, and x_con_reframe().

Referenced by manage_window(), and remanage_window().

Here is the call graph for this function:

◆ _remove_matches()

static void _remove_matches ( Con * con)
static

Definition at line 31 of file manage.c.

References match_free(), TAILQ_EMPTY, TAILQ_FIRST, and TAILQ_REMOVE.

Referenced by manage_window(), and remanage_window().

Here is the call graph for this function:

◆ manage_existing_windows()

void manage_existing_windows ( xcb_window_t root)

Go through all existing windows (if the window manager is restarted) and manage them.

Definition at line 44 of file manage.c.

References conn, manage_window(), root, and smalloc().

Referenced by main().

Here is the call graph for this function:

◆ manage_window()

void manage_window ( 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 109 of file manage.c.

References _match_depth(), _remove_matches(), assignment_for(), bindings_get_buttons_to_grab(), Con::border_width, reservedpx::bottom, CF_OUTPUT, CHILD_EVENT_MASK, xoutput::con, con_accepts_window(), con_activate(), con_by_window_id(), con_descend_tiling_focused(), con_disable_fullscreen(), con_find_transient_for_window(), con_for_window(), con_get_fullscreen_covering_ws(), con_get_output(), con_get_workspace(), con_is_internal(), con_move_to_output(), con_move_to_output_name(), con_num_windows(), con_set_border_style(), con_set_urgency(), con_toggle_fullscreen(), config, conn, croot, Con::current_border_width, Config::default_border_width, Config::default_floating_border_width, Window::depth, Assignment::dest, DLOG, Window::dock, Window::doesnt_accept_focus, ewmh_get_workspace_by_index(), ewmh_update_wm_desktop(), Con::floating, floating_enable(), focused, Con::frame, FREE, Con::geometry, get_existing_workspace_by_num(), get_output_containing(), get_output_with_dimensions(), GET_PROPERTY, get_visual_depth(), Rect::height, surface_t::id, Window::id, Match::insert_where, ipc_send_window_event(), Window::leader, LOG, Window::managed_since, Con::mapped, match_free(), Window::max_height, Window::max_width, Window::min_height, Window::min_width, Con::name, Window::needs_take_focus, NET_WM_DESKTOP_ALL, NET_WM_DESKTOP_NONE, Assignment::output, output_primary_name(), output_push_sticky_windows(), Con::parent, Config::popup_during_fullscreen, Con::rect, render_con(), Window::reserved, Match::restart_mode, restore_kill_placeholder(), run_assignments(), sasprintf(), scalloc(), shape_supported, Window::shaped, startup_workspace_for_window(), Con::sticky, Window::swallowed, TAILQ_FIRST, TAILQ_INSERT_AFTER, TAILQ_REMOVE, reservedpx::top, Window::transient_for, tree_open_con(), tree_render(), Assignment::type, Con::type, Rect::width, Con::window, window_free(), window_supports_protocol(), Window::window_type, window_update_class(), window_update_hints(), window_update_icon(), window_update_leader(), window_update_machine(), window_update_motif_hints(), window_update_name(), window_update_name_legacy(), window_update_normal_hints(), window_update_role(), window_update_strut_partial(), window_update_transient_for(), Window::wm_desktop, Assignment::workspace, workspace_get(), workspace_is_visible(), ws_name_to_number(), x_reinit(), x_set_name(), xcb_get_preferred_window_type(), xcb_grab_buttons(), and xcb_reply_contains_atom().

Referenced by handle_map_request(), and manage_existing_windows().

◆ placeholder_for_con()

static Con * placeholder_for_con ( Con * con)
static

Definition at line 696 of file manage.c.

References con_for_window(), croot, Window::managed_since, Window::swallowed, and Con::window.

Referenced by remanage_window().

Here is the call graph for this function:

◆ remanage_window()

◆ restore_geometry()

void restore_geometry ( void )

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 81 of file manage.c.

References all_cons, Con::border_width, conn, DLOG, Rect::height, Window::id, Con::rect, root, TAILQ_FOREACH, Rect::width, Con::window, Con::window_rect, Rect::x, xcb_set_window_rect(), and Rect::y.

Referenced by i3_restart().

Here is the call graph for this function: