static void event_handle_client(ObClient *c, XEvent *e);
static void event_handle_group(ObGroup *g, XEvent *e);
-static void focus_delay_destroy(gpointer data);
static gboolean focus_delay_func(gpointer data);
static void focus_delay_client_dest(ObClient *client, gpointer data);
ob_main_loop_timeout_add(ob_main_loop,
config_focus_delay,
focus_delay_func,
- NULL, focus_delay_destroy);
- } else
+ NULL, NULL);
+ } else {
+ focus_delay_data.client = client;
+ focus_delay_data.time = event_curtime;
focus_delay_func(NULL);
+ }
}
}
frame_adjust_state(client->frame);
break;
case OB_FRAME_CONTEXT_FRAME:
- if (config_focus_follow && config_focus_delay)
- ob_main_loop_timeout_remove_data(ob_main_loop,
- focus_delay_func,
- client, TRUE);
+ if (config_focus_follow && config_focus_delay &&
+ focus_delay_data.client == client)
+ {
+ event_halt_focus_delay();
+ }
break;
default:
break;
return FALSE; /* no repeat */
}
-static void focus_delay_destroy(gpointer data)
-{
- focus_delay_data.client = NULL;
- focus_delay_data.time = CurrentTime;
-}
-
static gboolean focus_delay_func(gpointer data)
{
Time old = event_curtime;
static void focus_delay_client_dest(ObClient *client, gpointer data)
{
if (focus_delay_data.client == client)
- ob_main_loop_timeout_remove(ob_main_loop, focus_delay_func);
+ event_halt_focus_delay();
}
static void event_client_dest(ObClient *client, gpointer data)
void event_halt_focus_delay()
{
+ focus_delay_data.client = NULL;
ob_main_loop_timeout_remove(ob_main_loop, focus_delay_func);
}