changeset 3162:17394e21d0de

Updated selection of screen when skip_pointer_warp is enabled
author unexist
date Mon, 19 Dec 2011 19:54:12 +0100
parents 7d63ac8f6460
children 97650efd5b70
files src/subtle/event.c
diffstat 1 files changed, 16 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/event.c	Mon Dec 19 19:43:35 2011 +0100
+++ b/src/subtle/event.c	Mon Dec 19 19:54:12 2011 +0100
@@ -356,11 +356,7 @@
       subScreenRender();
 
       /* Update focus if necessary */
-      if(-1 != sid)
-        {
-          c = subClientNext(sid);
-          if(c) subClientFocus(c, True);
-        }
+      if((c = subClientNext(sid, False))) subClientFocus(c, True);
     }
   else if((t = TRAY(subSubtleFind(ev->event, TRAYID)))) ///< Tray
     {
@@ -376,11 +372,7 @@
       subScreenRender();
 
       /* Update focus if necessary */
-      if(focus)
-        {
-          c = subClientNext(0);
-          if(c) subClientFocus(c, True);
-        }
+      if(focus && (c = subClientNext(0, False))) subClientFocus(c, True);
     }
   else
     {
@@ -620,7 +612,7 @@
 
                     if(!VISIBLE(c))
                       {
-                        c = subClientNext(c->screenid);
+                        c = subClientNext(c->screenid, False);
                         if(c) subClientFocus(c, True);
                       }
 
@@ -677,7 +669,7 @@
                         }
                     }
                   }
-                else found = subClientNext(0);
+                else found = subClientNext(-1, True);
 
                 if(found) subClientFocus(found, True);
               }
@@ -738,8 +730,9 @@
                 int sid = -1;
 
                 /* Find screen: Prefer screen of current window */
-                if((c = CLIENT(subSubtleFind(subtle->windows.focus[0], CLIENTID))) &&
-                    VISIBLE(c))
+                if(subtle->flags & SUB_SUBTLE_SKIP_WARP &&
+                    (c = CLIENT(subSubtleFind(subtle->windows.focus[0],
+                    CLIENTID))) && VISIBLE(c))
                   sid = c->screenid;
                 else subScreenFind(x, y, &sid);
 
@@ -753,8 +746,9 @@
                 int vid = 0, sid = 0;
 
                 /* Find screen: Prefer screen of current window */
-                if((c = CLIENT(subSubtleFind(subtle->windows.focus[0], CLIENTID))) &&
-                    VISIBLE(c))
+                if(subtle->flags & SUB_SUBTLE_SKIP_WARP &&
+                    (c = CLIENT(subSubtleFind(subtle->windows.focus[0],
+                    CLIENTID))) && VISIBLE(c))
                   {
                     s   = SCREEN(subArrayGet(subtle->screens, c->screenid));
                     sid = c->screenid;
@@ -979,7 +973,7 @@
                 if(subtle->windows.focus[0] == c->win &&
                     !VISIBLE(c))
                   {
-                    c = subClientNext(c->screenid);
+                    c = subClientNext(c->screenid, False);
                     if(c) subClientFocus(c, True);
                   }
 
@@ -1409,7 +1403,7 @@
 
                     if(!VISIBLE(c))
                       {
-                        c = subClientNext(c->screenid);
+                        c = subClientNext(c->screenid, False);
                         if(c) subClientFocus(c, True);
                       }
 
@@ -1567,7 +1561,7 @@
 #endif
 } /* }}} */
 
-/* EventSelection {{{ */
+/* EventSelft on heection {{{ */
 void
 EventSelection(XSelectionClearEvent *ev)
 {
@@ -1620,11 +1614,7 @@
       subScreenRender();
 
       /* Update focus if necessary */
-      if(-1 != sid)
-        {
-          c = subClientNext(sid);
-          if(c) subClientFocus(c, True);
-        }
+      if((c = subClientNext(sid, False))) subClientFocus(c, True);
     }
   else if((t = TRAY(subSubtleFind(ev->window, TRAYID)))) ///< Tray
     {
@@ -1651,11 +1641,7 @@
       subScreenRender();
 
       /* Update focus if necessary */
-      if(focus)
-        {
-          c = subClientNext(0);
-          if(c) subClientFocus(c, True);
-        }
+      if(focus && (c = subClientNext(0, False))) subClientFocus(c, True);
     }
 
   subSubtleLogDebugEvents("Unmap: win=%#lx\n", ev->window);
@@ -1742,7 +1728,7 @@
 
   /* Set grabs and focus first client if any */
   subGrabSet(ROOT, SUB_GRAB_KEY);
-  c = subClientNext(0);
+  c = subClientNext(0, False);
   if(c) subClientFocus(c, True);
 
   /* Hook: Start */