|
i3
|
#include "all.h"#include <time.h>#include <float.h>#include <sys/time.h>#include <xcb/randr.h>#include <libsn/sn-monitor.h>
Go to the source code of this file.
Data Structures | |
| struct | property_handler_t |
Macros | |
| #define | SN_API_NOT_YET_FROZEN 1 |
| #define | COPY_MASK_MEMBER(mask_member, event_member) |
| #define | _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 |
| #define | _NET_WM_MOVERESIZE_SIZE_TOP 1 |
| #define | _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 |
| #define | _NET_WM_MOVERESIZE_SIZE_RIGHT 3 |
| #define | _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4 |
| #define | _NET_WM_MOVERESIZE_SIZE_BOTTOM 5 |
| #define | _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6 |
| #define | _NET_WM_MOVERESIZE_SIZE_LEFT 7 |
| #define | _NET_WM_MOVERESIZE_MOVE 8 /* movement only */ |
| #define | _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */ |
| #define | _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */ |
| #define | _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */ |
| #define | _NET_MOVERESIZE_WINDOW_X (1 << 8) |
| #define | _NET_MOVERESIZE_WINDOW_Y (1 << 9) |
| #define | _NET_MOVERESIZE_WINDOW_WIDTH (1 << 10) |
| #define | _NET_MOVERESIZE_WINDOW_HEIGHT (1 << 11) |
| #define | NUM_HANDLERS (sizeof(property_handlers) / sizeof(struct property_handler_t)) |
Typedefs | |
| typedef bool(* | cb_property_handler_t) (void *data, xcb_connection_t *c, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *property) |
Functions | |
| static | SLIST_HEAD (ignore_head, Ignore_Event) |
| bool | event_is_ignored (const int sequence, const int response_type) |
| Checks if the given sequence is ignored and returns true if so. More... | |
| static void | check_crossing_screen_boundary (uint32_t x, uint32_t y) |
| static void | handle_enter_notify (xcb_enter_notify_event_t *event) |
| static void | handle_motion_notify (xcb_motion_notify_event_t *event) |
| static void | handle_mapping_notify (xcb_mapping_notify_event_t *event) |
| static void | handle_map_request (xcb_map_request_event_t *event) |
| static void | handle_configure_request (xcb_configure_request_event_t *event) |
| static void | handle_screen_change (xcb_generic_event_t *e) |
| static void | handle_unmap_notify_event (xcb_unmap_notify_event_t *event) |
| static void | handle_destroy_notify_event (xcb_destroy_notify_event_t *event) |
| static bool | window_name_changed (i3Window *window, char *old_name) |
| static bool | 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) |
| static bool | 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) |
| static bool | handle_windowrole_change (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop) |
| static void | handle_expose_event (xcb_expose_event_t *event) |
| static void | handle_client_message (xcb_client_message_event_t *event) |
| bool | 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 *reply) |
| static bool | 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) |
| static bool | 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) |
| static bool | 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 *prop) |
| static bool | 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) |
| static void | handle_focus_in (xcb_focus_in_event_t *event) |
| static void | handle_configure_notify (xcb_configure_notify_event_t *event) |
| static bool | handle_class_change (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t name, xcb_get_property_reply_t *prop) |
| static bool | handle_motif_hints_change (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t name, xcb_get_property_reply_t *prop) |
| static bool | handle_strut_partial_change (void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window, xcb_atom_t name, xcb_get_property_reply_t *prop) |
| void | property_handlers_init (void) |
| Sets the appropriate atoms for the property handlers after the atoms were received from X11. More... | |
| static void | property_notify (uint8_t state, xcb_window_t window, xcb_atom_t atom) |
| void | handle_event (int type, xcb_generic_event_t *event) |
| Takes an xcb_generic_event_t and calls the appropriate handler, based on the event type. More... | |
Variables | |
| int | randr_base = -1 |
| int | xkb_base = -1 |
| int | xkb_current_group |
| static struct property_handler_t | property_handlers [] |
| #define _NET_MOVERESIZE_WINDOW_HEIGHT (1 << 11) |
Definition at line 681 of file handlers.c.
Referenced by handle_client_message().
| #define _NET_MOVERESIZE_WINDOW_WIDTH (1 << 10) |
Definition at line 680 of file handlers.c.
Referenced by handle_client_message().
| #define _NET_MOVERESIZE_WINDOW_X (1 << 8) |
Definition at line 678 of file handlers.c.
Referenced by handle_client_message().
| #define _NET_MOVERESIZE_WINDOW_Y (1 << 9) |
Definition at line 679 of file handlers.c.
Referenced by handle_client_message().
| #define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */ |
Definition at line 676 of file handlers.c.
| #define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */ |
Definition at line 673 of file handlers.c.
Referenced by handle_client_message().
| #define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */ |
Definition at line 675 of file handlers.c.
| #define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5 |
Definition at line 670 of file handlers.c.
| #define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6 |
Definition at line 671 of file handlers.c.
| #define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4 |
Definition at line 669 of file handlers.c.
| #define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */ |
Definition at line 674 of file handlers.c.
| #define _NET_WM_MOVERESIZE_SIZE_LEFT 7 |
Definition at line 672 of file handlers.c.
Referenced by handle_client_message().
| #define _NET_WM_MOVERESIZE_SIZE_RIGHT 3 |
Definition at line 668 of file handlers.c.
| #define _NET_WM_MOVERESIZE_SIZE_TOP 1 |
Definition at line 666 of file handlers.c.
| #define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 |
Definition at line 665 of file handlers.c.
Referenced by handle_client_message().
| #define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 |
Definition at line 667 of file handlers.c.
| #define COPY_MASK_MEMBER | ( | mask_member, | |
| event_member | |||
| ) |
Referenced by handle_configure_request().
| #define NUM_HANDLERS (sizeof(property_handlers) / sizeof(struct property_handler_t)) |
Definition at line 1427 of file handlers.c.
| #define SN_API_NOT_YET_FROZEN 1 |
Definition at line 17 of file handlers.c.
| typedef bool(* cb_property_handler_t) (void *data, xcb_connection_t *c, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *property) |
Definition at line 1407 of file handlers.c.
|
static |
Definition at line 89 of file handlers.c.
References xoutput::con, con_descend_focused(), con_focus(), con_get_workspace(), config, Config::disable_focus_follows_mouse, ELOG, focused, get_output_containing(), output_get_content(), tree_render(), and workspace_show().
Referenced by handle_enter_notify(), and handle_motion_notify().

