aboutsummaryrefslogtreecommitdiff
path: root/xlib.py
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2025-04-26 09:34:47 +0200
committerSébastien Dailly <sebastien@dailly.me>2025-04-28 17:27:50 +0200
commit50d040446ed1a1211c0f1ddc6a64438cc5b49c02 (patch)
tree42be8b17ca1ccc86aae56b45aef7c4b6e4fb4c30 /xlib.py
parent5977071580763398eb215baea91a9bf4c50533c0 (diff)
Added a sort of prioritisation in the mappingHEADmaster
Diffstat (limited to 'xlib.py')
-rw-r--r--xlib.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/xlib.py b/xlib.py
index 4577e96..159e1c8 100644
--- a/xlib.py
+++ b/xlib.py
@@ -1,4 +1,3 @@
-#!/usr/bin/python3
import Xlib
import Xlib.display
@@ -69,12 +68,15 @@ class Listener(Thread):
# the layer (because it is the same as the previous) we do not
# switch back to the default layer.
found = True
- if code != self.last_code:
+ if code != self.last_code:
component.handle(Debug("Switching to '%s' for '%s'" % (pattern, window_name)))
self.queue.put ( (code, None) )
self.last_code = code
- break
+ # We found a matching configuration. Even if the match is the
+ # same as the current one, we break the loop in order to
+ # prevent another layer to update.
+ break
if not found and self.last_code != "default":
default = self.mapping.get("default", None)
if default is None: