Fix tray icon not displayed with GTK-based pystray backends on Linux - #1097
Open
d-tatianin wants to merge 1 commit into
Open
d-tatianin wants to merge 1 commit into
d-tatianin wants to merge 1 commit into
Conversation
On Linux, when PyGObject is available, pystray uses its appindicator or gtk backend. With these backends, run_detached() does not display anything by itself: it only schedules the icon creation on the GLib main loop, and expects the application to run that loop. The main loop was never started, so the icon was never displayed and its menu never worked, while the log still reported "Tray icon has been displayed". Without PyGObject, pystray falls back to its xorg backend, which runs its own loop but relies on XEmbed: on Wayland sessions (e.g. KDE Plasma) the icon is shown as a blank square that barely responds to clicks. Start the GLib main loop in a daemon thread when a GTK-based backend is used. Other backends (xorg, win32, darwin) are unchanged. Tested on Fedora 44 with KDE Plasma (Wayland), Python 3.14, pystray 0.19.5.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.