| bool event_is_ignored | ( | const int | sequence, |
| const int | response_type | ||
| ) |
Checks if the given sequence is ignored and returns true if so.
Definition at line 51 of file handlers.c.
References Ignore_Event::added, Ignore_Event::ignore_events, Ignore_Event::response_type, Ignore_Event::sequence, SLIST_END, SLIST_FIRST, SLIST_FOREACH, SLIST_NEXT, and SLIST_REMOVE.
Referenced by handle_enter_notify(), handle_event(), and xcb_check_cb().
|
static |
Definition at line 1272 of file handlers.c.
References con_by_window_id(), Con::window, and window_update_class().

|
static |
Definition at line 687 of file handlers.c.
References _NET_MOVERESIZE_WINDOW_HEIGHT, _NET_MOVERESIZE_WINDOW_WIDTH, _NET_MOVERESIZE_WINDOW_X, _NET_MOVERESIZE_WINDOW_Y, _NET_WM_MOVERESIZE_MOVE, _NET_WM_MOVERESIZE_SIZE_LEFT, _NET_WM_MOVERESIZE_SIZE_TOPLEFT, _NET_WM_STATE_ADD, _NET_WM_STATE_REMOVE, _NET_WM_STATE_TOGGLE, CF_NONE, CF_OUTPUT, con_by_window_id(), con_focus(), con_get_workspace(), con_is_floating(), con_is_internal(), con_move_to_workspace(), con_set_urgency(), con_toggle_fullscreen(), config, conn, Config::default_border_width, DLOG, ELOG, ewmh_get_workspace_by_index(), ewmh_update_sticky(), ewmh_update_wm_desktop(), floating_drag_window(), floating_enable(), floating_resize_window(), Config::focus_on_window_activation, focused, Config::font, FREE, Con::fullscreen_mode, handle_configure_request(), Font::height, Window::id, KILL_WINDOW, last_timestamp, LOG, Con::name, NET_WM_DESKTOP_ALL, output_push_sticky_windows(), Con::parent, Con::rect, scalloc(), scratchpad_show(), sndisplay, Con::sticky, tree_close_internal(), tree_render(), Con::urgent, Con::window, workspace_get(), workspace_is_visible(), workspace_show(), Rect::x, and Rect::y.
Referenced by handle_event().

