Repository navigation
fix(native): keep Windows drags under the pointer on scaled displays - #912
Merged
Merged
Conversation
Gio's Windows backend called SetCapture on WM_POINTERDOWN, which turns on
DPI-unaware coordinate scaling for pointer events until the release. With
display scaling above 100%, every pointer.Drag landed away from the cursor:
the footer editor's dragged item and the terminal's selection alike.
Upstream fixed it in c170b581 ("app: [Windows] rely on implicit pointer
capture", gio#710). The fork's lich branch carries it now, merged with the
rest of upstream main, and native/go.mod moves to that commit.
# Conflicts: # CHANGELOG.md
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.
Summary
On Windows with display scaling above 100%, a drag drifted away from the cursor: an item dragged in Settings › Footer was drawn far from the pointer, and a selection dragged in the terminal extended to the wrong cells. Reported on a two-monitor setup (1920×1080 + 1920×1200).
Cause: Gio's Windows backend called
SetCaptureonWM_POINTERDOWN. That turns on DPI-unaware coordinate scaling for pointer events until the release, so onlypointer.Dragevents (never hover or click) came in scaled as if the screen were at 100%.Upstream Gio fixed it in
c170b581("app: [Windows] rely on implicit pointer capture", https://todo.sr.ht/~eliasnaur/gio/710):WM_POINTERDOWNalready captures the pointer, so the calls go.lichdotdev/giobranchlich: cherry-pickedc170b581, then merged the rest of upstreammain(Android key events and Back, 4th/5th mouse buttons on macOS and X11,key.NameInsert, lost GPU device recovery, text segmentation). The merge also fixes the fork's long-failingTestIndexPositionRunes.native/go.modmoves thereplaceto that commit (12496229).CHANGELOG.md[Unreleased]› Fixed entry.Test plan
native/:gofmt -l .clean,go vet ./...andgo test ./...greennative/build-windows.shbuildslich-native.exe; the binary no longer referencesSetCaptureGOOS=linuxandGOOS=windows go build ./...,go testonapp,io,text,widget