aboutsummaryrefslogtreecommitdiffstats
path: root/examples/x-window-focus
diff options
context:
space:
mode:
Diffstat (limited to 'examples/x-window-focus')
-rw-r--r--examples/x-window-focus13
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/x-window-focus b/examples/x-window-focus
index cf5798b..3148a80 100644
--- a/examples/x-window-focus
+++ b/examples/x-window-focus
@@ -62,7 +62,11 @@ def x_window_focus_thread_function(proc):
# Get window specifications
wm_class = window.get_wm_class()
- wm_name = window.get_wm_name()
+ wm_name = None
+ try:
+ wm_name = window.get_wm_name()
+ except:
+ pass ## Bug in python3-xlib (?)
if (wm_class is None) and (wm_name is None):
x_display.next_event()
continue
@@ -73,9 +77,10 @@ def x_window_focus_thread_function(proc):
wm_name)
#sys.stderr.buffer.write((repr(window) + '\n').encode('utf-8'))
#sys.stderr.buffer.flush()
- except:
- x_display.next_event()
- continue
+ finally:
+ pass
+ #x_display.next_event()
+ #continue
# Check that something changed
if (last is not None) and (last == window):