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

Window dimensions are limited by wrong monitor #22736

Open
ghost opened this issue Oct 4, 2018 · 8 comments
Open

Window dimensions are limited by wrong monitor #22736

ghost opened this issue Oct 4, 2018 · 8 comments

Comments

@ghost
Copy link

ghost commented Oct 4, 2018

Godot version:
3.1-alpha 8068d02

OS/device including version:
Linux Mint 19 Cinnamon x64 (Muffin window manager)

Issue description:
I have two displays: one that is 2560x1440, and one that is 1280x1024. They have this layout:
image

Note that the larger monitor is set as the "primary" monitor.

The problem is that any Godot window, upon being spawned, will have its size capped to the dimensions of the smaller, secondary monitor. This includes the Godot editor itself, if forced to open windowed.

For example, I created a project with a window size of 2000x1200:
image

The window should fit on the 2560x1440 monitor. Just to be sure, the editor settings for window placement are configured for Monitor 1 (the primary monitor, being the larger one):
image

The project itself just displays the window size:
image

When running the project, the window size will always be capped to 1280x1024, the size of the second monitor:
image

cc @Calinou, maybe you're able to help diagnose the problem.

Minimal reproduction project:
This is the project I used: multiple monitor window size bug.zip
It doesn't do much, and you might have to modify the window size to match your monitors, so this might not be too useful...

@akien-mga
Copy link
Member

akien-mga commented Oct 5, 2018

AFAIK "Monitor 1" is not the primary monitor, it's the first monitor from the left. See also #21150.

@akien-mga
Copy link
Member

AFAIK "Monitor 1" is not the primary monitor, it's the first monitor from the left.

Actually I'm not sure about this. "Monitor 1" is screen 0, and will query the information of whatever screen XineramaQueryScreens identifies as 0 (see OS_X11::get_screen_size).

@ghost
Copy link
Author

ghost commented Oct 5, 2018

@akien-mga "Monitor 2" spawns the window in the smaller monitor, and "Same as Editor" works correctly too. I also tested with the smaller monitor set to "primary" and it also worked as expected ("Monitor 1" being the smaller monitor, etc.)

@ghost
Copy link
Author

ghost commented Oct 5, 2018

I did some testing, and found out that if the smaller monitor is any more to the left of where it is here:
image

or any higher than it is here:
image

the window dimensions will be capped by the smaller monitor's when spawned in the larger one. Otherwise, it will spawn at the correct size:
image
(the window height shown is larger than the 1200 i specified in the OP project's settings, since OS.get_real_window_size() includes window decorations.

@ghost
Copy link

ghost commented Oct 5, 2018

@Homer666 I don't have your screen setup, but I am very curious what the OS.current_screen reports as you move the window from monitor to monitor. Would you be able to put that in a processing loop and see what kind of ordering is going on?

In my experience so far on Windows, Godot doesn't order the monitors based on the OS arrangement. I have mine swapped in the OS, and Godot does start on what is the "primary", but it counts with index 1, rather than 0.

Would like to know if you're experiencing something similar.

@ghost
Copy link
Author

ghost commented Oct 5, 2018

@avencherus Just tried it, it's reading the monitor indexes correctly, respecting what monitor I have set to "primary" and reporting an index of 0 for that.

@ghost
Copy link

ghost commented Oct 6, 2018

@Homer666 Thanks running that test. Yeah, it must be referencing the wrong monitor at some point in the startup. I wonder. Definitely something I'll be watching for when I go back to doing some display and cursor testing on Linux in the coming weeks.

There was some fix some time ago on the X11 end where certain display queries were lagging behind by a frame or two. This was fixed using some yielding, #21914.

@hpvb Might this be related or similar to the timing issues with the window sizes?

@Calinou
Copy link
Member

Calinou commented Nov 6, 2020

Can anyone on Linux/*BSD still reproduce this bug in Godot 3.2.3 or any later release?

If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.

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

2 participants