|
static |
Definition at line 1181 of file handlers.c.
References con_by_window_id(), Con::window, and window_update_leader().

|
static |
Definition at line 1258 of file handlers.c.
References DLOG, randr_query_outputs(), and root.
Referenced by handle_event().

|
static |
Definition at line 280 of file handlers.c.
References Con::border_style, Con::border_width, BS_NORMAL, CF_GLOBAL, CF_OUTPUT, xoutput::con, con_attach(), con_border_style_rect(), con_by_window_id(), con_detach(), con_focus(), con_for_window(), con_get_fullscreen_con(), con_get_output(), con_get_workspace(), con_is_floating(), con_is_leaf(), con_set_urgency(), config, conn, COPY_MASK_MEMBER, Con::deco_rect, DLOG, fake_absolute_configure_notify(), floating_reposition(), Config::focus_on_window_activation, Con::geometry, get_output_containing(), height, Rect::height, Con::name, output_primary_name(), Con::parent, Con::rect, tree_render(), Con::type, width, Rect::width, Con::window, workspace_is_visible(), workspace_show(), x, Rect::x, y, and Rect::y.
Referenced by handle_client_message(), and handle_event().

|
static |
Definition at line 557 of file handlers.c.
References DLOG, and handle_unmap_notify_event().
Referenced by handle_event().

|
static |
Definition at line 123 of file handlers.c.
References check_crossing_screen_boundary(), con_by_frame_id(), con_by_window_id(), con_descend_focused(), con_focus(), con_get_workspace(), config, Con::deco_rect, Config::disable_focus_follows_mouse, DLOG, event_is_ignored(), focused, focused_id, L_DEFAULT, last_timestamp, Con::layout, LOG, Con::name, Con::nodes_head, Con::parent, rect_contains(), TAILQ_FOREACH, tree_render(), Con::type, and workspace_show().
Referenced by handle_event().

| void handle_event | ( | int | type, |
| xcb_generic_event_t * | event | ||
| ) |
Takes an xcb_generic_event_t and calls the appropriate handler, based on the event type.
Definition at line 1482 of file handlers.c.
References add_ignore_event(), conn, DLOG, event_is_ignored(), grab_all_keys(), handle_button_press(), handle_client_message(), handle_configure_notify(), handle_configure_request(), handle_destroy_notify_event(), handle_enter_notify(), handle_expose_event(), handle_focus_in(), handle_key_press(), handle_map_request(), handle_mapping_notify(), handle_motion_notify(), handle_screen_change(), handle_unmap_notify_event(), keysyms, last_timestamp, load_keymap(), property_notify(), randr_base, state, translate_keysyms(), ungrab_all_keys(), xkb_base, and xkb_current_group.
Referenced by main(), xcb_check_cb(), and xcb_drag_check_cb().

|
static |
Definition at line 647 of file handlers.c.
References con_by_frame_id(), conn, DLOG, draw_util_copy_surface(), Con::frame, Con::frame_buffer, Rect::height, LOG, Con::rect, and Rect::width.
Referenced by handle_event().

|
static |
Definition at line 1206 of file handlers.c.
References con_by_window_id(), con_focus(), con_get_workspace(), con_inside_floating(), DLOG, focused, focused_id, Con::name, Con::parent, tree_render(), Con::type, Con::window, and workspace_show().
Referenced by handle_event().

|
static |
Definition at line 1129 of file handlers.c.
References con_by_window_id(), con_set_urgency(), DLOG, tree_render(), Con::window, and window_update_hints().

|
static |
Definition at line 260 of file handlers.c.
References add_ignore_event(), conn, DLOG, and manage_window().
Referenced by handle_event().

|
static |
Definition at line 239 of file handlers.c.
References aio_get_mod_mask_for(), conn, DLOG, grab_all_keys(), keysyms, translate_keysyms(), ungrab_all_keys(), XCB_NUM_LOCK, and xcb_numlock_mask.
Referenced by handle_event().

