From: Dana Jansens Date: Mon, 29 Sep 2003 16:32:53 +0000 (+0000) Subject: use a client destructor to watch for focus_in/out becoming invalid X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=97e854b07d9f259c422fda4cc7b8c26328fd83ab;p=chaz%2Fopenbox use a client destructor to watch for focus_in/out becoming invalid --- diff --git a/openbox/event.c b/openbox/event.c index 8a9b83be..f68517d1 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -57,6 +57,7 @@ static void event_process(const XEvent *e, gpointer data); static void event_done(gpointer data); +static void event_client_dest(ObClient *client, gpointer data); static void event_handle_root(XEvent *e); static void event_handle_menu(XEvent *e); static void event_handle_dock(ObDock *s, XEvent *e); @@ -148,6 +149,7 @@ void event_startup(gboolean reconfig) #endif client_add_destructor(focus_delay_client_dest, NULL); + client_add_destructor(event_client_dest, NULL); } void event_shutdown(gboolean reconfig) @@ -313,6 +315,14 @@ static gboolean event_ignore(XEvent *e, ObClient *client) return FALSE; } +static void event_client_dest(ObClient *client, gpointer data) +{ + if (client == focus_in) + focus_in = NULL; + if (client == focus_out) + focus_out = NULL; +} + static void event_done(gpointer data) { static ObClient *last = NULL;