summaryrefslogtreecommitdiff
path: root/openbox/event.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2010-10-16 17:19:24 -0400
committerDana Jansens <danakj@orodu.net>2011-01-24 14:19:23 -0500
commit385967b55290105f074080890d55b50d9622b89d (patch)
tree93004d6c72d4bf2b0d5c787ad4304f5553eeafe5 /openbox/event.c
parentd291a9c7aa685b6d8bd6aa70cdc543926702c301 (diff)
Make NET_ACTIVE messages always treated as from the user. Loosen up focus stealing for user-requested focusing.
Seems panels such as xfce's and gnome's still treat their activation requests as being from an application when a user has requested it. Make the focus stealing code more lenient for user-requested focusings (_NET_ACTIVE). But treat new windows as not user-requested unless they gave a launch time. When activating a window, if another window would be the one to actually get focused, then activate that instead (avoid clicking a window in the panel and nothing happens).
Diffstat (limited to 'openbox/event.c')
-rw-r--r--openbox/event.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/openbox/event.c b/openbox/event.c
index 8a52402e..b39660a6 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -1443,9 +1443,15 @@ static void event_handle_client(ObClient *client, XEvent *e)
ob_debug_type(OB_DEBUG_APP_BUGS,
"_NET_ACTIVE_WINDOW message for window %s is "
"missing source indication", client->title);
- client_activate(client, FALSE, FALSE, TRUE, TRUE,
- (e->xclient.data.l[0] == 0 ||
- e->xclient.data.l[0] == 2));
+ /* TODO(danakj) This should use
+ (e->xclient.data.l[0] == 0 ||
+ e->xclient.data.l[0] == 2)
+ to determine if a user requested the activation, however GTK+
+ applications seem unable to make this distinction ever
+ (including panels such as xfce4-panel and gnome-panel).
+ So we are left just assuming all activations are from the user.
+ */
+ client_activate(client, FALSE, FALSE, TRUE, TRUE, TRUE);
} else if (msgtype == OBT_PROP_ATOM(NET_WM_MOVERESIZE)) {
ob_debug("net_wm_moveresize for 0x%lx direction %d",
client->window, e->xclient.data.l[2]);