Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Feb 19, 2020 · 11 comments

Comments

@hsandt
Copy link
Contributor

hsandt commented Feb 19, 2020

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
Copy link
Member

KoBeWi commented Dec 21, 2020

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

@hsandt
Copy link
Contributor Author

hsandt commented Jan 3, 2021

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
Copy link

nonfatmatt commented Mar 4, 2021

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
Copy link

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

@Calinou
Copy link
Member

Calinou commented Aug 25, 2021

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?

godot/editor/editor_node.cpp

Lines 5795 to 5796 in f5e83e7

// Define a minimum window size to prevent UI elements from overlapping or being cut off
OS::get_singleton()->set_min_window_size(Size2(1024, 600) * EDSCALE);

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

Edit: In 4.x, it's here:

godot/editor/editor_node.cpp

Lines 6480 to 6486 in 705b7a0

// Define a minimum window size to prevent UI elements from overlapping or being cut off.
Window *w = Object::cast_to<Window>(SceneTree::get_singleton()->get_root());
if (w) {
const Size2 minimum_size = Size2(1024, 600) * EDSCALE;
w->set_min_size(minimum_size); // Calling it this early doesn't sync the property with DS.
DisplayServer::get_singleton()->window_set_min_size(minimum_size);
}

@Calinou Calinou changed the title [CINNAMON] Editor window does not snap to screen edges Editor window does not snap to screen edges with the Cinnamon desktop environment Aug 25, 2021
@ozrendev
Copy link

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
Copy link
Member

Calinou commented Oct 16, 2021

@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
Copy link

@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
Copy link

@Calinou Yeah same, I'm running 1920x1080

@Calinou
Copy link
Member

Calinou commented Oct 17, 2021

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).

@Calinou Calinou changed the title Editor window does not snap to screen edges with the Cinnamon desktop environment Editor window does not snap to screen edges with the Cinnamon desktop environment (due to editor minimum window size being more than 50% of the screen) Oct 17, 2021
@ozrendev
Copy link

The project manager window snaps fine for me.

@Calinou Calinou changed the title Editor window does not snap to screen edges with the Cinnamon desktop environment (due to editor minimum window size being more than 50% of the screen) 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 Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants