i3
Defines | Functions
src/manage.c File Reference
#include "all.h"
Include dependency graph for manage.c:

Go to the source code of this file.

Defines

#define FREE_GEOMETRY()
#define GET_PROPERTY(atom, len)   xcb_get_property(conn, false, window, atom, XCB_GET_PROPERTY_TYPE_ANY, 0, len)

Functions

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.

Define Documentation

#define FREE_GEOMETRY ( )
Value:
do { \
    if ((geom = xcb_get_geometry_reply(conn, geomc, 0)) != NULL) \
        free(geom); \
} while (0)

Referenced by manage_window().

#define GET_PROPERTY (   atom,
  len 
)    xcb_get_property(conn, false, window, atom, XCB_GET_PROPERTY_TYPE_ANY, 0, len)

Referenced by manage_window().


Function Documentation

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

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

Referenced by main().

Here is the call graph for this function:

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

References assignment_for(), Con::border_width, reservedpx::bottom, CHILD_EVENT_MASK, xoutput::con, con_accepts_window(), con_by_window_id(), con_descend_tiling_focused(), con_focus(), con_for_window(), con_get_fullscreen_con(), con_get_output(), con_get_workspace(), con_toggle_fullscreen(), config, conn, croot, Window::depth, Assignment::dest, DLOG, Window::dock, floating_enable(), focused, Con::frame, FREE, FREE_GEOMETRY, Con::geometry, get_output_containing(), GET_PROPERTY, get_visual_depth(), Rect::height, Window::id, Match::insert_where, Window::leader, LOG, Con::name, xoutput::name, Window::needs_take_focus, Con::parent, Config::popup_during_fullscreen, Con::rect, Window::reserved, Match::restart_mode, root, run_assignments(), sasprintf(), scalloc(), startup_workspace_for_window(), TAILQ_FIRST, TAILQ_INSERT_AFTER, TAILQ_REMOVE, reservedpx::top, Window::transient_for, tree_open_con(), tree_render(), Con::type, Assignment::type, UINT32_MAX, Rect::width, Con::window, window_supports_protocol(), window_update_class(), window_update_hints(), window_update_leader(), window_update_name(), window_update_name_legacy(), window_update_role(), window_update_strut_partial(), window_update_transient_for(), Assignment::workspace, workspace_get(), workspace_is_visible(), Rect::x, x_reinit(), x_set_name(), XCB_ATOM_WM_CLASS, XCB_ATOM_WM_NAME, XCB_ATOM_WM_TRANSIENT_FOR, xcb_icccm_get_wm_hints, and xcb_reply_contains_atom().

Referenced by handle_map_request(), and manage_existing_windows().

Here is the call graph for this function:

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 50 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: