diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-04 12:34:23 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-04 12:34:23 +0100 |
commit | 26d536eb55d4fc847a8c83660fa0de7c4b077bf3 (patch) | |
tree | 2784bba8c245bbff957da41bed941e5ce917e987 /src | |
parent | fix threading issues in xmonad example (diff) | |
download | xpybar-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-x | src/__main__.py | 16 |
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): ''' |