The previous commit added a new worker thread. This thread might sit in
wait_for_event() indefinitely even after the X11Source was dropped. This
is because nothing guarantees that an X11 event will come in "soonish".
And only then would the thread notice that its main thread is gone.
This commit cleans that up by having X11Source explicitly wake up the
event thread and wait for it to exit in its Drop implementation.
Signed-off-by: Uli Schlachter <psychon@znc.in>
x11rb caches X11 events internally. This cache is used when waiting for
the reply of a request and an event is received first. This cache is
however also used when sending a request, because the X11 client may
never block and stop reading while writing a request. Doing so could
cause a deadlock with the X11 server.
Thus, this commit changes X11Source to spawn a thread internally. This
thread calls wait_for_event() in a loop and uses a calloop channel to
forward these events to the main loop. x11rb's RustConnection internally
uses a ConditionVariable to make sure this thread will wake up when
needed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This is very much incomplete, but it implements the import and export of surfaces. However functions related to setting and imported surface the parent of another surface is not done.
importer destructor destroys all imports made from the same client
Implement SetParentOf, no undoing yet
Add inner import type
Destroy child surface relationships when importing
A note
move init function upwards
use 0.29.0 crate
Move role string constants into the public
Use toplevel_like for surface checks in foreign
add methods to get the parent surface
Make sure ZXDG roles are public api
Consistent ordering of parameters on xdg_foreign impl methods
Let's update the changelog
Document how to use xdg_foreign
wl_shell_surface is likely invalid, so it cannot be imported or exported
Changelog suggestions
remove redundant inner ref cell
Remove all uses of the refcell like behavior
Allow compositor to export surfaces on server
Appease new clippy lints
then
Use string references and iterate in reverse to simplify removals
heed request for order