2009-02-13 20:33:31 -05:00
|
|
|
/*
|
2011-10-25 16:19:38 -04:00
|
|
|
* vim:ts=4:sw=4:expandtab
|
2009-02-13 20:33:31 -05:00
|
|
|
*
|
|
|
|
* i3 - an improved dynamic tiling window manager
|
2011-10-25 16:19:38 -04:00
|
|
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
2009-02-13 20:33:31 -05:00
|
|
|
*
|
2011-10-25 16:19:38 -04:00
|
|
|
* handlers.c: Small handlers for various events (keypresses, focus changes,
|
|
|
|
* …).
|
2009-02-13 20:33:31 -05:00
|
|
|
*
|
|
|
|
*/
|
2012-09-21 09:36:25 -04:00
|
|
|
#ifndef I3_HANDLERS_H
|
|
|
|
#define I3_HANDLERS_H
|
2009-02-13 13:04:45 -05:00
|
|
|
|
2010-03-02 06:47:21 -05:00
|
|
|
#include <xcb/randr.h>
|
|
|
|
|
2011-03-18 09:36:36 -04:00
|
|
|
extern int randr_base;
|
2010-04-13 14:51:43 -04:00
|
|
|
|
2011-07-10 17:44:13 -04:00
|
|
|
/**
|
|
|
|
* Adds the given sequence to the list of events which are ignored.
|
|
|
|
* If this ignore should only affect a specific response_type, pass
|
|
|
|
* response_type, otherwise, pass -1.
|
|
|
|
*
|
|
|
|
* Every ignored sequence number gets garbage collected after 5 seconds.
|
|
|
|
*
|
|
|
|
*/
|
Bugfix: Ignore EnterNotifies generated by UnmapNotifies
Actually, commit 1c5adc6c35cffaedc08c7d1dd1b03a3269d1367c commented out code
without ever fixing it. I think this was responsible for the 'workspace
switching sometimes does not work' bug. My observations:
Had it again today and analyzed a log of it. Looks like after unmapping the
windows on one workspace (in my case: chromium, eclipse, urxvt, focus on
eclipse) we get UnmapNotify events for chromium and eclipse, but then we get an
EnterNotify for the terminal (due to unmapping the other windows and therefore
mapping the terminal under the cursor), only afterwards the UnmapNotify
follows.
So, there are two things wrong with that:
• We handle EnterNotifys for unmapped windows
• Unmapping windows sometimes works in a sequence, sometimes the sequence gets
split. Not sure why (if unmapping can take longer for some windows or if our
syncing is wrong -- but i checked the latter briefly and it looks correct).
Maybe GrabServer helps?
• We don’t ignore EnterNotify events caused by UnmapNotifies. We used to, but
then there was a different problem and we decided to solve the EnterNotify
problem in another way, which actually never happened (commit
1c5adc6c35cffaedc08c7d1dd1b03a3269d1367c).
2011-04-19 15:50:56 -04:00
|
|
|
void add_ignore_event(const int sequence, const int response_type);
|
2010-04-13 14:51:43 -04:00
|
|
|
|
2011-07-10 17:44:13 -04:00
|
|
|
/**
|
|
|
|
* Checks if the given sequence is ignored and returns true if so.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
bool event_is_ignored(const int sequence, const int response_type);
|
|
|
|
|
2011-03-18 09:36:36 -04:00
|
|
|
/**
|
|
|
|
* Takes an xcb_generic_event_t and calls the appropriate handler, based on the
|
|
|
|
* event type.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void handle_event(int type, xcb_generic_event_t *event);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the appropriate atoms for the property handlers after the atoms were
|
|
|
|
* received from X11
|
|
|
|
*
|
|
|
|
*/
|
2012-03-31 04:53:04 -04:00
|
|
|
void property_handlers_init(void);
|
2011-03-18 09:36:36 -04:00
|
|
|
|
2010-04-13 13:33:40 -04:00
|
|
|
#if 0
|
2009-04-07 13:02:07 -04:00
|
|
|
/**
|
2009-06-29 15:54:51 -04:00
|
|
|
* Configuration notifies are only handled because we need to set up ignore
|
|
|
|
* for the following enter notify events
|
2009-04-07 13:02:07 -04:00
|
|
|
*
|
|
|
|
*/
|
2009-02-28 16:11:48 -05:00
|
|
|
int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_notify_event_t *event);
|
2011-01-04 18:16:10 -05:00
|
|
|
#endif
|
2009-04-07 13:02:07 -04:00
|
|
|
|
2010-04-17 07:54:45 -04:00
|
|
|
#if 0
|
2009-04-07 13:02:07 -04:00
|
|
|
/**
|
|
|
|
* Handles _NET_WM_WINDOW_TYPE changes
|
|
|
|
*
|
|
|
|
*/
|
2009-06-29 15:54:51 -04:00
|
|
|
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);
|
2010-10-11 15:32:04 -04:00
|
|
|
#endif
|
2009-04-07 13:02:07 -04:00
|
|
|
|
2009-02-13 13:04:45 -05:00
|
|
|
#endif
|