godotengine / godotengine/godot
DisplayServer.get_display_safe_area() wrongly accounts for taskbar on Windows, even on fullscreen mode
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in: 4.3.stable, 4.4.dev5
### System information
Windows 10.0.19045 - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated GeForce GTX 765M - Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz (8 threads)
### Issue description
On a Windows 10 laptop with a 1920x1080 pixel screen with NO notches/cutouts, both DisplayServer.get_display_safe_area() and DisplayServer.screen_get_usable_rect() report a usable height of only 1040 pixels.
This seems to suggest that the Windows taskbar is being accounted for (it is exactly 40 pixels), which is neither useful nor a true account of the screen's safe area, especially for a fullscreen application. Running the application in windowed mode, fullscreen mode or exclusive fullscreen mode makes no difference to the reported value.

### Steps to reproduce
Import the MRP and run the example scene.
Verify that toggling between exclusive fullscreen mode and windowed mode (with the "T" key) does not change the reported safe_area / usable_rect values.
### Minimal reproduction project (MRP)
[wrong_safe_area.zip](https://github.com/user-attachments/files/17952301/wrong_safe_area.zip)
Contributor guide
Research direction
Import and run the linked wrong_safe_area.zip project, then compare DisplayServer.get_display_safe_area() and DisplayServer.screen_get_usable_rect() while toggling windowed and exclusive fullscreen modes. Trace the Windows implementation behind these APIs and verify that the reported dimensions no longer incorrectly include the 40-pixel taskbar area on a fullscreen display.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100