godotengine / godotengine/godot

DisplayServer.get_display_safe_area() wrongly accounts for taskbar on Windows, even on fullscreen mode

Open
#99,809 4 comments 1 reaction 0 assignees View on GitHub
bug platform:windows topic:platforms
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.

![Image](https://github.com/user-attachments/assets/af5dcb0c-63c9-4de6-ad5d-f7bf06a60813)

### 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.