godotengine / godot

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

Create Dialog extends out of screen #77785

Open KoBeWi opened 1 year ago

KoBeWi commented 1 year ago

Godot version

4.1 db5113d

System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

Create dialog (e.g. Add Node) is super big and can extend below screen:

Steps to reproduce

  1. Open project
  2. Press Ctrl + A

Minimal reproduction project

N/A

akien-mga commented 1 year ago

Would be worth bisecting, unless someone has a hunch for what caused the regression already.

YuriSizov commented 1 year ago

Would be worth bisecting, unless someone has a hunch for what caused the regression already.

I can't find a way to reproduce it. There are probably some preceding steps missing in either report. There are a couple of things at play.

There is the default size of 900 x 700 (multiplied by the editor scale). This is also adjusted to respect a 0.8 ratio to parent size, in case 900 x 700 turns out too big. We also save the existing size and restore it, verbatim, if we have it. This stored size is not adjusted to the editor scale or to respect the ratio, because we assume that it was something that the user has adjusted by hand so it must fit as is.

One curious thing that I need to look more into is that no matter which size you set on that window, when you reload the project it will always stretch vertically to its default size (but not horizontally). You can still make it back smaller, but that's a bit weird.

My hunch would be that it's related to the editor state preservation somehow. But I'm not sure how to reach the broken state to be sure.

YuriSizov commented 1 year ago

We can cherry-pick a fix into 4.1 if it's safe, but as annoying as it might be, it's not that critical. Would be great to figure out what the precursor for this issue is.

KoBeWi commented 1 year ago

I did some more testing and it seems like temporary issue. I think the position of CreateDialog got remembered and at the same time the height has increased, which caused it to go off-screen. I tried a few projects. I managed to reproduce the bug in few of them, but the dialog appeared as I described above (i.e. it expanded at weird position or something).

The important thing is that deleting .godot/editor directory (or just editor layout file) fixes the issue. Which means that it affects only old layouts, possibly from some 4.1 pre-release and it can be fixed by simple moving CreateDialog at the correct position...

EDIT: Or maybe it's not temporary. I found another issue which might be related:

https://github.com/godotengine/godot/assets/2223172/065df06c-3f6c-4e97-8434-c8a53d816277

The dialog can extend even if it has enough place. Or at least I manged to expand it to hide 2/3 outside the screen. Which means that it can potentially expand infinitely...

duianto commented 1 year ago

The same thing happens with the Create New Resource dialog. (FileSystem panel, right-click and choose: New Resource...) The bottom of the dialog extends 14px behind the Windows taskbar, cutting off the bottom of the two buttons.

The buttons are accessible, but the dialog should most likely have some empty margins above and below.

Godot v4.1.rc2 - Windows 10.0.19045 - Vulkan (Compatibility) - GeForce GTX 550 Ti () - Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz (4 Threads)

Display resolution: 1920x1080.

With default settings. The C:\Users\username\AppData\Roaming\Godot folder was renamed before starting Godot.

Godot_v4 1-rc2_win64_KojcHFDsnY

Godot_v4 1-rc2_win64_9ToNc77h0q