all repos — openbox @ 57ffea1123d87a6d5b0ae92b4f4715222d2a1d23

openbox fork - make it a bit more like ryudo

fix segfaults
Dana Jansens danakj@orodu.net
commit

57ffea1123d87a6d5b0ae92b4f4715222d2a1d23

parent

98b021ff0cc1bb8e5e6e159b9ee1b62a842ed7b8

1 files changed, 12 insertions(+), 14 deletions(-)

jump to
M openbox/event.copenbox/event.c

@@ -79,7 +79,6 @@ static void event_handle_dockapp(ObDockApp *app, XEvent *e);

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);

@@ -636,9 +635,12 @@

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); + } } }

@@ -758,10 +760,11 @@ client->frame->close_hover = FALSE;

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;

@@ -1332,12 +1335,6 @@ menu_can_hide = TRUE;

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;

@@ -1353,7 +1350,7 @@

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)

@@ -1364,6 +1361,7 @@ }

void event_halt_focus_delay() { + focus_delay_data.client = NULL; ob_main_loop_timeout_remove(ob_main_loop, focus_delay_func); }