Skip to content

Gtk: Translate widget coordinates through the toplevel window - #3131

Open
Descolada wants to merge 1 commit into
picoe:developfrom
keysharp-org:upstream/gtk-screen-coordinates
Open

Descolada wants to merge 1 commit into
picoe:developfrom
keysharp-org:upstream/gtk-screen-coordinates

Conversation

@Descolada

@Descolada Descolada commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

A windowless GTK control can share an ancestor's native window, so using that window's origin loses the control's layout offset. Translate through the toplevel widget and use the resulting screen origin for both PointToScreen and PointFromScreen.

For unrealized children, fall back to the realized toplevel's origin; detached controls retain identity conversion. Preserve the existing Button input-window origin so mouse-event coordinates still round-trip when the native input window is inset.

Include layout offsets when a control shares an ancestor's native window.
Use the same origin for both screen conversions and fall back to the
realized toplevel origin for unrealized children.

Preserve Button input-window coordinates so mouse-event conversions retain
their existing behavior, including inset native input windows.
@Descolada
Descolada marked this pull request as ready for review October 27, 2026 12:47
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