changeset 3206:77e0c21c1426

Fixed #290: Add default tag when client wouldn't be visible (including sticky) only
author unexist
date Tue, 22 May 2012 23:28:46 +0200
parents 25e264312f90
children d1ecee58305f
files src/subtle/client.c
diffstat 1 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/client.c	Tue May 22 23:15:36 2012 +0200
+++ b/src/subtle/client.c	Tue May 22 23:28:46 2012 +0200
@@ -347,7 +347,7 @@
   c = CLIENT(subSharedMemoryAlloc(1, sizeof(SubClient)));
   c->gravities = (int *)subSharedMemoryAlloc(subtle->views->ndata, sizeof(int));
   c->flags     = (SUB_TYPE_CLIENT|SUB_CLIENT_INPUT);
-  c->gravityid   = -1; ///< Force update
+  c->gravityid = -1; ///< Force update
   c->dir       = -1;
   c->win       = win;
 
@@ -911,7 +911,7 @@
 subClientRetag(SubClient *c,
   int *flags)
 {
-  int i, visible = 0;
+  int i;
 
   DEAD(c);
   assert(c);
@@ -927,14 +927,21 @@
     }
 
   /* Check if client is visible on at least one screen w/o stick */
-  for(i = 0; i < subtle->views->ndata; i++)
-    if(VIEW(subtle->views->data[i])->tags & c->tags)
-      {
-        visible++;
-        break;
-      }
+  if(!(c->flags & SUB_CLIENT_MODE_STICK) && !(*flags & SUB_CLIENT_MODE_STICK))
+    {
+      int visible = 0;
 
-  if(0 == visible) subClientTag(c, 0, flags); ///< Set default tag
+      for(i = 0; i < subtle->views->ndata; i++)
+        {
+          if(VIEW(subtle->views->data[i])->tags & c->tags)
+            {
+              visible++;
+              break;
+            }
+        }
+
+      if(0 == visible) subClientTag(c, 0, flags); ///< Set default tag
+    }
 
   /* EWMH: Tags */
   subEwmhSetCardinals(c->win, SUB_EWMH_SUBTLE_CLIENT_TAGS, (long *)&c->tags, 1);