Repository navigation
Linux: close to the system tray, and fix clip playback in the frozen bundle - #92
Open
Tinkus144Hz wants to merge 2 commits into
Open
Tinkus144Hz wants to merge 2 commits into
Tinkus144Hz wants to merge 2 commits into
Conversation
The close-to-tray lifecycle was gated to win32, so on Linux the window's X always took the full shutdown path and stopped capture. Enable it wherever QSystemTrayIcon reports a tray host (StatusNotifierItem on KDE, waybar, GNOME with AppIndicator, ...). Without one, X still exits through request_full_exit() as before. On Wayland the first restore from the tray left the window invisible: it was shown while background-paused (updates disabled), so no buffer was committed, the compositor never mapped it, the app never became active, and the scheduled pause refresh kept it paused. Unpause before showing and defer re-pausing until the restored surface painted once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wheel's libavcodec.so.61 needs libQt6FFmpegStub-{va,va-drm,va-x11,
ssl,crypto} next to it (RUNPATH $ORIGIN). PyInstaller does not collect
them and the reviewed-Qt filter dropped them, so libffmpegmediaplugin.so
failed to load: "No QtMultimedia backends found" and every clip stalled
with PLAYBACK_STALLED in the frozen bundle. Collect them explicitly and
let them through the filter as part of the approved Multimedia module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What does this PR do?
Lets FTHR keep running in the system tray on Linux when the main window is closed, and fixes clip playback in the frozen Linux bundle.
Why?
The close-to-tray lifecycle already existed in 2.0 but was gated to
sys.platform == 'win32', so on Linux the window's X always went through the full shutdown path and stopped capture. Linux desktops with a StatusNotifierItem host (KDE, waybar, GNOME + AppIndicator extension, …) can host the existingQSystemTrayIconjust fine.While testing a locally built bundle, opening any clip failed with
PLAYBACK_STALLED/ "No QtMultimedia backends found". That is independent of the tray change but blocks testing it in a packaged build, so it is included as a separate commit.Changes
feat(linux): close to the system tray when a tray host is available(FTHR_UI/main.py)_close_to_tray_supported(): always true on Windows; on Linux true whenQSystemTrayIcon.isSystemTrayAvailable().win32gates with it in_create_system_tray,closeEvent, the title-bar power button, the settings checkbox and its toggle handler. Without a tray host, X still exits throughrequest_full_exit()as before.restore_main_window()now unpauses the background UI before showing and resets_first_frame_paintedwhen the window was hidden. Previously the window was still updates-disabled when shown, Wayland never got a first buffer so it never mapped the surface, the app therefore never became active, and the scheduled_refresh_background_ui_pause_statere-paused it — the window stayed invisible on the first restore. The immediateQTimer.singleShot(0, _refresh_background_ui_pause_state)in restore is dropped;showEventandapplicationStateChangedstill drive later pause/unpause.fix(build): bundle Qt Multimedia's FFmpeg stub libraries on Linux(FTHR_linux.spec)libavcodec.so.61NEEDslibQt6FFmpegStub-{va,va-drm,va-x11,ssl,crypto}.so.*next to it (RUNPATH $ORIGIN). PyInstaller does not collect them, solibffmpegmediaplugin.socannot load.PySide6/Qt/lib, and let them through_keep_reviewed_qt_runtime(they are part of the already approved Multimedia module;QT_SO_REinverify_release_licenses.pydoes not count hyphenated names as separate modules, so the licence gate is unchanged).Testing
Manual, on CachyOS / Hyprland (Wayland), waybar tray, NVENC:
StatusNotifierItem). Tray click / tray "Open FTHR" / launching a second instance restores the window — 3 hide/restore cycles in a row.--backgroundstart: no window, tray icon present, F9 saves a clip end to end ("Clip ready").ldd libffmpegmediaplugin.soreports the stubs as not found and playback stalls. After: no missing libraries, startup logs "Using Qt multimedia with FFmpeg 7.1.3", clips play.Automated:
ruff checkandtools/scan_repo_hygiene.py --stagedcleanpytest tests/on Linux: no new failures. The full run segfaults intests/test_game_detection_popup.py(whatfix/linux-2.0-test-segfaultsaddresses; it crashes the same way without this PR), so I ran each of the 160 test files in its own process and compared failing test IDs against unmodifiedlinux-2.0: the same 33 tests in 14 files fail on both; none are added or fixed by this PR._close_to_tray_supported()is always true there.Notes
build_linux.shon this host stops at the glibc 2.35 baseline check (CachyOS ships glibc 2.4x), so I installed the AppDir instead of the AppImage. Not related to this PR.