-struct ObLookForEnters
-{
- ObClient *c;
- gulong looking_for_enter;
-};
-
-static Bool event_look_for_enters(Display *d, XEvent *e, XPointer arg)
-{
- struct ObLookForEnters *lfe = (struct ObLookForEnters*)arg;
-
- if (lfe->c != NULL && e->type == LeaveNotify) {
- if (g_hash_table_lookup(window_map, &e->xany.window) == lfe->c)
- /* found an event leaving this window */
- lfe->looking_for_enter = e->xany.serial;
- } else if (e->type == EnterNotify &&
- (lfe->c == NULL || e->xany.serial == lfe->looking_for_enter))
- {
- ObWindow *win;
- gint i;
- gboolean ignored = FALSE;
-
- /* make sure the serial isn't already being ignored */
- for (i = 0; ignore_enter_serials[i] != 0 && !ignored; ++i) {
- if (ignore_enter_serials[i] == e->xany.serial)
- ignored = TRUE;
- }
-
- if (!ignored) {
- /* found an enter for that leave, ignore it if it's going to
- another window */
- win = g_hash_table_lookup(window_map, &e->xany.window);
- if (win && WINDOW_IS_CLIENT(win))
- ++ignore_enter_focus;
- }
-
- /* add it to the ignored list if there is room */
- if (i < NUM_IGNORE_SERIALS) {
- ignore_enter_serials[i] = e->xany.serial;
- ignore_enter_serials[i+1] = 0;
- }
- }
- return False; /* don't disrupt the queue order, just count them */
-}
-
-void event_ignore_all_queued_enters()