aboutsummaryrefslogtreecommitdiff
path: root/voctogui/lib/toolbar/composition.py
diff options
context:
space:
mode:
authorMaZderMind <git@mazdermind.de>2015-11-15 19:18:28 +0100
committerMaZderMind <git@mazdermind.de>2015-11-15 19:18:28 +0100
commit96d9712579f49d57106ab1462e9571cfc53d222e (patch)
tree30f9b8a0ef838a165143321ff7e95667d1a5caff /voctogui/lib/toolbar/composition.py
parent7061df44a9f2291c9a9147dea6878bbc1bd424d8 (diff)
avoid re-reansmitting the same state again, fixes #20
Diffstat (limited to 'voctogui/lib/toolbar/composition.py')
-rw-r--r--voctogui/lib/toolbar/composition.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/voctogui/lib/toolbar/composition.py b/voctogui/lib/toolbar/composition.py
index f473ccf..a2b1f29 100644
--- a/voctogui/lib/toolbar/composition.py
+++ b/voctogui/lib/toolbar/composition.py
@@ -20,6 +20,7 @@ class CompositionToolbarController(object):
]
self.composite_btns = {}
+ self.current_composition = None
for idx, name in enumerate(composites):
key, mod = Gtk.accelerator_parse('F%u' % (idx+1))
@@ -42,9 +43,14 @@ class CompositionToolbarController(object):
return
btn_name = btn.get_name()
+ if self.current_composition == btn_name:
+ self.log.info('composition-mode already active: %s', btn_name)
+ return
+
self.log.info('composition-mode activated: %s', btn_name)
Connection.send('set_composite_mode', btn_name)
def on_composite_mode(self, mode):
self.log.info('on_composite_mode callback w/ mode %s', mode)
+ self.current_composition = mode
self.composite_btns[mode].set_active(True)