changeset 3231:25fd5355fcb9

Fixed #298: Updated handling of view jump/swap
author unexist
date Thu, 19 Jul 2012 13:52:09 +0200
parents 257a138aec01
children 18ca368e642a
files src/subtle/view.c
diffstat 1 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/view.c	Wed Jul 11 14:06:06 2012 +0200
+++ b/src/subtle/view.c	Thu Jul 19 13:52:09 2012 +0200
@@ -75,11 +75,12 @@
   s1  = SCREEN(subArrayGet(subtle->screens, screenid));
   vid = subArrayIndex(subtle->views, (void *)v);
 
-  /* Swap only makes sense with more than one screen */
-  if(swap && 1 < subtle->screens->ndata)
+  /* Check if view is visible on any screen */
+  if(subtle->visible_views & (1L << (vid + 1)))
     {
-      /* Check if view is visible on any screen */
-      if(subtle->visible_views & (1L << (vid + 1)))
+      /* This only makes sense with more than one screen
+       * otherwise just ignore that */
+      if(1 < subtle->screens->ndata)
         {
           int i;
 
@@ -90,17 +91,22 @@
 
               if(s2->viewid == vid)
                 {
-                  s2->viewid = s1->viewid;
+                  if(swap)
+                    {
+                      /* Swap views */
+                      s2->viewid = s1->viewid;
+                      s1->viewid = vid;
+                    }
+                  else subScreenWarp(s2);
 
                   break;
                 }
             }
         }
     }
+  else s1->viewid = vid;
 
-  /* Set view and configure */
-  s1->viewid = vid;
-
+  /* Finally configure and render */
   subScreenConfigure();
   subScreenRender();
   subScreenPublish();