Skip to content

Match Windows snip gestures on Linux - #10

Merged
DevanMetz merged 4 commits into
mainfrom
grok/snip-gestures
Oct 28, 2026
Merged

DevanMetz merged 4 commits into
mainfrom
grok/snip-gestures

Conversation

@DevanMetz

Copy link
Copy Markdown
Owner

What changed

Linux snip gestures now follow the Windows overlay.

  • F captures the monitor under the cursor immediately. A captures the whole frame immediately.
  • Enter confirms the current selection. With nothing selected, or with the button down before the drag has moved, it captures that monitor. A drag that never forms a rectangle is left alone.
  • Esc and right-click cancel the drag first. A second press cancels the snip.
  • Arrow keys nudge 1 px, Shift nudges 10. On X11 that warps the real pointer, including the free edge of a drag. Wayland cannot warp the pointer, so the overlay cursor moves instead.
  • The delay countdown stays a number, sits at the bottom of the working area of the monitor under the pointer, does not take focus, and is hidden before the shot. On X11 an empty input shape lets clicks pass through it. Wayland has no client-side input shape; not taking focus and sitting at the bottom is the equivalent.
  • Tray snips and repeat-last wait 250 ms so the menu is not in the shot. Closing the preview waits at least 100 ms. Command-line actions do not wait.
  • The preview does not take focus and opens on the monitor that contains the snip.

PARITY.md lists every Windows feature against this tree. X11 capture still imports libX11 (that is #4). Window grab, the editor, pins, shortcuts, and recording already have open PRs and are not in this one.

Why

On main, F and A only set a selection, Esc always cancelled the whole snip, the arrow keys moved an internal cursor, and the countdown sat in the middle of the screen where it could be captured and could block clicks.

How it was tested

  • dotnet test tests/OpenSnip.Tests/OpenSnip.Tests.csproj -c Release — 17 passed. The same run with DISPLAY set to a display that cannot be opened also passed; the X11 tests return when the display cannot be opened.
  • dotnet build src/OpenSnip.csproj -c Release -p:EnableWindowsTargeting=true — succeeded, 0 warnings. src/ is unchanged.
  • On X11 (DISPLAY=:1, 1920×1200): Shift+Right moved the pointer 10 px. Esc during a drag left the overlay up and wrote no file; the later mouse-up did not finish the snip; a second Esc closed it. Right-click cancelled. Enter saved the dragged rectangle (300×200). F and A each saved a 1920×1200 PNG. The preview landed at the bottom-right (1596, 988) and did not take focus. The countdown was 128×128 at (896, 1032), had an empty X input shape, was not under the pointer, did not take focus, and was gone before the overlay opened.
  • Wayland pointer warping and Wayland click-through were not run here. There is no Wayland session in this environment.

F and A finish immediately, Enter confirms the selection or the monitor, and Esc or a right-click cancels the drag before the snip. On X11 the arrow keys move the real pointer.
The countdown sits at the bottom of the monitor under the pointer, does not take focus, and on X11 clicks pass through it. Tray snips wait for the menu to close, and the preview opens on the snipped monitor without taking focus.
# Conflicts:
#	.github/workflows/build.yml
#	PARITY.md
#	linux/App.cs
#	linux/OverlayWindow.cs
#	linux/ThumbnailWindow.cs
@DevanMetz
DevanMetz merged commit da45893 into main Oct 28, 2026
2 checks passed
@DevanMetz
DevanMetz deleted the grok/snip-gestures branch October 28, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant