Hello,
I’m trying to monitor the clipboard on ubuntu using the TheClipboard object.
Everything is ok when looping within the main thread but it fails
when using a different thread.
The different thread doesn’t do any gui related stuff, it just reads the clipboard and in
case of a change it calls the function to let the gui know about the changes.
But I do get weird results like App hungs, Messages like (the bolded ones)
[pid:15453 ] sys.version:2.7.12 (default, Nov 19 2016, 06:48:10)
[pid:15453 ] [GCC 5.4.0 20160609]
[pid:15453 ] wx.version():3.0.2.0 gtk2 (classic)
[pid:15453 ] platform.release():4.4.0-72-generic
[pid:15453 ] platform.linux_dist():(‘Ubuntu’, ‘16.04’, ‘xenial’)
[pid:15453 ]
[pid:15453 ] (clipboard_history.py:15453): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion ‘GDK_IS_WINDOW (window)’ failed
[pid:15453 ]
[pid:15453 ] (clipboard_history.py:15453): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion ‘GDK_IS_WINDOW (window)’ failed
[pid:15453 ] >>>>> self.read_clipboard()
[pid:15453 ] >>>>> IsSupported?
[pid:15453 ]
[pid:15453 ] (clipboard_history.py:15453): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion ‘GDK_IS_WINDOW (window)’ failed
[pid:15453 ] >>>>> opening TheClipboard
[pid:15453 ] >>>>> GetData
[pid:15453 ] [xcb] Unknown sequence number while processing queue
[pid:15453 ] [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[pid:15453 ] [xcb] Aborting, sorry about that.
[pid:15453 ] python: …/…/src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost’ failed.
[pid:15453 ] process ended
I tried using wx.CallAfter as well as using pub.sendMessage to announce the changes but the problem persists.
Is this a known issue?
Attached a little demo program.
Thank you
Claudia
clipboard_history.py (4.81 KB)