Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtk4: Incorporate scale factor into pointer events #696

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

obyknovenius
Copy link
Contributor

@obyknovenius obyknovenius commented Feb 26, 2024

GtkGestureClick and GtkEventControllerMotion provide x and y in widget allocation coordinates.
We must multiply them by the widget's scale factor when creating point events for WebKit.

Fixes #654

@obyknovenius obyknovenius force-pushed the gtk4/click-and-motion-scale-factor branch from 9b89c12 to 35c1846 Compare February 26, 2024 12:05
`GtkGestureClick` and `GtkEventControllerMotion` provide `x` and `y`
in widget allocation coordinates.

We must multiply them by the widget's scale factor when creating
point events for WebKit.
@obyknovenius obyknovenius force-pushed the gtk4/click-and-motion-scale-factor branch from 35c1846 to 8b342bd Compare February 26, 2024 12:09
Copy link
Member

@aperezdc aperezdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @obyknovenius! This fixes #654

@obyknovenius obyknovenius merged commit db13ac3 into master Feb 26, 2024
5 checks passed
@obyknovenius obyknovenius deleted the gtk4/click-and-motion-scale-factor branch February 26, 2024 12:34
@aperezdc
Copy link
Member

Cherry picked into branch cog-0.18 as commit 0ec604c as well.

@aperezdc aperezdc added bug Something isn't working merge:cog-0.18 labels Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working merge:cog-0.18
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gtk4: Pointer coordinates wrongly reported when the window is on a monitor with fractional scaling
2 participants