godotengine / godotengine/godot

Using different methods to implement non-embedded child windows will trigger the always_on_top breaks non-embedded popups problem

Open
#100,192 2 comments 0 reactions 0 assignees View on GitHub
bug topic:gui
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

4.3 Until now

### System information

Windows 10 x64

### Issue description

We can get non-embedded child windows in the following two ways:
- disabling embed_subwindows.
- Change `force_native` of a subwindow

When using the second method, it seems that the parent window of the subwindow is not handled correctly. This causes all pop-ups on the subwindow to use the main window as its parent window(This is a guess). This further causes the position of the pop-ups of the subwindow to be wrong, and after `always_on_top` is enabled on the subwindow, it will cause the window sorting to be wrong and cover all the pop-ups of the subwindow.

### Steps to reproduce

- Create default project
- Add `Window` node, enable `always_on_top` and `force_native`, disable `visible`
- Add any node with popup menu (e.g. TextEdit) to window node
- Run
- Make the window node visible
- Open the popup menu on window node

![Image](https://github.com/user-attachments/assets/addcd92a-ff87-4461-8c07-2c942354b845)
*The PopopMenu is not only covered but also displayed in the wrong position.*

### Minimal reproduction project (MRP)

[issue_100192_mrp.zip](https://github.com/user-attachments/files/18059912/issue_100192_mrp.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the attached issue_100192_mrp.zip project on Windows 10 and reproduce the popup behavior using a Window with force_native and always_on_top. Investigate the Window and PopupMenu handling for non-embedded child windows and compare it with the embed_subwindows path. Done means the subwindow popup is correctly positioned and remains above the subwindow without being covered.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.