summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-27 23:05:54 +0000
committerDana Jansens <danakj@orodu.net>2003-03-27 23:05:54 +0000
commit8cc7c8b430370a14893d77311ddeb78a05b89cd2 (patch)
tree21e09a59b77cea3061a35243b01151b489507d50 /openbox
parent047fe67215d2f4c3e1763dbc0117a54849bfd812 (diff)
focus a window on desktop switch
Diffstat (limited to 'openbox')
-rw-r--r--openbox/screen.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbox/screen.c b/openbox/screen.c
index 50628730..a051d250 100644
--- a/openbox/screen.c
+++ b/openbox/screen.c
@@ -258,6 +258,7 @@ void screen_set_desktop(guint num)
{
GList *it;
guint old;
+ XEvent e;
g_assert(num < screen_num_desktops);
@@ -267,6 +268,8 @@ void screen_set_desktop(guint num)
if (old == num) return;
+ g_message("Moving to desktop %d", num+1);
+
/* show windows before hiding the rest to lessen the enter/leave events */
/* show windows from top to bottom */
@@ -283,6 +286,12 @@ void screen_set_desktop(guint num)
engine_frame_hide(c->frame);
}
+ /* focus the last focused window on the desktop, and ignore enter events
+ from the switch so it doesnt mess with the focus */
+ XSync(ob_display, FALSE);
+ while (XCheckTypedEvent(ob_display, EnterNotify, &e));
+ focus_fallback(TRUE);
+
dispatch_ob(Event_Ob_Desktop, num, old);
}