]> Dogcows Code - chaz/openbox/commitdiff
get the mouse pointer position if it is on another screen too.
authorDana Jansens <danakj@orodu.net>
Wed, 9 May 2007 04:04:53 +0000 (04:04 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 9 May 2007 04:04:53 +0000 (04:04 +0000)
let you move/resize from the client menu if the mouse is on another screen

openbox/client_menu.c
openbox/screen.c
openbox/screen.h

index 35acd4fd707d37ac2b3388e2ca427d3f4a1aba2d..a44fcbcc5e4cc8e332bec6ee8e11d509368eb63d 100644 (file)
@@ -133,18 +133,18 @@ static void client_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
         menu_frame_hide_all();
         f = NULL; /* and don't update */
 
-        if (screen_pointer_pos(&x, &y))
-            moveresize_start(c, x, y, 0,
-                             prop_atoms.net_wm_moveresize_move_keyboard);
+        screen_pointer_pos(&x, &y);
+        moveresize_start(c, x, y, 0,
+                         prop_atoms.net_wm_moveresize_move_keyboard);
         break;
     case CLIENT_RESIZE:
         /* this needs to grab the keyboard so hide the menu */
         menu_frame_hide_all();
         f = NULL; /* and don't update */
 
-        if (screen_pointer_pos(&x, &y))
-            moveresize_start(c, x, y, 0,
-                             prop_atoms.net_wm_moveresize_size_keyboard);
+        screen_pointer_pos(&x, &y);
+        moveresize_start(c, x, y, 0,
+                         prop_atoms.net_wm_moveresize_size_keyboard);
         break;
     case CLIENT_CLOSE:
         client_close(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;
 }
index ccaa4f5726edb486efd68994465e9c2654f1c6e6..a84170f84e45145d2e4bf9d8a1b43c171ab693f2 100644 (file)
@@ -107,6 +107,8 @@ guint screen_find_monitor(Rect *search);
   gotta call it to let it know it should change. */
 void screen_set_root_cursor();
 
+/*! Gives back the pointer's position in x and y. Returns TRUE if the pointer
+  is on this screen and FALSE if it is on another screen. */
 gboolean screen_pointer_pos(gint *x, gint *y);
 
 #endif
This page took 0.028514 seconds and 4 git commands to generate.