[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Integrate monitor consequence with switchtag



---
 doc/herbstluftwm.txt | 10 ++++++----
 src/clientlist.c     |  7 +++++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/doc/herbstluftwm.txt b/doc/herbstluftwm.txt
index c973c2e..72b0b3c 100644
--- a/doc/herbstluftwm.txt
+++ b/doc/herbstluftwm.txt
@@ -1122,10 +1122,12 @@ Each 'CONSEQUENCE' consists of a 'NAME'='VALUE' pair. Valid 'NAMES' are:
 
 +monitor+::
     moves the client to the tag on monitor 'VALUE'. If the tag consequence was
-    also specified, move the client to that tag, then display that tag on
-    monitor 'VALUE'. In the case where the tag consequence is also specified, if
-    either of the tag or monitor values do not refer to an actual monitor or
-    tag, hlwm will behave as if that consequence was not set.
+    also specified, and switchtag is set for the client, move the client to that
+    tag, then display that tag on monitor 'VALUE'. If the tag consequence was
+    specified, but switchtag was not, ignore this consequence. In the case where
+    the tag consequence is also specified, if either of the tag or monitor
+    values do not refer to an actual monitor or tag, hlwm will behave as if that
+    consequence was not set.
 
 +focus+::
     decides whether the client gets the input focus on his tag.  The default is
diff --git a/src/clientlist.c b/src/clientlist.c
index 56721f2..9a7d862 100644
--- a/src/clientlist.c
+++ b/src/clientlist.c
@@ -250,8 +250,11 @@ HSClient* manage_client(Window win) {
         if (monitor) {
             // a valid tag was not already found, use the target monitor's tag
             if (!client->tag) { client->tag = monitor->tag; }
-            // a tag was already found, display it on the target monitor
-            else { monitor_set_tag(monitor, client->tag); }
+            // a tag was already found, display it on the target monitor, but
+            // only if switchtag is set
+            else if (changes.switchtag) {
+                monitor_set_tag(monitor, client->tag);
+            }
         }
     }
 
-- 
1.9.0


--=_zucker.schokokeks.org-7156-1394906533-0001-2--