core icon indicating copy to clipboard operation
core copied to clipboard

Change cursor size based on zoom / device pixel ratio

Open barrylb opened this issue 1 year ago • 2 comments

Describe the bug

On Windows 11 running the demo the mouse cursor size is different to the usual size for the rest of the system while inside the Cogent app.

Large cursor when hovering over the title bar: IMG_8025

Changes to a small size when inside the window: IMG_8028

How to reproduce

go run cogentcore.org/core/examples/demo@main

This happens the "Scale" setting is set to 200% in Windows Display Settings. When I change the scale to 100% the mouse cursor is the same inside Cogent apps as everywhere else.

Example code

No response

Relevant output

No response

Platform

Windows

barrylb avatar Aug 07 '24 00:08 barrylb

Thanks for reporting this. We will work on implementing cursor sizing based on zoom / device pixel ratio soon.

kkoreilly avatar Aug 07 '24 05:08 kkoreilly

A similar effect can be seen on Debian Buster running a Gnome desktop on a Dell XPS laptop with a 4K screen.

matta avatar Aug 13 '24 17:08 matta

This issue also happens in fullscreen on macOS retina displays as of #1341. This isn't just as simple as multiplying the cursor size by device pixel ratio, since on macOS it is actually correct originally with DPR = 2, but then it fails in fullscreen when DPR becomes 1. The cursor/mouse speed is also too slow in that fullscreen case, and no black bar is rendered where the camera is, even though it should be; there are some issues with the video mode support. Regardless, it should be possible to fix these issues, and this is a relatively high priority.

kkoreilly avatar Dec 08 '24 23:12 kkoreilly

@barrylb @matta This issue should be fixed now as of #1372; the cursors now scale based on the DPI, while being appropriately invariant to DPR on macOS. You can update to the latest version on the main branch to get this functionality:

go get cogentcore.org/core@55e6ea8

Please let me know if this fixes your issues.

Also, the remaining fullscreen issues on macOS Retina displays are tracked by #1374 now.

kkoreilly avatar Dec 15 '24 23:12 kkoreilly