]> git.sur5r.net Git - i3/i3/blobdiff - include/handlers.h
Bugfix: Ignore enter_notify when warping pointer (makes "goto" work correctly)
[i3/i3] / include / handlers.h
index 5b776de78b0768fc68db9c2f533710ee6a909362..7d0662e16a671152869c5f7979bf71f8f6ce90c8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * i3 - an improved dynamic tiling window manager
  *
- * (c) 2009 Michael Stapelberg and contributors
+ * © 2009-2010 Michael Stapelberg and contributors
  *
  * See file LICENSE for license information.
  *
 #ifndef _HANDLERS_H
 #define _HANDLERS_H
 
+#include <xcb/randr.h>
+
 /**
- * Due to bindings like Mode_switch + <a>, we need to bind some keys in
- * XCB_GRAB_MODE_SYNC.  Therefore, we just replay all key presses.
+ * Adds the sequence number of an event to the ignored events.
+ * Useful to ignore for example the enter notify caused by a pointer warp of
+ * i3.
  *
  */
-int handle_key_release(void *ignored, xcb_connection_t *conn,
-                       xcb_key_release_event_t *event);
+void add_ignore_event(const int sequence);
 
 /**
  * There was a key press. We compare this key code with our bindings table and
@@ -44,6 +46,14 @@ int handle_enter_notify(void *ignored, xcb_connection_t *conn,
 int handle_motion_notify(void *ignored, xcb_connection_t *conn,
                          xcb_motion_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_mapping_notify(void *ignored, xcb_connection_t *conn,
+                          xcb_mapping_notify_event_t *event);
+
 /**
  * Checks if the button press was on a stack window, handles focus setting and
  * returns true if so, or false otherwise.
@@ -66,6 +76,14 @@ int handle_map_request(void *prophs, xcb_connection_t *conn,
  */
 int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_notify_event_t *event);
 
+/**
+ * Gets triggered upon a RandR screen change event, that is when the user
+ * changes the screen configuration in any way (mode, position, …)
+ *
+ */
+int handle_screen_change(void *prophs, xcb_connection_t *conn,
+                         xcb_generic_event_t *e);
+
 /**
  * Configure requests are received when the application wants to resize
  * windows on their own.
@@ -84,6 +102,18 @@ int handle_configure_request(void *prophs, xcb_connection_t *conn,
  */
 int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_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).
+ *
+ */
+int handle_destroy_notify_event(void *data, xcb_connection_t *conn,
+                                xcb_destroy_notify_event_t *event);
+
 /**
  * Called when a window changes its title
  *
@@ -152,6 +182,13 @@ 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 WM_HINTS property for extracting the urgency state of the window.
+ *
+ */
+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 transient for hints set by a window, signalizing that this
  * window is a popup window for some other window.