Skip to content

Fix menu mouse position on high pixel density displays - #1012

Merged
vsonnier merged 1 commit into
Novum:masterfrom
AllMelody:fix-menu-mouse-hidpi
Sep 1, 2026
Merged

Fix menu mouse position on high pixel density displays#1012
vsonnier merged 1 commit into
Novum:masterfrom
AllMelody:fix-menu-mouse-hidpi

Conversation

@AllMelody

Copy link
Copy Markdown
Contributor

SDL_GetMouseState returns points, M_PixelToMenuCanvasCoord expects pixels. IN_GetMousePos scales between the two; the console already uses it.

No change when pixel density is 1. Not tested on Windows or Linux. Fixes #1011 locally for me.

SDL_GetMouseState returns points, M_PixelToMenuCanvasCoord expects pixels.
IN_GetMousePos scales between the two; the console already uses it.

No change when pixel density is 1.
@vsonnier

vsonnier commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

In original report:

To Reproduce
Open vkQuake 1.36.0 in windowed mode on a high DPI screen.

To confirm, was it just windowed that was wrong, or also fullscreen ?

I"ll test for Windows, thank you for the fix. @Perlence do you confirm the bug, and the fix on your side ?

Hum. the #ifdef USE_SDL3 guards are gone there.
So, was it for SDL2 or SDL3 ?. I don't think we want to fix hiDPI issues on anything except the newer platform SDL3, to ease maintainance burden and prevent regressions on the different platforms.
What is your opinion @Novum ?

@Perlence

Perlence commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Can confirm, in 1.36.0, mouse movement doesn't select the menu items in both fullscreen and windowed modes. However, the console text selection works:

Screen.Recording.2026-09-01.at.22.29.04_edit.mov

The fix works:

Screen.Recording.2026-09-01.at.22.33.25_edit.mov

@vsonnier

vsonnier commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

OK @AllMelody Now that I really looked at the code :) your patch makes perfect sense, we don't need the SDL3 guards at that level. Works for me windowed/fullscreen on Windows.

I don't see what could break here. Thanks for your contribution ! and thanks @Perlence for the confirmation !

@vsonnier
vsonnier merged commit 65c0994 into Novum:master Sep 1, 2026
10 of 11 checks passed
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.

Menu mouse position doesn't report correctly on high DPI displays

3 participants