changeset 3201:26b5e25c3d5b

Updated skip_pointer_warp check of subScreenWarp() and subClientWarp()
author unexist
date Thu, 12 Apr 2012 16:01:20 +0200
parents 14c6dc634785
children 6dbff72820b7
files src/subtle/client.c src/subtle/event.c src/subtle/screen.c
diffstat 3 files changed, 24 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/client.c	Wed Apr 11 12:32:43 2012 +0200
+++ b/src/subtle/client.c	Thu Apr 12 16:01:20 2012 +0200
@@ -558,7 +558,7 @@
     (void *)c);
 
   /* Warp pointer */
-  if(warp) subClientWarp(c);
+  if(warp && !(subtle->flags & SUB_SUBTLE_SKIP_WARP)) subClientWarp(c);
 
   /* Update screen */
   subScreenUpdate();
@@ -631,9 +631,8 @@
   assert(c);
 
   /* Move pointer to window center */
-  if(!(subtle->flags & SUB_SUBTLE_SKIP_WARP))
-    XWarpPointer(subtle->dpy, None, ROOT, 0, 0, 0, 0,
-      c->geom.x + c->geom.width / 2, c->geom.y + c->geom.height / 2);
+  XWarpPointer(subtle->dpy, None, ROOT, 0, 0, 0, 0,
+    c->geom.x + c->geom.width / 2, c->geom.y + c->geom.height / 2);
 
   subSubtleLogDebugSubtle("Warp\n");
 } /* }}} */
--- a/src/subtle/event.c	Wed Apr 11 12:32:43 2012 +0200
+++ b/src/subtle/event.c	Thu Apr 12 16:01:20 2012 +0200
@@ -712,7 +712,10 @@
                   {
                     subClientArrange(c, id, c->screenid);
                     subClientRestack(c, SUB_CLIENT_RESTACK_UP);
-                    subClientWarp(c);
+
+                    /* Warp pointer */
+                    if(!(subtle->flags & SUB_SUBTLE_SKIP_WARP))
+                      subClientWarp(c);
 
                     /* Hook: Tile */
                     subHookCall(SUB_HOOK_TILE, NULL);
@@ -1016,7 +1019,10 @@
                       {
                         subClientArrange(c, c->gravities[(int)ev->data.l[2]], c->screenid);
                         XRaiseWindow(subtle->dpy, c->win);
-                        subClientWarp(c);
+
+                        /* Warp pointer */
+                        if(!(subtle->flags & SUB_SUBTLE_SKIP_WARP))
+                          subClientWarp(c);
 
                         /* Hook: Tile */
                         subHookCall(SUB_HOOK_TILE, NULL);
@@ -1026,7 +1032,10 @@
                   {
                     subClientArrange(c, (int)ev->data.l[1], c->screenid);
                     XRaiseWindow(subtle->dpy, c->win);
-                    subClientWarp(c);
+
+                    /* Warp pointer */
+                    if(!(subtle->flags & SUB_SUBTLE_SKIP_WARP))
+                      subClientWarp(c);
 
                     /* Hook: Tile */
                     subHookCall(SUB_HOOK_TILE, NULL);
@@ -1115,7 +1124,10 @@
                       {
                         subClientArrange(c, 0, -1); ///< Fallback to first gravity
                         XRaiseWindow(subtle->dpy, c->win);
-                        subClientWarp(c);
+
+                        /* Warp pointer */
+                        if(!(subtle->flags & SUB_SUBTLE_SKIP_WARP))
+                          subClientWarp(c);
                       }
                   }
 
--- a/src/subtle/screen.c	Wed Apr 11 12:32:43 2012 +0200
+++ b/src/subtle/screen.c	Thu Apr 12 16:01:20 2012 +0200
@@ -195,7 +195,7 @@
   s->geom.width  = width;
   s->geom.height = height;
   s->base        = s->geom; ///< Backup size
-  s->viewid         = subtle->screens->ndata; ///< Init
+  s->viewid      = subtle->screens->ndata; ///< Init
 
   /* Create panel windows */
   sattrs.event_mask        = ButtonPressMask|EnterWindowMask|
@@ -363,7 +363,8 @@
 
               /* Warp after gravity and screen have been set if not disabled */
               if(c->flags & SUB_CLIENT_MODE_URGENT &&
-                  !(subtle->flags & SUB_SUBTLE_SKIP_URGENT_WARP))
+                  !(subtle->flags & SUB_SUBTLE_SKIP_URGENT_WARP) &&
+                  !(subtle->flags & SUB_SUBTLE_SKIP_WARP))
                 subClientWarp(c);
 
               /* EWMH: Desktop, screen */
@@ -650,9 +651,8 @@
   assert(s);
 
   /* Move pointer to screen center */
-  if(!(subtle->flags & SUB_SUBTLE_SKIP_WARP))
-    XWarpPointer(subtle->dpy, None, ROOT, 0, 0, s->geom.x, s->geom.y,
-      s->geom.x + s->geom.width / 2, s->geom.y + s->geom.height / 2);
+  XWarpPointer(subtle->dpy, None, ROOT, 0, 0, s->geom.x, s->geom.y,
+    s->geom.x + s->geom.width / 2, s->geom.y + s->geom.height / 2);
 
   subSubtleLogDebugSubtle("Warp\n");
 } /* }}} */