Don't clobber loop variable with return value
authorMikael Magnusson <mikachu@gmail.com>
Fri, 5 May 2017 17:57:15 +0000 (19:57 +0200)
committerMikael Magnusson <mikachu@gmail.com>
Fri, 5 May 2017 17:57:15 +0000 (19:57 +0200)
Fixes bug 6383.

openbox/screen.c

index e758ada..31cb8de 100644 (file)
@@ -1903,18 +1903,21 @@ guint screen_monitor_pointer()
 
 gboolean screen_pointer_pos(gint *x, gint *y)
 {
-    Window w;
     gint i;
-    guint u;
     gboolean ret;
 
+    /* we don't care about any of these return values, but we can't pass NULL */
+    Window w;
+    guint u;
+    gint j;
+
     ret = !!XQueryPointer(obt_display, obt_root(ob_screen),
-                          &w, &w, x, y, &i, &i, &u);
+                          &w, &w, x, y, &j, &j, &u);
     if (!ret) {
         for (i = 0; i < ScreenCount(obt_display); ++i)
             if (i != ob_screen)
-                if (XQueryPointer(obt_display, obt_root(i),
-                                  &w, &w, x, y, &i, &i, &u))
+                if ((ret=XQueryPointer(obt_display, obt_root(i),
+                                  &w, &w, x, y, &j, &j, &u)))
                     break;
     }
     return ret;