Repository navigation
Initialise GTK before the Linux tray, run headless if it cannot start - #30
Open
onyxhq-dev wants to merge 1 commit into
Open
onyxhq-dev wants to merge 1 commit into
onyxhq-dev wants to merge 1 commit into
Conversation
tray-icon builds its menu with GTK, which panics on first use unless gtk::init() ran on the main thread. On Wayland the tray panel panicked, relaunched and eventually exited, taking the HTTP API with it. Initialise GTK first and fall back to headless mode when it fails. Fixes OpenMouse-Project#26.
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.
Fixes #26.
On Linux, tray-icon builds its menu with GTK, which panics on first use unless
gtk::init()ran on the main thread. Bridge never called it, so the tray panel panicked ("GTK has not been initialized"), relaunched, and after a few quick relaunches the whole process exited, taking the HTTP API, HID and game profiles with it.gtk::init()before the tray panel starts (Linux only, newgtk = "0.18"dependency;gtk 0.18.2is already inCargo.lockvia tray-icon).Tested in an Ubuntu 24.04 container under a headless Weston Wayland session (WAYLAND_DISPLAY set, no DISPLAY):
Not tested: a real KDE or GNOME session. Headless Weston has no tray host or input device, so I could not check the tray icon or its menu. The tray menu may also need the GTK loop pumped on some desktops; that is not part of this change. A build from this branch needs a try on a real desktop, ideally by the reporter.
Summary by CodeRabbit