From 98304406432cda3a94c2a57f0812714a229ec77a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 10 May 2007 00:57:35 +0000 Subject: make restacking much better, yay no more cludge using actions to raise windows. when a window changes layer it uses add_nonintrusive now so it won't cover the focused window. this way fullscreen windows when they drop down, don't cover up the new focus target. fix add_nonintrusive so that if the window is focused it gets added to the top add back support for ConfigureRequest restacking, this time properly though, using all the detail and sibling modes. but when windows use this to raise they are using some old business and we're going to assume they actually want to activate instead. this means firefox works nicely. yay. ubuntu's firefox has been made to just stop raising entirely though. ! --- openbox/event.c | 51 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) (limited to 'openbox/event.c') diff --git a/openbox/event.c b/openbox/event.c index 566739c9..0c594d6b 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1019,20 +1019,55 @@ static void event_handle_client(ObClient *client, XEvent *e) } if (e->xconfigurerequest.value_mask & CWStackMode) { + ObClient *sibling = NULL; + + /* get the sibling */ + if (e->xconfigurerequest.value_mask & CWSibling) { + ObWindow *win; + win = g_hash_table_lookup(window_map, + &e->xconfigurerequest.above); + if (WINDOW_IS_CLIENT(win)) + sibling = WINDOW_AS_CLIENT(win); + } + switch (e->xconfigurerequest.detail) { case Below: + ob_debug("ConfigureRequest Below for client %s sibling %s\n", + client->title, sibling ? sibling->title : "(all)"); + /* just lower it */ + stacking_lower(CLIENT_AS_WINDOW(client)); + break; case BottomIf: - /* Apps are so rude. And this is totally disconnected from - activation/focus. Bleh. */ - /*client_lower(client);*/ + ob_debug("ConfigureRequest BottomIf for client %s sibling " + "%s\n", + client->title, sibling ? sibling->title : "(all)"); + /* if this client occludes sibling (or anything if NULL), then + lower it to the bottom */ + if (stacking_occluded(sibling, client)) + stacking_lower(CLIENT_AS_WINDOW(client)); break; - case Above: + ob_debug("ConfigureRequest Above for client %s sibling %s\n", + client->title, sibling ? sibling->title : "(all)"); + /* activate it rather than just focus it */ + client_activate(client, FALSE, FALSE); + break; case TopIf: + ob_debug("ConfigureRequest TopIf for client %s sibling %s\n", + client->title, sibling ? sibling->title : "(all)"); + if (stacking_occluded(client, sibling)) + /* activate it rather than just focus it */ + client_activate(client, FALSE, FALSE); + case Opposite: + ob_debug("ConfigureRequest Opposite for client %s sibling " + "%s\n", + client->title, sibling ? sibling->title : "(all)"); + if (stacking_occluded(client, sibling)) + /* activate it rather than just focus it */ + client_activate(client, FALSE, FALSE); + else if (stacking_occluded(sibling, client)) + stacking_lower(CLIENT_AS_WINDOW(client)); default: - /* Apps are so rude. And this is totally disconnected from - activation/focus. Bleh. */ - /*client_raise(client);*/ break; } } @@ -1601,7 +1636,7 @@ static gboolean focus_delay_func(gpointer data) event_curtime = d->time; if (focus_client != d->client) { if (client_focus(d->client) && config_focus_raise) - client_raise(d->client); + stacking_raise(CLIENT_AS_WINDOW(d->client)); } event_curtime = old; return FALSE; /* no repeat */ -- cgit v1.2.3