#include <xcb/randr.h>
Go to the source code of this file.
Functions | |
int | handle_key_press (void *ignored, xcb_connection_t *conn, xcb_key_press_event_t *event) |
There was a key press. | |
int | handle_enter_notify (void *ignored, xcb_connection_t *conn, xcb_enter_notify_event_t *event) |
When the user moves the mouse pointer onto a window, this callback gets called. | |
int | handle_motion_notify (void *ignored, xcb_connection_t *conn, xcb_motion_notify_event_t *event) |
When the user moves the mouse but does not change the active window (e.g. | |
int | handle_mapping_notify (void *ignored, xcb_connection_t *conn, xcb_mapping_notify_event_t *event) |
Called when the keyboard mapping changes (for example by using Xmodmap), we need to update our key bindings then (re-translate symbols). | |
int | handle_button_press (void *ignored, xcb_connection_t *conn, xcb_button_press_event_t *event) |
Checks if the button press was on a stack window, handles focus setting and returns true if so, or false otherwise. | |
int | handle_map_request (void *prophs, xcb_connection_t *conn, xcb_map_request_event_t *event) |
A new window appeared on the screen (=was mapped), so let’s manage it. | |
int | handle_configure_event (void *prophs, xcb_connection_t *conn, xcb_configure_notify_event_t *event) |
Configuration notifies are only handled because we need to set up ignore for the following enter notify events. | |
int | handle_screen_change (void *prophs, xcb_connection_t *conn, xcb_generic_event_t *e) |
Gets triggered upon a RandR screen change event, that is when the user changes the screen configuration in any way (mode, position, …). | |
int | handle_configure_request (void *prophs, xcb_connection_t *conn, xcb_configure_request_event_t *event) |
Configure requests are received when the application wants to resize windows on their own. | |
int | handle_unmap_notify_event (void *data, xcb_connection_t *conn, xcb_unmap_notify_event_t *event) |
Our window decorations were unmapped. | |
int | handle_destroy_notify_event (void *data, xcb_connection_t *conn, xcb_destroy_notify_event_t *event) |
A destroy notify event is sent when the window is not unmapped, but immediately destroyed (for example when starting a window and immediately killing the program which started it). | |
int | handle_windowname_change (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop) |
Called when a window changes its title. | |
int | handle_windowname_change_legacy (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop) |
We handle legacy window names (titles) which are in COMPOUND_TEXT encoding. | |
int | handle_windowclass_change (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop) |
Store the window classes for jumping to them later. | |
int | handle_expose_event (void *data, xcb_connection_t *conn, xcb_expose_event_t *event) |
Expose event means we should redraw our windows (= title bar). | |
int | handle_client_message (void *data, xcb_connection_t *conn, xcb_client_message_event_t *event) |
Handle client messages (EWMH). | |
int | handle_window_type (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *property) |
Handles _NET_WM_WINDOW_TYPE changes. | |
int | handle_normal_hints (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t name, xcb_get_property_reply_t *reply) |
Handles the size hints set by a window, but currently only the part necessary for displaying clients proportionally inside their frames (mplayer for example). | |
int | handle_hints (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t name, xcb_get_property_reply_t *reply) |
Handles the WM_HINTS property for extracting the urgency state of the window. | |
int | handle_transient_for (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t name, xcb_get_property_reply_t *reply) |
Handles the transient for hints set by a window, signalizing that this window is a popup window for some other window. | |
int | handle_clientleader_change (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t name, xcb_get_property_reply_t *prop) |
Handles changes of the WM_CLIENT_LEADER atom which specifies if this is a toolwindow (or similar) and to which window it belongs (logical parent). |
int handle_button_press | ( | void * | ignored, | |
xcb_connection_t * | conn, | |||
xcb_button_press_event_t * | event | |||
) |
Checks if the button press was on a stack window, handles focus setting and returns true if so, or false otherwise.
Definition at line 255 of file click.c.
References button_press_bar(), button_press_stackwin(), by_child, by_parent, cell_exists(), Client::child_rect, client_is_floating(), Container::col, Workspace::cols, Container::colspan, config, Client::container, DLOG, Client::dock, floating_border_click(), floating_drag_window(), floating_mod_on_tiled_client(), Config::floating_modifier, floating_resize_window(), Config::font, Client::frame, Client::fullscreen, Font::height, Rect::height, load_font(), Client::rect, resize_graphical_handler(), Container::row, Workspace::rows, Container::rowspan, set_focus(), table_get(), Rect::width, Container::workspace, Rect::x, xcb_raise_window(), and Rect::y.
Referenced by main().
int handle_client_message | ( | void * | data, | |
xcb_connection_t * | conn, | |||
xcb_client_message_event_t * | event | |||
) |
Handle client messages (EWMH).
Definition at line 840 of file handlers.c.
References _NET_WM_STATE, _NET_WM_STATE_ADD, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_REMOVE, _NET_WM_STATE_TOGGLE, atoms, by_child, client_toggle_fullscreen(), ELOG, Client::fullscreen, and table_get().
Referenced by main().
int handle_clientleader_change | ( | void * | data, | |
xcb_connection_t * | conn, | |||
uint8_t | state, | |||
xcb_window_t | window, | |||
xcb_atom_t | name, | |||
xcb_get_property_reply_t * | prop | |||
) |
Handles changes of the WM_CLIENT_LEADER atom which specifies if this is a toolwindow (or similar) and to which window it belongs (logical parent).
Definition at line 1076 of file handlers.c.
References by_child, DLOG, Client::leader, table_get(), and WM_CLIENT_LEADER.
Referenced by main(), and reparent_window().
int handle_configure_event | ( | void * | prophs, | |
xcb_connection_t * | conn, | |||
xcb_configure_notify_event_t * | event | |||
) |
Configuration notifies are only handled because we need to set up ignore for the following enter notify events.
Definition at line 431 of file handlers.c.
Referenced by main().
int handle_configure_request | ( | void * | prophs, | |
xcb_connection_t * | conn, | |||
xcb_configure_request_event_t * | event | |||
) |
Configure requests are received when the application wants to resize windows on their own.
We generate a synthethic configure notify event to signalize the client its "new" position.
Definition at line 292 of file handlers.c.
References Client::borderless, by_child, c_ws, Client::child, client_is_floating(), config, Client::container, COPY_MASK_MEMBER, Client::desired_height, DLOG, Client::dock, fake_absolute_configure_notify(), fake_configure_notify(), Config::font, Client::fullscreen, Rect::height, Font::height, height, load_font(), Container::mode, Workspace::output, Client::rect, Workspace::rect, render_workspace(), reposition_client(), resize_client(), table_get(), Client::titlebar_position, Rect::width, width, Container::workspace, Client::workspace, Rect::x, x, Rect::y, and y.
Referenced by main().
int handle_destroy_notify_event | ( | void * | data, | |
xcb_connection_t * | conn, | |||
xcb_destroy_notify_event_t * | event | |||
) |
A destroy notify event is sent when the window is not unmapped, but immediately destroyed (for example when starting a window and immediately killing the program which started it).
We just pass on the event to the unmap notify handler (by copying the important fields in the event data structure).
Definition at line 588 of file handlers.c.
References DLOG, and handle_unmap_notify_event().
Referenced by main().
int handle_enter_notify | ( | void * | ignored, | |
xcb_connection_t * | conn, | |||
xcb_enter_notify_event_t * | event | |||
) |
When the user moves the mouse pointer onto a window, this callback gets called.
Definition at line 173 of file handlers.c.
References by_child, by_parent, c_ws, check_crossing_screen_boundary(), config, Client::container, Stack_Window::container, Container::currently_focused, Config::disable_focus_follows_mouse, DLOG, event_is_ignored(), Container::mode, Workspace::output, set_focus(), SLIST_FOREACH, stack_wins, table_get(), Stack_Window::window, and Client::workspace.
Referenced by main().
int handle_expose_event | ( | void * | data, | |
xcb_connection_t * | conn, | |||
xcb_expose_event_t * | event | |||
) |
Expose event means we should redraw our windows (= title bar).
Definition at line 770 of file handlers.c.
References Colortriple::background, xoutput::bar, Client::borderless, by_parent, Config::client, config, Client::container, Stack_Window::container, container_mode(), CUR_CELL, decorate_window(), DLOG, Client::dock, Config::config_client::focused, Config::config_client::focused_inactive, Client::frame, get_colorpixel(), Rect::height, outputs, Client::rect, render_container(), render_layout(), SLIST_FOREACH, stack_wins, table_get(), TAILQ_FOREACH, Client::titlebar_position, Client::titlegc, Config::config_client::urgent, Client::urgent, Rect::width, Stack_Window::window, and xcb_change_gc_single().
Referenced by main(), and resize_client().
int handle_hints | ( | void * | data, | |
xcb_connection_t * | conn, | |||
uint8_t | state, | |||
xcb_window_t | window, | |||
xcb_atom_t | name, | |||
xcb_get_property_reply_t * | reply | |||
) |
Handles the WM_HINTS property for extracting the urgency state of the window.
Definition at line 994 of file handlers.c.
References by_child, c_ws, Client::child, CLIENT_LOG, xoutput::current_workspace, DLOG, LOG, Workspace::output, redecorate_window(), render_workspace(), SLIST_FIRST, table_get(), Client::urgent, Client::workspace, workspace_is_visible(), and workspace_update_urgent_flag().
Referenced by main().
int handle_key_press | ( | void * | ignored, | |
xcb_connection_t * | conn, | |||
xcb_key_press_event_t * | event | |||
) |
There was a key press.
We compare this key code with our bindings table and pass the bound action to parse_command().
Definition at line 90 of file handlers.c.
References Binding::command, DLOG, ELOG, get_binding(), parse_command(), xcb_numlock_mask, and xkb_current_group.
Referenced by main().
int handle_map_request | ( | void * | prophs, | |
xcb_connection_t * | conn, | |||
xcb_map_request_event_t * | event | |||
) |
A new window appeared on the screen (=was mapped), so let’s manage it.
Definition at line 274 of file handlers.c.
References DLOG, and manage_window().
Referenced by main().
int handle_mapping_notify | ( | void * | ignored, | |
xcb_connection_t * | conn, | |||
xcb_mapping_notify_event_t * | event | |||
) |
Called when the keyboard mapping changes (for example by using Xmodmap), we need to update our key bindings then (re-translate symbols).
Definition at line 253 of file handlers.c.
References DLOG, grab_all_keys(), keysyms, translate_keysyms(), ungrab_all_keys(), and xcb_get_numlock_mask().
Referenced by main().
int handle_motion_notify | ( | void * | ignored, | |
xcb_connection_t * | conn, | |||
xcb_motion_notify_event_t * | event | |||
) |
When the user moves the mouse but does not change the active window (e.g.
when having no windows opened but moving mouse on the root screen and crossing virtual screen boundaries), this callback gets called.
Definition at line 237 of file handlers.c.
References check_crossing_screen_boundary().
Referenced by main().
int handle_normal_hints | ( | void * | data, | |
xcb_connection_t * | conn, | |||
uint8_t | state, | |||
xcb_window_t | window, | |||
xcb_atom_t | name, | |||
xcb_get_property_reply_t * | reply | |||
) |
Handles the size hints set by a window, but currently only the part necessary for displaying clients proportionally inside their frames (mplayer for example).
See ICCCM 4.1.2.3 for more details
Definition at line 880 of file handlers.c.
References Client::base_height, Client::base_width, by_child, Client::child, CLIENT_LOG, Client::container, DLOG, Client::force_reconfigure, Client::fullscreen, Rect::height, height, Client::height_increment, Client::proportional_height, Client::proportional_width, Client::rect, render_container(), resize_client(), table_get(), Rect::width, width, Client::width_increment, Client::workspace, and workspace_is_visible().
Referenced by main().
int handle_screen_change | ( | void * | prophs, | |
xcb_connection_t * | conn, | |||
xcb_generic_event_t * | e | |||
) |
Gets triggered upon a RandR screen change event, that is when the user changes the screen configuration in any way (mode, position, …).
Definition at line 444 of file handlers.c.
References DLOG, ipc_send_event(), and randr_query_outputs().
Referenced by main().
int handle_transient_for | ( | void * | data, | |
xcb_connection_t * | conn, | |||
uint8_t | state, | |||
xcb_window_t | window, | |||
xcb_atom_t | name, | |||
xcb_get_property_reply_t * | reply | |||
) |
Handles the transient for hints set by a window, signalizing that this window is a popup window for some other window.
See ICCCM 4.1.2.6 for more details
Definition at line 1044 of file handlers.c.
References by_child, DLOG, Client::floating, table_get(), and toggle_floating_mode().
Referenced by main().
int handle_unmap_notify_event | ( | void * | data, | |
xcb_connection_t * | conn, | |||
xcb_unmap_notify_event_t * | event | |||
) |
Our window decorations were unmapped.
That means, the window will be killed now, so we better clean up before.
Definition at line 460 of file handlers.c.
References Client::awaiting_useless_unmap, by_child, by_parent, c_ws, Client::child, cleanup_table(), client_is_floating(), client_remove_from_container(), client_unmap(), Client::container, CUR_CELL, Container::currently_focused, DLOG, Client::dock, fix_colrowspan(), Client::frame, FREE, Client::fullscreen, Workspace::fullscreen_client, get_last_focused_client(), ipc_send_event(), Client::name, Workspace::output, render_layout(), root, set_focus(), SLIST_EMPTY, SLIST_FIRST, SLIST_REMOVE, table_get(), table_remove(), TAILQ_FOREACH, TAILQ_REMOVE, Client::urgent, Client::window_class_class, Client::window_class_instance, Container::workspace, Client::workspace, workspace_is_visible(), workspace_update_urgent_flag(), and workspaces.
Referenced by handle_destroy_notify_event(), and main().
int handle_window_type | ( | void * | data, | |
xcb_connection_t * | conn, | |||
uint8_t | state, | |||
xcb_window_t | window, | |||
xcb_atom_t | atom, | |||
xcb_get_property_reply_t * | property | |||
) |
Handles _NET_WM_WINDOW_TYPE changes.
Definition at line 865 of file handlers.c.
References ELOG.
Referenced by main().
int handle_windowclass_change | ( | void * | data, | |
xcb_connection_t * | conn, | |||
uint8_t | state, | |||
xcb_window_t | window, | |||
xcb_atom_t | atom, | |||
xcb_get_property_reply_t * | prop | |||
) |
Store the window classes for jumping to them later.
Definition at line 738 of file handlers.c.
References by_child, DLOG, FREE, LOG, table_get(), Client::window_class_class, and Client::window_class_instance.
Referenced by main(), and reparent_window().
int handle_windowname_change | ( | void * | data, | |
xcb_connection_t * | conn, | |||
uint8_t | state, | |||
xcb_window_t | window, | |||
xcb_atom_t | atom, | |||
xcb_get_property_reply_t * | prop | |||
) |
Called when a window changes its title.
Definition at line 603 of file handlers.c.
References by_child, Client::container, container_mode(), convert_utf8_to_ucs2(), decorate_window(), DLOG, Client::dock, Client::frame, FREE, LOG, Client::name, Client::name_len, render_container(), table_get(), Client::titlegc, Client::uses_net_wm_name, Client::workspace, and workspace_is_visible().
Referenced by main(), and reparent_window().
int handle_windowname_change_legacy | ( | void * | data, | |
xcb_connection_t * | conn, | |||
uint8_t | state, | |||
xcb_window_t | window, | |||
xcb_atom_t | atom, | |||
xcb_get_property_reply_t * | prop | |||
) |
We handle legacy window names (titles) which are in COMPOUND_TEXT encoding.
However, we just pass them along, so when containing non-ASCII characters, those will be rendering incorrectly. In order to correctly render unicode window titles in i3, an application has to set _NET_WM_NAME, which is in UTF-8 encoding.
On every update, a message is put out to the user, so he may improve the situation and update applications which display filenames in their title to correctly use _NET_WM_NAME and therefore support unicode.
Definition at line 675 of file handlers.c.
References by_child, Client::container, decorate_window(), DLOG, Client::dock, Client::frame, LOG, Container::mode, Client::name, Client::name_len, render_container(), table_get(), Client::titlegc, Client::uses_net_wm_name, Client::workspace, and workspace_is_visible().
Referenced by main(), and reparent_window().