summaryrefslogtreecommitdiff
path: root/openbox/focus.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-09-15 10:54:07 +0000
committerDana Jansens <danakj@orodu.net>2003-09-15 10:54:07 +0000
commit4ccc4c5ed7d5cffc4bf733191f7bc30fbbf069c8 (patch)
treec576a940be5853ac5ec9bde841f797d63e78061c /openbox/focus.c
parent17676168255fcf5cbec9ea5dadcee546c5ab7bbb (diff)
break focus. or maybe make it better.
these changes make it work when you alt-tab off a fullscreen window, that it doesnt iconify, and that it is immediately restacked instead of waiting for a FocusIn event to arrive. The code now assumes that if the window says it can focus, that if we focus it, it is focused. add the XDone handler to ObMainLoop, which is fired upon the occurance of there being no more X events to read.
Diffstat (limited to 'openbox/focus.c')
-rw-r--r--openbox/focus.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/openbox/focus.c b/openbox/focus.c
index a7904910..2582736b 100644
--- a/openbox/focus.c
+++ b/openbox/focus.c
@@ -73,7 +73,7 @@ void focus_set_client(ObClient *client)
screen_install_colormap(focus_client, FALSE);
screen_install_colormap(client, TRUE);
- if (client == NULL) {
+ if (!client) {
/* when nothing will be focused, send focus to the backup target */
XSetInputFocus(ob_display, screen_support_win, RevertToPointerRoot,
event_lasttime);
@@ -87,16 +87,22 @@ void focus_set_client(ObClient *client)
old = focus_client;
focus_client = client;
- /* move to the top of the list */
- if (client != NULL)
- push_to_top(client);
+ if (old) {
+ /* focus state can affect the stacking layer */
+ client_calc_layer(old);
+ }
+ if (client) {
+ /* focus state can affect the stacking layer */
+ client_calc_layer(client);
- /* set the NET_ACTIVE_WINDOW hint, but preserve it on shutdown */
- if (ob_state() != OB_STATE_EXITING) {
- active = client ? client->window : None;
- PROP_SET32(RootWindow(ob_display, ob_screen),
- net_active_window, window, active);
+ /* move to the top of the list */
+ push_to_top(client);
}
+
+ /* set the NET_ACTIVE_WINDOW hint */
+ active = client ? client->window : None;
+ PROP_SET32(RootWindow(ob_display, ob_screen),
+ net_active_window, window, active);
}
static gboolean focus_under_pointer()