From c018e212200dfece62b49c6ed385d379eb4e45e9 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 12 Mar 2007 05:25:34 +0000 Subject: i rewrote handling of focus events. this is pretty much based on blackbox's current form, as well as reading the xlib programming manual at: http://tronche.com/gui/x/xlib/events/input-focus/normal-and-grabbed.html this may break for people. that'd be nice to hear about, so it can be fixed. but hopefully this is more robust. it sure is a lot more simple. --- openbox/client.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index 37c7f40b..e4bef71d 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -45,8 +45,7 @@ #include /*! The event mask to grab on client windows */ -#define CLIENT_EVENTMASK (PropertyChangeMask | FocusChangeMask | \ - StructureNotifyMask) +#define CLIENT_EVENTMASK (PropertyChangeMask | StructureNotifyMask) #define CLIENT_NOPROPAGATEMASK (ButtonPressMask | ButtonReleaseMask | \ ButtonMotionMask) @@ -555,7 +554,8 @@ void client_unmanage(ObClient *self) guint j; GSList *it; - ob_debug("Unmanaging window: %lx (%s)\n", self->window, self->class); + ob_debug("Unmanaging window: %lx (%s) (%s)\n", self->window, self->class, + self->title ? self->title : ""); g_assert(self != NULL); @@ -2613,6 +2613,9 @@ void client_kill(ObClient *self) void client_hilite(ObClient *self, gboolean hilite) { + if (self->demands_attention == hilite) + return; /* no change */ + /* don't allow focused windows to hilite */ self->demands_attention = hilite && !client_focused(self); if (self->demands_attention) @@ -2942,6 +2945,8 @@ gboolean client_focus(ObClient *self) return FALSE; } + ob_debug("Focusing client \"%s\" at time %u\n", self->title, event_curtime); + if (self->can_focus) { /* RevertToPointerRoot causes much more headache than RevertToNone, so I choose to use it always, hopefully to find errors quicker, if any -- cgit v1.2.3