Skip to content

Fixed missing scaling for MouseWheel events on Windows#20

Merged
ilmai merged 2 commits into
ilmai:mainfrom
emuell:fix/windows-mouse-wheel-events
Jun 22, 2026
Merged

Fixed missing scaling for MouseWheel events on Windows#20
ilmai merged 2 commits into
ilmai:mainfrom
emuell:fix/windows-mouse-wheel-events

Conversation

@emuell

@emuell emuell commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Also, the PhysicalToLogicalPoint hack was missing for MouseWheel event. I guess that the same applies here, but I can't test that, because PhysicalToLogicalPoint and co don't do anything on my Windows setups.

Further, errors from ScreenToClient got handled with an assert! for MouseWheel events, but got silently ignored in the drag and drop impl. I've unified both, too, and do log them now. I think a warning is fine here, a panic would be too much, but that's your call to make.

NB: This is a regression of: dd350f8

... and log or trace errors from `ScreenToClient` and co as warnings
@ilmai

ilmai commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Just had a chance to test this. Looks fine to me, except for some reason mouse coordinates work just fine without the DPI-scaling hack. I'm a bit baffled honestly as to why ScreenToClient works differently when doing drag & drop and when handling mouse wheel events. I event did some logging and checked that both screen coordinates are the same for the upper left and bottom right corners of the window, so it's really just the conversion that's working differently for some reason. I think I'll look into this mystery a bit more before accepting this PR.

@ilmai

ilmai commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Actually for now, please just remove the DPI hack code from mouse wheel event handling. I'll add a more descriptive comment for the drag & drop DPI hack and make a note of looking into this in the future.

@ilmai ilmai merged commit 1b38203 into ilmai:main Jun 22, 2026
3 checks passed
@emuell emuell deleted the fix/windows-mouse-wheel-events branch June 22, 2026 17:34
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.

2 participants