]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
get the mouse pointer position if it is on another screen too.
[chaz/openbox] / openbox / screen.c
index d48d0dda2284fc6b1ec80cd1bfcf7a8de93ff3cb..dea9d020f66293b5bac3e4ea0330f1e0dd8ec19b 100644 (file)
@@ -1267,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.02197 seconds and 4 git commands to generate.