godotengine / godotengine/godot

Viewport Render is stretching when `window.borderless` is `true`

Open
#95,196 3 comments 0 reactions 0 assignees View on GitHub
bug needs testing topic:rendering
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)

![Screenshot 2024-08-06 132336](https://github.com/user-attachments/assets/5753deaf-b637-48f7-a46d-5f246416e6b3)
![Screenshot 2024-08-06 132347](https://github.com/user-attachments/assets/ba1de3a6-04a9-4e81-85cf-c28c285e556a)

Contributor guide

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.