add function screen_compare_desktops()
authorDana Jansens <danakj@orodu.net>
Thu, 14 Oct 2010 23:39:34 +0000 (19:39 -0400)
committerDana Jansens <danakj@orodu.net>
Mon, 24 Jan 2011 19:19:22 +0000 (14:19 -0500)
tells if two windows' current desktops are considered logically on the same
  desktop (taking "all desktops" into account)
if a window is on "all desktops" it is considered to be on the current desktop
  only - windows can only be in one place at a time.

openbox/screen.c
openbox/screen.h

index a94347e..e0277ed 100644 (file)
@@ -1753,3 +1753,12 @@ gboolean screen_pointer_pos(gint *x, gint *y)
     }
     return ret;
 }
     }
     return ret;
 }
+
+gboolean screen_compare_desktops(guint a, guint b)
+{
+    if (a == DESKTOP_ALL)
+        a = screen_desktop;
+    if (b == DESKTOP_ALL)
+        b = screen_desktop;
+    return a == b;
+}
index d15b352..a6a3995 100644 (file)
@@ -164,4 +164,12 @@ gboolean screen_pointer_pos(gint *x, gint *y);
 /*! Returns the monitor which contains the pointer device */
 guint screen_monitor_pointer(void);
 
 /*! Returns the monitor which contains the pointer device */
 guint screen_monitor_pointer(void);
 
+/*! Compare the desktop for two windows to see if they are considered on the
+  same desktop.
+  Windows that are on "all desktops" are treated like they are only on the
+  current desktop, so they are only in one place at a time.
+  @return TRUE if they are on the same desktop, FALSE otherwise.
+*/
+gboolean screen_compare_desktops(guint a, guint b);
+
 #endif
 #endif