changeset 3165:ee26265167ea

Updated #274: Replaced stick screen check with a flag
author unexist
date Thu, 22 Dec 2011 19:13:40 +0100
parents 969d3f467b05
children c27ec8ccca62
files src/subtle/client.c src/subtle/subtle.h
diffstat 2 files changed, 20 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/client.c	Thu Dec 22 19:02:54 2011 +0100
+++ b/src/subtle/client.c	Thu Dec 22 19:13:40 2011 +0100
@@ -895,8 +895,11 @@
         }
 
       /* Set screen */
-      if(t->flags & SUB_CLIENT_MODE_STICK)
-        c->screenid  = t->screenid;
+      if(t->flags & SUB_CLIENT_MODE_STICK && -1 != t->screenid)
+        {
+          c->flags    |= SUB_CLIENT_MODE_STICK_SCREEN;
+          c->screenid  = t->screenid;
+        }
 
       /* Set gravity matching views */
       for(i = 0; i < subtle->views->ndata; i++)
@@ -1205,8 +1208,8 @@
                 }
             }
 
-          /* Set screen when unset */
-          if(-1 == c->screenid)
+          /* Set screen when required*/
+          if(!(c->flags & SUB_CLIENT_MODE_STICK_SCREEN))
             {
               /* Find screen: Prefer screen of current window */
               if(subtle->flags & SUB_SUBTLE_SKIP_WARP &&
--- a/src/subtle/subtle.h	Thu Dec 22 19:02:54 2011 +0100
+++ b/src/subtle/subtle.h	Thu Dec 22 19:13:40 2011 +0100
@@ -226,19 +226,20 @@
 #define SUB_CLIENT_MODE_FULL          (1L << 16)                  ///< Fullscreen mode (also used in tags)
 #define SUB_CLIENT_MODE_FLOAT         (1L << 17)                  ///< Float mode
 #define SUB_CLIENT_MODE_STICK         (1L << 18)                  ///< Stick mode
-#define SUB_CLIENT_MODE_URGENT        (1L << 19)                  ///< Urgent mode
-#define SUB_CLIENT_MODE_RESIZE        (1L << 20)                  ///< Resize mode
-#define SUB_CLIENT_MODE_ZAPHOD        (1L << 21)                  ///< Zaphod mode
-#define SUB_CLIENT_MODE_FIXED         (1L << 22)                  ///< Fixed size mode
-#define SUB_CLIENT_MODE_CENTER        (1L << 23)                  ///< Center position mode
-#define SUB_CLIENT_MODE_BORDERLESS    (1L << 24)                  ///< Borderless
+#define SUB_CLIENT_MODE_STICK_SCREEN  (1L << 19)                  ///< Stick tagged screen mode
+#define SUB_CLIENT_MODE_URGENT        (1L << 20)                  ///< Urgent mode
+#define SUB_CLIENT_MODE_RESIZE        (1L << 21)                  ///< Resize mode
+#define SUB_CLIENT_MODE_ZAPHOD        (1L << 22)                  ///< Zaphod mode
+#define SUB_CLIENT_MODE_FIXED         (1L << 23)                  ///< Fixed size mode
+#define SUB_CLIENT_MODE_CENTER        (1L << 24)                  ///< Center position mode
+#define SUB_CLIENT_MODE_BORDERLESS    (1L << 25)                  ///< Borderless
 
-#define SUB_CLIENT_TYPE_NORMAL        (1L << 25)                  ///< Normal type (also used in match)
-#define SUB_CLIENT_TYPE_DESKTOP       (1L << 26)                  ///< Desktop type
-#define SUB_CLIENT_TYPE_DOCK          (1L << 27)                  ///< Dock type
-#define SUB_CLIENT_TYPE_TOOLBAR       (1L << 28)                  ///< Toolbar type
-#define SUB_CLIENT_TYPE_SPLASH        (1L << 29)                  ///< Splash type
-#define SUB_CLIENT_TYPE_DIALOG        (1L << 30)                  ///< Dialog type
+#define SUB_CLIENT_TYPE_NORMAL        (1L << 26)                  ///< Normal type (also used in match)
+#define SUB_CLIENT_TYPE_DESKTOP       (1L << 27)                  ///< Desktop type
+#define SUB_CLIENT_TYPE_DOCK          (1L << 28)                  ///< Dock type
+#define SUB_CLIENT_TYPE_TOOLBAR       (1L << 29)                  ///< Toolbar type
+#define SUB_CLIENT_TYPE_SPLASH        (1L << 30)                  ///< Splash type
+#define SUB_CLIENT_TYPE_DIALOG        (1L << 31)                  ///< Dialog type
 
 /* Client restack */
 #define SUB_CLIENT_RESTACK_DOWN       0                           ///< Restack down