changeset 3158:3e17c26bfab3

Fixed screen handling of sticky windows
author unexist
date Wed, 14 Dec 2011 23:17:51 +0100
parents 07d9e41d7b85
children 0f22f61cd418
files src/subtle/client.c src/subtle/event.c
diffstat 2 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/client.c	Wed Dec 14 22:40:56 2011 +0100
+++ b/src/subtle/client.c	Wed Dec 14 23:17:51 2011 +0100
@@ -1182,6 +1182,8 @@
       /* Set sticky mode */
       if(type & SUB_CLIENT_MODE_STICK)
         {
+          SubClient *focus = NULL;
+
           /* Check if gravity should be set */
           if(gravity)
             {
@@ -1198,8 +1200,12 @@
                 }
             }
 
-          /* Set screen stick and force re-arrange */
-          //subScreenCurrent(&c->screenid);
+          /* Prefer screen of current window, set it and re-arrange*/
+          if((focus = CLIENT(subSubtleFind(subtle->windows.focus[0],
+              CLIENTID))) && VISIBLE(c))
+            c->screenid = focus->screenid;
+          else subScreenCurrent(&c->screenid);
+
           c->flags |= SUB_CLIENT_ARRANGE;
         }
 
--- a/src/subtle/event.c	Wed Dec 14 22:40:56 2011 +0100
+++ b/src/subtle/event.c	Wed Dec 14 23:17:51 2011 +0100
@@ -904,13 +904,10 @@
                     int sid = 0;
 
                     /* Find screen: Prefer screen of current window */
-                    if((c = CLIENT(subSubtleFind(subtle->windows.focus[0], CLIENTID))) &&
-                        VISIBLE(c))
-                      {
-                        s   = SCREEN(subArrayGet(subtle->screens, c->screenid));
-                        sid = c->screenid;
-                      }
-                    else s = subScreenCurrent(&sid);
+                    if((c = CLIENT(subSubtleFind(subtle->windows.focus[0],
+                        CLIENTID))) && VISIBLE(c))
+                      sid = c->screenid;
+                    else subScreenCurrent(&sid);
 
                     subViewFocus(subtle->views->data[ev->data.l[0]],
                       sid, False, True);