]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
use a context enum instead of quarks
[chaz/openbox] / openbox / screen.c
index 506287303e3af6137430cf860bf529595d0ca813..5cf2bc5590a8bfe5248f9aa8b82e38c53774dad7 100644 (file)
@@ -244,7 +244,7 @@ void screen_set_num_desktops(guint num)
     for (it = client_list; it != NULL; it = it->next) {
         Client *c = it->data;
         if (c->desktop >= num)
-            client_set_desktop(c, num - 1);
+            client_set_desktop(c, num - 1, FALSE);
     }
 
     dispatch_ob(Event_Ob_NumDesktops, num, old);
@@ -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);
 }
 
This page took 0.020834 seconds and 4 git commands to generate.