godotengine / godotengine/godot

Custom cursors don't scale the same as ui elements, when monitors are scaled

Open
#97,390 5 comments 1 reaction 0 assignees View on GitHub
confirmed discussion platform:windows topic:input
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in: 4.0.stable, 4.3.stable, 4.4.dev2

### System information

Godot v4.3.stable (77dcf97d8) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated AMD Radeon RX 6650 XT (Advanced Micro Devices, Inc.; 32.0.11021.1011) - AMD Ryzen 5 2600X Six-Core Processor (12 Threads)

### Issue description

When using monitors with different scaling, custom mouse cursor images aren't scaled.
UI elements work fine and will correctly update when changing a monitor's scaling percent.

### Steps to reproduce

1. Set a custom cursor, `Input.set_custom_mouse_cursor(CUSTOM_CURSOR)`
2. Run project
3. Move game window between monitors of different scales.
3b. You can also change the scale of the monitor the game window is currently on.
![image](https://github.com/user-attachments/assets/2caffd8c-c7e9-4e2b-972d-929d374e1f33)

### Minimal reproduction project (MRP)

[Custom Cursor Scaling.zip](https://github.com/user-attachments/files/17107289/Custom.Cursor.Scaling.zip)

Cursor size should match the color rect.

Expected (100% scale):
![image](https://github.com/user-attachments/assets/1ba00786-358b-48fc-9b74-32ba353773d0)

Actual (150% scale):
![image](https://github.com/user-attachments/assets/9b758481-79b6-41fb-85e3-0586a0f6bb47)

Contributor guide

Open the contributing guide

Research direction

Start with the linked minimal reproduction project and reproduce the custom cursor mismatch by moving the game window between monitors with different scaling, or changing the active monitor's scale. Trace the custom cursor and monitor-scaling handling in the desktop windowing code. Done means the cursor size matches the color rectangle at both 100% and 150% scaling and updates when the window moves.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.