changeset 3202:6dbff72820b7

Added proper screen selection to View#jump
author unexist
date Sat, 14 Apr 2012 16:30:51 +0200
parents 26b5e25c3d5b
children 793b1315b386
files src/subtle/event.c src/subtlext/view.c
diffstat 2 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/event.c	Thu Apr 12 16:01:20 2012 +0200
+++ b/src/subtle/event.c	Sat Apr 14 16:30:51 2012 +0200
@@ -890,26 +890,22 @@
             /* Switchs views of screen */
             if(0 <= ev->data.l[0] && ev->data.l[0] < subtle->views->ndata)
               {
+                int sid = 0;
+
                 /* Focus view of specified or current screen */
-                if(0 <= ev->data.l[2] && ev->data.l[2] < subtle->screens->ndata)
+                if(0 > ev->data.l[2] || ev->data.l[2] >= subtle->screens->ndata)
                   {
-                    subViewFocus(subtle->views->data[ev->data.l[0]],
-                      ev->data.l[2], False, True);
-                  }
-                else
-                  {
-                    int sid = 0;
-
                     /* Find screen: Prefer screen of current window */
                     if(subtle->flags & SUB_SUBTLE_SKIP_WARP &&
                         (c = CLIENT(subSubtleFind(subtle->windows.focus[0],
                         CLIENTID))) && VISIBLE(c))
                       sid = c->screenid;
                     else subScreenCurrent(&sid);
+                  }
+                else sid = ev->data.l[2];
 
-                    subViewFocus(subtle->views->data[ev->data.l[0]],
-                      sid, False, True);
-                  }
+                subViewFocus(subtle->views->data[ev->data.l[0]],
+                  sid, True, True);
               }
             break; /* }}} */
           case SUB_EWMH_NET_ACTIVE_WINDOW: /* {{{ */
--- a/src/subtlext/view.c	Thu Apr 12 16:01:20 2012 +0200
+++ b/src/subtlext/view.c	Sat Apr 14 16:30:51 2012 +0200
@@ -493,6 +493,7 @@
 
   /* Send message */
   data.l[0] = FIX2INT(id);
+  data.l[2] = -1;
 
   subSharedMessage(display, DefaultRootWindow(display),
     "_NET_CURRENT_DESKTOP", data, 32, True);