-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow showing/hiding Thunderbird when launched using Wayland platform #584
base: master
Are you sure you want to change the base?
Conversation
If the Wayland platform is in use, simply connect to the XWayland server directly, and perform queries using that connection. As long as Thunderbird is running under XWayland, this allows Birdtray to find the window and show/hide it no matter what platform Birdtray is using.
@Abestanis @gyunaev would you mind taking a look at this? |
@cptpcrd I'm only maintaining the translations and the Windows support. I don't have the rights to approve this, and unfortunately I also don't have a system with XWayland to test this on. But I have some questions which might help this get moving forward:
|
Honestly the change doesn't make much sense to me. If you're running birdtray and Thunderbird on wayland+X it should work as-is. If you're not running either under X, it won't work with this patch either. So what we are fixing here? |
Sorry, I didn't do a great job of explaining this in the description. Birdtray uses Qt, and Thunderbird uses GTK. Qt and GTK each have an X11 "platform" and a Wayland "platform" that can be selected (though GDK seems to use the terminology "backend"). Thus it is entirely possible to:
I only mention case (1) for completeness; it's a bit degenerate and would really require Birdtray to have full Wayland support. My system, without any custom configuration, ended up in case (2). Thunderbird was connecting to the XWayland server, and thus could have been found and hidden by Birdtray. However, since Birdtray was using Qt's Wayland platform, it didn't connect to the XWayland server and didn't even try to find Thunderbird. I worked around this by running With this change, Birdtray works out-of-the-box in that situation: it continues to use the Wayland platform to render its own window, but separately connects to the XWayland server to control Thunderbird. It's not a huge deal, but I think there's some value in having Birdtray "just work" when it's straightforward to do so, which it is in this case. To address @Abestanis's comments as well:
Ah, I wasn't aware.
When using the Wayland platform:
It looks like the Qt developers assume you won't try to use most of the
Perhaps. I checked the implementation for
I don't think the root window would change unless the X server restarts, and restarting the X server is fairly destructive. I don't think I've ever seen an X11 client which tries to reconnect when the server restarts; usually they just exit. Under Wayland it's a bit different since the XWayland server can restart while the Wayland compositor keeps running, but it's still quite rare and IMO not worth the extra complexity. (Technically, there's one exception I'm aware of -- wlroots-based compositors sometimes stop the XWayland server if there are no connected clients -- but here we're keeping a connection open, so that won't happen.) |
Thank you for the explanation. Would it be simpler just have a check in main() for whether QX11Info::appRootWindow() returns null, and in this case self-restart with -platform xcb (i.e. exec argv[0] -platform xcb )? |
That would work, though there's a small chance it'll break if Qt changes their platform selection logic. (Also you'd need to do some extra work to preserve other arguments like |
If the Wayland platform is in use, simply connect to the XWayland server directly, and perform queries using that connection.
As long as Thunderbird is running under XWayland, this allows Birdtray to find the window and show/hide it no matter what platform Birdtray is using.
This fixes some of the problems described in e.g. #426, but it is not full Wayland support.