godotengine / godotengine/godot
Popup windows that are opened with popup_centered will open at the top left corner on linux when started visible
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in v4.4.dev3.official [f4af8201b], v4.3.stable.official [77dcf97d8], v4.2.1.stable.official [b09f793f5], v4.1.stable.official [970459615]
Not reproducible in v4.0.4.stable.official [fc0b241c9]
Not reproducible on Windows, only linux
Reproducible on both X11 and Wayland
### System information
Godot v4.3.stable - Linux Mint 22 (Wilma) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 960 (nvidia; 550.120) - AMD FX(tm)-6300 Six-Core Processor (6 Threads)
### Issue description
On linux, when you call popup_centered on a visible window it appears at the top left of the screen. It looks like it has the correct position for a frame or two, but then snaps to the corner.
Here is a video of the bug happening on 4.4.dev3:
https://github.com/user-attachments/assets/3e9ddb60-70db-4944-9582-7ac23fb19c30
You can see that both visible and not visible have a few frames in the beginning where it appears in a different place. It's even happening on the main game window. I suspect these are the same bug.
Here is what it looks like on 4.0.4:
https://github.com/user-attachments/assets/d4fdaf5a-0a7b-44d6-8727-957557d25572
This also happens in other places, like the "Export" and "Export All" window.
https://github.com/user-attachments/assets/791437fc-8fd1-4136-8f7e-21ef88f16aef
I had a look at the source code and in the ProjectExportDialog::_export_all_dialog method, it looks like it's calling the "show" method. Commenting this out resulted in the same behavior as in the first video, where not showing it made it open at the center but with the wrong position for a frame.
### Steps to reproduce
1. Open the editor on linux
2. Go to Project > Export
3. Set up an export, then click "Export All"
4. The dialog will open in the top left corner
Alternatively:
1. Open the example project
2. Run the game with window.tscn's visibility off, it opens at the center.
3. Run the game with window.tscn's visibility on, it opens at the top left corner.
### Minimal reproduction project (MRP)
[popup test.zip](https://github.com/user-attachments/files/17606275/popup.test.zip)
Contributor guide
Research direction
Run the linked popup test project on Linux and reproduce the difference between visible and hidden windows, including the Export All dialog. Then inspect ProjectExportDialog::_export_all_dialog and the popup_centered/show flow. Done means popup windows open centered without snapping to the top-left on X11 and Wayland.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux
- 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