|
static |
Definition at line 1296 of file handlers.c.
References Con::border_style, BS_NORMAL, con_by_window_id(), con_set_border_style(), croot, Con::current_border_width, DLOG, Con::window, window_update_motif_hints(), and x_push_changes().

|
static |
Definition at line 197 of file handlers.c.
References check_crossing_screen_boundary(), con_by_frame_id(), con_focus(), config, croot, Con::deco_rect, Config::disable_focus_follows_mouse, DLOG, Con::focus_head, L_DEFAULT, L_SPLITH, L_SPLITV, last_timestamp, Con::layout, Con::nodes_head, rect_contains(), TAILQ_FIRST, TAILQ_FOREACH, and x_push_changes().
Referenced by handle_event().

|
static |
Definition at line 994 of file handlers.c.
References Window::aspect_ratio, Window::base_height, Window::base_width, con_by_window_id(), con_is_floating(), DLOG, FREE, height, Rect::height, Window::height_increment, Window::id, MAX, Window::min_height, Window::min_width, tree_render(), width, Rect::width, Window::width_increment, Con::window, and Con::window_rect.

|
static |
Definition at line 456 of file handlers.c.
References conn, croot, DLOG, ELOG, Rect::height, ipc_send_event(), randr_query_outputs(), Con::rect, root, scratchpad_fix_resolution(), and Rect::width.
Referenced by handle_event().

|
static |
Definition at line 1328 of file handlers.c.
References reservedpx::bottom, con_by_window_id(), con_detach(), con_for_window(), con_get_output(), croot, DLOG, Window::dock, Con::focus_head, focused, Con::geometry, Rect::height, Con::name, Con::nodes_head, Con::parent, Con::rect, Window::reserved, TAILQ_INSERT_HEAD, reservedpx::top, tree_render(), Con::type, Con::window, window_update_strut_partial(), and Rect::y.

|
static |
Definition at line 1154 of file handlers.c.
References con_by_window_id(), DLOG, Con::window, and window_update_transient_for().

|
static |
Definition at line 486 of file handlers.c.
References add_ignore_event(), con_by_frame_id(), con_by_window_id(), conn, DLOG, DONT_KILL_WINDOW, Con::ignore_unmap, LOG, tree_close_internal(), and tree_render().
Referenced by handle_destroy_notify_event(), and handle_event().

| bool 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 * | reply | ||
| ) |
Definition at line 977 of file handlers.c.
References con_by_window_id(), Con::window, and window_update_type().

|
static |
Definition at line 583 of file handlers.c.
References con_by_window_id(), croot, FREE, i3string_as_utf8(), ipc_send_window_event(), Window::name, sstrdup(), Con::window, window_name_changed(), window_update_name(), and x_push_changes().

|
static |
Definition at line 608 of file handlers.c.
References con_by_window_id(), croot, FREE, i3string_as_utf8(), ipc_send_window_event(), Window::name, sstrdup(), Con::window, window_name_changed(), window_update_name_legacy(), and x_push_changes().

|
static |
Definition at line 632 of file handlers.c.
References con_by_window_id(), Con::window, and window_update_role().

| void property_handlers_init | ( | void | ) |
Sets the appropriate atoms for the property handlers after the atoms were received from X11.
Definition at line 1434 of file handlers.c.
References property_handler_t::atom, conn_screen, sndisplay, and startup_monitor_event().
Referenced by main().

|
static |
Definition at line 1450 of file handlers.c.
References property_handler_t::cb, conn, FREE, property_handler_t::long_len, and property_handlers.
Referenced by handle_event().
|
static |
Definition at line 27 of file handlers.c.
References Ignore_Event::ignore_events, Ignore_Event::response_type, Ignore_Event::sequence, SLIST_INSERT_HEAD, and smalloc().

|
static |
Definition at line 568 of file handlers.c.
References i3string_as_utf8(), and Window::name.
Referenced by handle_windowname_change(), and handle_windowname_change_legacy().

|
static |
Definition at line 1415 of file handlers.c.
Referenced by property_notify().
| int randr_base = -1 |
Definition at line 20 of file handlers.c.
Referenced by handle_event(), and main().
| int xkb_base = -1 |
Definition at line 21 of file handlers.c.
Referenced by handle_event(), and main().
| int xkb_current_group |
Definition at line 22 of file handlers.c.
Referenced by binding_in_current_group(), and handle_event().
1.8.13