Repository navigation
fix(qt): keep input and the window working in a gamescope session - #1418
TheWeaklessOne wants to merge 3 commits into
Conversation
Under gamescope (SteamOS game mode, handhelds) OpenNOW is the only, always fullscreen client and input comes from a controller or a touchscreen. - Capture required Qt focus on the video item, and nothing gave it back after an overlay closed: no mouse click lands on the video, and controller input is dropped meanwhile. Take the focus whenever the window is active. - A saved desktop window size was letterboxed and upscaled. Skip the saved geometry and open fullscreen. - The mouse stays absolute by default, so taps and the server-drawn cursor line up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45f6a0379a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const bool focused = window() && window()->isActive() && (hasActiveFocus() || m_gamescopeSession); | ||
| auto desired = m_inputEnabled && !m_nativeWindowMoveLoop && isVisible() && focused | ||
| && s_nativeRuntime && s_nativeRuntime->running() && s_nativeRuntime->inputAllowed(); |
There was a problem hiding this comment.
Honor disabled stream surfaces before reclaiming capture
In a gamescope desktop NVST launch, DesktopStreamScreen.qml:125–128 disables the video item while launchCovered is true but leaves inputEnabled true once the streamer reports streaming; the cover remains until the first-frame event. The new focus bypass therefore calls setCaptureActive(true, ...) for a disabled, covered surface, allowing controller snapshots to reach the remote game while the user still sees “Connecting to your game”. Require isEnabled() before reacquiring capture and resynchronize when enabled changes, so focus recovery preserves the existing launch-cover input gate.
AGENTS.md reference: AGENTS.md:L191-L192
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch, confirmed against DesktopStreamScreen.qml. Fixed in 8f61d9e: the gamescope path now requires isEnabled(), and enabledChanged resyncs capture so input starts once the cover lifts. Covered by gamescopeSessionKeepsDisabledItemOutOfCapture.
| : s_nativeRuntime->defaultRelativeMouse(); | ||
| m_relativeMouse = m_usesMacPointerCapture | ||
| ? m_macPointerLockEnabled | ||
| : s_nativeRuntime->defaultRelativeMouse() && !m_gamescopeSession; |
There was a problem hiding this comment.
Apply the gamescope mouse default during cursor resets
For normal WebRTC launches under gamescope, this constructor-only override is overwritten before gameplay begins. The desktop stream item exists before session startup, and accepting a WebRTC session sets defaultRelativeMouse to true and emits cursorStateReset in NativeStreamRuntime.cpp:1337–1340. The connected resetRemoteCursor() still uses the runtime default without checking gamescope (StreamVideoItemInput.cpp:1147–1148), switching the item back to relative mode. Consequently, the new absolute-mouse default does not take effect for these launches or restarts. Apply the gamescope-aware fallback in the reset path as well, while preserving explicit pointer-lock choices.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed. Fixed in 8f61d9e: the constructor and resetRemoteCursor() now share one defaultRelativeMouse() helper with the gamescope check, and a manual pointer-lock choice still takes precedence. Covered by gamescopeSessionKeepsAbsoluteMouseWhenTheDefaultChanges.
Under gamescope the capture path no longer waits for item focus, so a disabled item behind the launch cover took input while the user still saw "Connecting to your game". Require the item to be enabled, and resync when that changes. Accepting a WebRTC session resets the cursor to the runtime default, which switched the item back to relative mode. Apply the gamescope default in that path too; an explicit pointer-lock choice still wins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Follow-up in 8f61d9e for the two review comments above. Not rerun on the device or on Qt 6.8.0, and |
…ssion # Conflicts: # opennow-qt/src/app/ApplicationStartup.cpp
|
Merged current |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Under gamescope (SteamOS game mode, handhelds) OpenNOW is the only, always fullscreen client and input comes from a controller or a touchscreen. Three things go wrong there:
syncCaptureState()now treats an active window as enough in a gamescope session and takes the focus itself. Another window on top, such as a sign-in browser, still stops capture.restoreWindowGeometryskips the saved size and the window opens fullscreen. The--fullscreenpath is unchanged.The session is detected once per item from
GAMESCOPE_WAYLAND_DISPLAY. Nothing changes outside gamescope.Verification:
gamescopeSessionCapturesWithoutItemFocus: fails without the change (item.captureActive()stays false), passes with it.devwith this change (plus fix(qt): build with Qt 6.8.0 qmlcachegen output #1417 to build on Qt 6.8.0):opennow-streamvideo-tests328 passed, 10 skipped;opennow-embedded-orchestration-tests175 passed;opennow-qtbuilds.The live test ran with the session check as a file-scope helper rather than the member it is now; the behaviour is the same. The full CTest suite was not run.
🤖 Generated with Claude Code