summaryrefslogtreecommitdiff
path: root/openbox/screen.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-04-22 19:13:38 +0000
committerDana Jansens <danakj@orodu.net>2007-04-22 19:13:38 +0000
commitbfb800c032e1dd50f5d1c37d1ce8ac9239947b01 (patch)
tree9729cf672c6490618f39926729fc5379cea41864 /openbox/screen.c
parent7d1226c57cbe2c83d87174b637bcf923897f8033 (diff)
a) remove focus_hilite, it is not needed and complicated things
b) set focus_client to null when nothing is actually focused, but still allow focus to go to black holes c) allow the focus action to be performed without a client, this will focus the openbox instance (i.e. the screen in multihead setups) big thanks to syscrash for the ideas on how to go about this
Diffstat (limited to 'openbox/screen.c')
-rw-r--r--openbox/screen.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/openbox/screen.c b/openbox/screen.c
index c6a6b0e5..a54b2b56 100644
--- a/openbox/screen.c
+++ b/openbox/screen.c
@@ -422,6 +422,7 @@ void screen_set_num_desktops(guint num)
void screen_set_desktop(guint num)
{
+ ObClient *c;
GList *it;
guint old;
@@ -459,19 +460,10 @@ void screen_set_desktop(guint num)
}
}
- focus_hilite = focus_fallback_target(TRUE, focus_client);
- if (focus_hilite) {
- frame_adjust_focus(focus_hilite->frame, TRUE);
-
- /*!
- When this focus_client check is not used, you can end up with
- races, as demonstrated with gnome-panel, sometimes the window
- you click on another desktop ends up losing focus cuz of the
- focus change here.
- */
- /*if (!focus_client)*/
- client_focus(focus_hilite);
- }
+ /* reduce flicker by hiliting now rather than waiting for the server
+ FocusIn event */
+ if ((c = focus_fallback_target(TRUE, focus_client)))
+ frame_adjust_focus(c->frame, TRUE);
event_ignore_queued_enters();
}
@@ -895,21 +887,12 @@ void screen_show_desktop(gboolean show)
break;
}
} else {
+ ObClient *c;
+
/* use NULL for the "old" argument because the desktop was focused
and we don't want to fallback to the desktop by default */
- focus_hilite = focus_fallback_target(TRUE, NULL);
- if (focus_hilite) {
- frame_adjust_focus(focus_hilite->frame, TRUE);
-
- /*!
- When this focus_client check is not used, you can end up with
- races, as demonstrated with gnome-panel, sometimes the window
- you click on another desktop ends up losing focus cuz of the
- focus change here.
- */
- /*if (!focus_client)*/
- client_focus(focus_hilite);
- }
+ if ((c = focus_fallback_target(TRUE, NULL)))
+ client_focus(c);
}
show = !!show; /* make it boolean */