Repository navigation
Conversation
Clicking the picture with nothing connected gave it focus and inhibited the compositor's shortcuts, so Super+W and workspace keys did nothing and the window looked hung. A session that was still reconnecting captured on hover the same way, and a dropped connection kept the capture. Inhibit while the picture has the keyboard and the shown session is connected, and check again on focus changes, on connect and disconnect, and when another tab is shown. Fixes omacom#121. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCs6nfZCNssaXtUYR7cpHg
[Medium impact] The change stays within Gliff’s remote-view keyboard workflow. The change appears safe to merge, with a non-blocking gap in tests for disconnecting and reconnecting while focused. Findings
SummaryCaptures system shortcuts only when the picture has keyboard focus and the shown session is connected.
Reviews (1) · Last reviewed commit: "Capture system shortcuts only while the ..." · Reviewed by Greptile |
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 #121.
Problem
Clicking the picture with nothing connected gave it focus, and focus alone inhibited the compositor's shortcuts. Super+W, Super+Q and workspace keys then did nothing, and the window looked hung. The hover and address-bar paths only checked that a session exists, so a session still reconnecting to an unreachable host captured the same way, which is the fullscreen case in the issue's comment. A connection that dropped while captured also kept the capture.
Fix
The inhibit moves out of the focus-enter handler into
sync_capture(). It inhibits while the picture has the keyboard and the shown session is connected, and restores otherwise. It runs when the picture gains focus, on connect, on disconnect, and when another tab or no session is shown. The picture still takes focus as before, so a connection started from the address bar captures as soon as it connects, with no extra click.App::video_focused, set by the focus controller. During the enter handler the window still reports the old focus widget, soGtkWindowExt::focuscannot be used there.App::capture_hintand shown on the first real capture, not on the first focus.inhibit_system_shortcuts/restore_system_shortcutson a seat that is already in that state, so calling it again is safe.Not in this PR
Testing
scripts/check.shpasses. In a nested Hyprland (same setup as e2e case 12), with--connectto a port nothing listens on and the picture focused from the keyboard (Esc out of the address bar, then Tab):inhibited=trueConnected to a
gliff-server --listen --headless, this branch inhibits on every focus (6 of 6). I could not get the picture focused again after connecting in the nested session, so the disconnect-while-captured path is not verified live. The "video focused" log line that e2e case 12 counts is unchanged.The change was written with Claude Opus 5.5.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UCs6nfZCNssaXtUYR7cpHg