]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
button presses which run actions during interactive actions will cancel the action.
[chaz/openbox] / openbox / screen.c
index 5fc2bb9221390ecac63b6710d64a54dbfd578a67..dea9d020f66293b5bac3e4ea0330f1e0dd8ec19b 100644 (file)
@@ -485,6 +485,27 @@ void screen_set_desktop(guint num, gboolean dofocus)
         }
     }
 
+    /* have to try focus here because when you leave an empty desktop
+       there is no focus out to watch for
+
+       do this before hiding the windows so if helper windows are coming
+       with us, they don't get hidden
+    */
+    if (dofocus && (c = focus_fallback_target(TRUE, focus_client))) {
+        /* only do the flicker reducing stuff ahead of time if we are going
+           to call xsetinputfocus on the window ourselves. otherwise there is
+           no guarantee the window will actually take focus.. */
+        if (c->can_focus) {
+            /* do this here so that if you switch desktops to a window with
+               helper windows then the helper windows won't flash */
+            client_bring_helper_windows(c);
+            /* reduce flicker by hiliting now rather than waiting for the
+               server FocusIn event */
+            frame_adjust_focus(c->frame, TRUE);
+        }
+        client_focus(c);
+    }
+
     /* hide windows from bottom to top */
     for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
         if (WINDOW_IS_CLIENT(it->data)) {
@@ -493,15 +514,6 @@ void screen_set_desktop(guint num, gboolean dofocus)
         }
     }
 
-    /* have to try focus here because when you leave an empty desktop
-       there is no focus out to watch for */
-    if (dofocus && (c = focus_fallback_target(TRUE, focus_client))) {
-        /* reduce flicker by hiliting now rather than waiting for the server
-           FocusIn event */
-        frame_adjust_focus(c->frame, TRUE);
-        client_focus(c);
-    }
-
     event_ignore_queued_enters();
 
     if (event_curtime != CurrentTime)
@@ -1255,7 +1267,16 @@ gboolean screen_pointer_pos(gint *x, gint *y)
     Window w;
     gint i;
     guint u;
-
-    return !!XQueryPointer(ob_display, RootWindow(ob_display, ob_screen),
-                           &w, &w, x, y, &i, &i, &u);
+    gboolean ret;
+
+    ret = !!XQueryPointer(ob_display, RootWindow(ob_display, ob_screen),
+                          &w, &w, x, y, &i, &i, &u);
+    if (!ret) {
+        for (i = 0; i < ScreenCount(ob_display); ++i)
+            if (i != ob_screen)
+                if (XQueryPointer(ob_display, RootWindow(ob_display, i),
+                                  &w, &w, x, y, &i, &i, &u))
+                    break;
+    }
+    return ret;
 }
This page took 0.026367 seconds and 4 git commands to generate.