i3/include/handlers.h
Michael Stapelberg 3721bcb868 Bugfix: Ignore EnterNotifies generated by UnmapNotifies
Actually, commit 1c5adc6c35 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
  1c5adc6c35).
2011-04-19 21:50:56 +02:00

54 lines
1.1 KiB
C

/*
* vim:ts=8:expandtab
*
* i3 - an improved dynamic tiling window manager
*
* © 2009-2010 Michael Stapelberg and contributors
*
* See file LICENSE for license information.
*
*/
#ifndef _HANDLERS_H
#define _HANDLERS_H
#include <xcb/randr.h>
extern int randr_base;
void add_ignore_event(const int sequence, const int response_type);
/**
* 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
*
*/
void property_handlers_init();
#if 0
/**
* Configuration notifies are only handled because we need to set up ignore
* for the following enter notify events
*
*/
int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_notify_event_t *event);
#endif
#if 0
/**
* Handles _NET_WM_WINDOW_TYPE changes
*
*/
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);
#endif
#endif