godotengine / godot

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

Editor window does not snap to screen edges on 1920×1080 display due to editor minimum window size being more than 50% of the screen #36373

Open hsandt opened 4 years ago

hsandt commented 4 years ago

Godot version: 3.2

OS/device including version: Linux Mint Tricia, Cinnamon desktop

This is important! Ubuntu, Unity desktop works fine. Will test on Windows and Mint Mate later.

Issue description:

When dragging the editor window toward window the left, right edges, the window does not snap to occupy the left half, right half respectively (dragging to top expands as expected).

Using Meta+Left/Right/Up/Down does not snap/expand/minimize the window either.

Note that desktop and shortcut settings may affect this behavior. For instance, Cinnamon allows snapping to corners as well, but the principle is the same.

At first, I thought it came from the fact that Godot uses a custom window system (e.g. it uses modal windows / pop-ups not being considered extra windows by the OS; but I only care about the main window's behaviour here). But seeing it work on Ubuntu + Unity, I can't help thinking it's Cinnamon-specifics, so I don't even know if supporting this desktop is expected to fit in development scope.

Steps to reproduce:

  1. Open Godot Editor (or even the Project pop-up) 2a. Drag Godot to the left or right edge of the screen 3a. Press Meta (Windows) + Left/Right/Up/Down. Alternatively Meta+Ctrl+Direction.

Expect: window snapping/expand Actual: nothing happens

KoBeWi commented 3 years ago

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

hsandt commented 3 years ago

Sorry, I changed main computer in the meantime (now on Ubuntu 18.04, which doesn't have the bug). But I'll come back to Mint in a moment and check again.

nonfatmatt commented 3 years ago

Can confirm that this is a bug for me as well. Affects Cinnamon 4.8.6, MATE 1.24.1 on Arch Linux. Interestingly, the "open project" window snaps just fine. However, once you start the main editor it doesn't respond to tiling controls. Affects Godot 3.2.3 and 3.2.4 beta.

OscarCookeAbbott commented 3 years ago

Any plans to fix this? It's a mild issue that's quite annoying.

Calinou commented 3 years ago

Any plans to fix this? It's a mild issue that's quite annoying.

We don't know what's causing this issue, so we can't fix it yet.

If you can compile the editor from source, can you try commenting out the line below then recompiling the editor?

https://github.com/godotengine/godot/blob/f5e83e73055dbda1c896738f8ee7892bcd181b0f/editor/editor_node.cpp#L5795-L5796

Maybe Cinnamon's window manager snapping interacts poorly with windows that enforce a relatively large minimum size.

Edit: In 4.x, it's here: https://github.com/godotengine/godot/blob/705b7a0b0bd535c95e4e8fb439f3d84b3fb4f427/editor/editor_node.cpp#L6480-L6486

ozrendev commented 3 years ago

Reproduced with XFCE 4.16 on Arch Linux running v4.0.dev.custom_build.c24027548

Commenting out the above line in editor_node.cpp fixes the issue for me. As expected, some elements are cut off.

Calinou commented 3 years ago

@ozrendev Out of curiosity, Which screen resolution are you using? If it's less than 2048 pixels wide and 1200 pixels tall (at 100% scaling), this might explain the issue – at least for side/corner snapping.

OscarCookeAbbott commented 3 years ago

@Calinou Sorry I've been and remain too busy to compile and test, but I can say I only have a 1080p display if that's helpful. Would seem an odd design to me if an above 1080p display is required for proper functionality though given how prevalent 1080p is.

ozrendev commented 3 years ago

@Calinou Yeah same, I'm running 1920x1080

Calinou commented 3 years ago

I think the only fix here would be to make the minimum window size much smaller. 960×540 is the highest we can go for on 1920×1080 displays. Unfortunately, the editor breaks in all sorts of ways when you use a window size smaller than 1024×600 – in fact, it's already slightly cut off in master at the minimum window size.

Can you try to snap the project manager window to the screen edges? It has a smaller minimum window size (750×400 IIRC).

ozrendev commented 3 years ago

The project manager window snaps fine for me.