aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-04 12:34:23 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-04 12:34:23 +0100
commit26d536eb55d4fc847a8c83660fa0de7c4b077bf3 (patch)
tree2784bba8c245bbff957da41bed941e5ce917e987 /src
parentfix threading issues in xmonad example (diff)
downloadxpybar-26d536eb55d4fc847a8c83660fa0de7c4b077bf3.tar.gz
xpybar-26d536eb55d4fc847a8c83660fa0de7c4b077bf3.tar.bz2
xpybar-26d536eb55d4fc847a8c83660fa0de7c4b077bf3.tar.xz
add Bar.invalidate
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/__main__.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/__main__.py b/src/__main__.py
index 6077a98..efc31fd 100755
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -398,6 +398,22 @@ class Bar:
self.change_colour(self.foreground)
self.change_font(self.font)
+ def invalidate(self):
+ '''
+ Cause the window to be redraw on the main window
+ '''
+ # Dummy event for performing update in the main thread # TODO do this better
+ e = Xlib.protocol.event.KeyPress(detail = 1,
+ time = Xlib.X.CurrentTime,
+ root = display.screen().root,
+ window = self.window,
+ child = Xlib.X.NONE,
+ root_x = 1, root_y = 1,
+ event_x = 1, event_y = 1,
+ state = 0, same_screen = 1)
+ display.send_event(self.window, e)
+ display.flush()
+
@staticmethod
def coloured_length(text):
'''