godotengine / godotengine/godot
Viewport Render is stretching when `window.borderless` is `true`
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
4.2.2
### System information
Godot v4.2.2.stable - Windows 10.0.22621 - GLES3 (Compatibility)
### Issue description
- In borderless mode the viewport stretch toward the top and side (where the title bar was) and the mostly top of the viewport being cropped.
I take some screenshot via `get_viewport().get_texture()` and it fine.
- The mouse position doen't match the one display which again confirm the stretching
### Steps to reproduce
Put a visual element near the top of the game screen (control node)
Toggle borderless mode (via the inpector - remote scene `root` window/viewport)
The provided project:
- has both `Sprite2D` and `TextureRect`
- A button to toggle borderless mode
- Some (maybe usefull) Stats
- A `TextureButton` and mouse position marker
### Minimal reproduction project (MRP)
[Issue__ViewPortSize_WindowBorderless.zip](https://github.com/user-attachments/files/16511052/Issue__ViewPortSize_WindowBorderless.zip)


Contributor guide
Research direction
Start by running the provided minimal reproduction project on Godot 4.2.2 under Windows and compare viewport rendering, mouse coordinates, and screenshots before and after toggling borderless mode. Trace the window/viewport borderless handling and determine what needs to keep the rendered content and input coordinates aligned; done means the top content is not cropped or stretched and mouse positions match the display.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- godot
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100