changeset 3172:d832734823f1

Fixed #278: Added option to skip urgent pointer warps
author unexist
date Sat, 14 Jan 2012 16:10:02 +0100
parents 215fd4ad7cf0
children fbe5a1f65fae
files data/subtle.rb src/subtle/ruby.c src/subtle/screen.c src/subtle/subtle.h
diffstat 4 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/subtle.rb	Tue Jan 03 21:53:09 2012 +0100
+++ b/data/subtle.rb	Sat Jan 14 16:10:02 2012 +0100
@@ -43,6 +43,9 @@
 # Skip pointer movement on e.g. gravity change
 set :skip_pointer_warp, false
 
+# Skip pointer movement to urgent windows
+set :skip_urgent_warp, false
+
 # Set the WM_NAME of subtle (Java quirk)
 # set :wmname, "LG3D"
 
--- a/src/subtle/ruby.c	Tue Jan 03 21:53:09 2012 +0100
+++ b/src/subtle/ruby.c	Sat Jan 14 16:10:02 2012 +0100
@@ -1912,6 +1912,11 @@
                 if(!(subtle->flags & SUB_SUBTLE_CHECK) && Qtrue == value)
                   subtle->flags |= SUB_SUBTLE_SKIP_WARP;
               }
+            else if(CHAR2SYM("skip_urgent_warp") == option)
+              {
+                if(!(subtle->flags & SUB_SUBTLE_CHECK) && Qtrue == value)
+                  subtle->flags |= SUB_SUBTLE_SKIP_URGENT_WARP;
+              }
             else subSubtleLogWarn("Unknown option `:%s'\n", SYM2CHAR(option));
             break; /* }}} */
           case T_STRING: /* {{{ */
--- a/src/subtle/screen.c	Tue Jan 03 21:53:09 2012 +0100
+++ b/src/subtle/screen.c	Sat Jan 14 16:10:02 2012 +0100
@@ -355,8 +355,9 @@
               XMapWindow(subtle->dpy, c->win);
               subEwmhSetWMState(c->win, NormalState);
 
-              /* Warp after gravity and screen have been set */
-              if(c->flags & SUB_CLIENT_MODE_URGENT)
+              /* 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))
                 subClientWarp(c);
 
               /* EWMH: Desktop, screen */
--- a/src/subtle/subtle.h	Tue Jan 03 21:53:09 2012 +0100
+++ b/src/subtle/subtle.h	Sat Jan 14 16:10:02 2012 +0100
@@ -340,6 +340,7 @@
 #define SUB_SUBTLE_TILING             (1L << 12)                  ///< Enable tiling
 #define SUB_SUBTLE_FOCUS_CLICK        (1L << 13)                  ///< Click to focus
 #define SUB_SUBTLE_SKIP_WARP          (1L << 14)                  ///< Skip pointer warp
+#define SUB_SUBTLE_SKIP_URGENT_WARP   (1L << 15)                  ///< Skip urgent warp
 
 /* Tag flags */
 #define SUB_TAG_GRAVITY               (1L << 10)                  ///< Gravity property