godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.92k stars 20.16k forks source link

FileDialog graphic artifacts when embed_subwindows=false #74655

Open kubecz3k opened 1 year ago

kubecz3k commented 1 year ago

Godot version

4.0 stable

System information

Ubuntu 22.04, AMD Radeon RX 6700 XT (navy_flounder, LLVM 13.0.1, DRM 3.42, 5.15.0-53-generic) (0x73df) Gpu driver version: 22.0.5

Issue description

When FileDialog is inside PopupMenu and it's being shown, FileDialog is rendering with graphic glitches. In order for this to happen embed_subwindows project setting must be set to false

Steps to reproduce

https://user-images.githubusercontent.com/6129594/224021271-f5c9cdcd-3035-4fdd-ac5e-570765b33d03.mp4

CAUTION: Video contains rapid flashing effects

  1. Create new project, ensure display/window/subwindows/embed_subwindows project setting is set to false
  2. add following nodes to the scene 2.1 MenuBar as root 2.2 PopupMenu as child of MenuBar 2.3 FileDialog as child of PopupMenu
  3. Configure PopupMenu to have a clickable item 3.1 Go to PopupItem inspector 3.2 Unfold Items section 3.3 Click "Add Element" 3.4 Add "Test Item" as item Text
  4. Create new script with such content:
    
    extends Control

@onready var dialog: FileDialog = %FileDialog @onready var file: PopupMenu = $PopupMenu

func _ready() -> void: file.id_pressed.connect(_on_menu_popup_id_pressed)

func _on_menu_popup_id_pressed(id: int): if id == 0: dialog.popup_centered_ratio()



4.1 Attach this script to MenuBar node
5. Run this scene
5.1 Click PopupMenu
5.2 Click "Test Item"
6. Content of FileDialog should be glitched

### Minimal reproduction project

[embed_subwindows_artifacts.zip](https://github.com/godotengine/godot/files/10931385/embed_subwindows_artifacts.zip)
JanisMancevics commented 1 year ago

Godot version 4.0 stable

System information: Fedora Linux 37 (Workstation Edition) Window manager: dwm Compositor: picom GPU: NVIDIA GeForce RTX 2070 SUPER Driver: 470.161.03 Graphics API: Vulkan API 1.2.175 - Forward+ X Server Vendor Version: 1.20.14 (12014000) Screens: 1

The X window properties: WM_STATE(WM_STATE): window state: Normal icon window: 0x0 _NET_WM_NAME(UTF8_STRING) = "Correct window name" WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified location: 1669, 30 program specified size: 886 by 461 program specified minimum size: 506 by 162 program specified maximum size: 32768 by 32768 _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL WM_CLASS(STRING) = "Godot_Engine", "Proper project name" XdndAware(ATOM) = BITMAP WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW WM_NAME(STRING) = "Correct window name" _NET_WM_PID(CARDINAL) = 610964


Following the same reproduction steps, the effect is slightly different, there is no flicker, the window is just untypically large when set to floating (by default it should be floating, but it's tiling) and it's black.

AThousandShips commented 1 year ago

Please add a warning that there is a rapidly flashing visual effect in the video

MarianoGnu commented 1 year ago

I can confirm the issue can be reproduced on Windows and MacOs, in different GPU hardware. Behaviour is slightly different, on windows is back screen, on Mac is purple screen.

akien-mga commented 1 year ago

Can you still reproduce this in 4.0.3 and 4.1-beta3 or later?

MarianoGnu commented 1 year ago

I oppened the sample project with Godot 4.0.3-stable from Steam on Windows and i can still reproduce: image