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

Enabling borderless results in Godot games showing on both monitors #71282

Open
knivspark opened this issue Jan 12, 2023 · 13 comments
Open

Enabling borderless results in Godot games showing on both monitors #71282

knivspark opened this issue Jan 12, 2023 · 13 comments

Comments

@knivspark
Copy link

knivspark commented Jan 12, 2023

Godot version

3.5.1 Mono

System information

Windows 10, 1920x1080 resolution, x2 monitors, NVIDIA GeForce RTX 3060

Issue description

Whenever I enable borderless in a Godot game the game is shown on both of my monitors.

In addition, when this occurs the application behaves in a suboptimal manner where it is only ever functional on one screen at a time, an alternating between which one is functional as you try to interact with the application.

This occurs with e.g. DOME KEEPER (Steam) and the game I am developing in Godot with my buddies @TheOrioli and crew at Kikimora Games.

See attachments below for reference.

Additional Information: I use GeForce shadowplay for screen capture, and until recently screenshots I would take while playing DOME KEEPER (or our own game) would be placed in a folder named after the title, e.g. Dome Keeper. However, NOW screen captures are put in a folder called 'Base Profile'. Not sure if this is relevant to the issue, but thought it was worth mentioning.

image

DOME KEEPER

NEZUMI - KIKIMORA GAMES

Steps to reproduce

Display Settings - Screenshot 3

Display Settings - Screenshot 4

Prerequisites:

  • Have x2 monitors set to "Extend These Displays".
  • Make sure that your displays are NOT perfectly aligned vertically in "Rearrange your displays" in System > Display / Display Settings. See screenshots above for reference.
  1. Boot DOME KEEPER on Steam
  2. Go into the settings menu
  3. Set Graphics Mode to 'Borderless Window'
  4. Set Stretch Mode to 'Scaled' (Although issue seems to occur regardless of what this is set to)
  5. Press OK

Result: Observe that the game now shows on both monitors, and that it behaves in a suboptimal manner when trying to interact with it.

image

Minimal reproduction project

N/A

@bruvzg
Copy link
Member

bruvzg commented Jan 12, 2023

Boot DOME KEEPER on Steam
Go into the settings menu
Enable borderless

MRP? What exactly borderless option is doing in a dome keeper? Setting window_borderless or some combination of it and window size/position?

@knivspark
Copy link
Author

I have updated the repro steps to be a bit more informative + added a screenshot of the menu settings.

@knivspark
Copy link
Author

Additional Information: I use GeForce shadowplay for screen capture, and recently screenshots I would take while playing DOME KEEPER (or our own game) would be placed in a folder named after the title, e.g. Dome Keeper. However, NOW screen captures are put in a folder called 'Base Profile'. Not sure if this is relevant to the issue, but thought it was worth mentioning.

image

@bruvzg
Copy link
Member

bruvzg commented Jan 12, 2023

I have updated the repro steps to be a bit more informative + added a screenshot of the menu settings.

This is pretty much completely useless information, like do you expect us to download dome keeper and decompile project and all mono scripts to see what's going on, or what? What would be useful is source code of the methods attached to these buttons, (ideally cleared up from everything unrelated to the issue), or at least an outline of what it is doing.

I use GeForce shadowplay for screen capture

Is it doing it only when screen capturing?

@TheOrioli
Copy link
Contributor

@bruvzg Please be kind, not everyone is a programmer or an experienced open source contributor. Everyone has a first bug report.

The fact that Dome Keeper, a released Godot Engine game has the same issue as a game currently being developed proves at the very minimum that the issue is reproducible across multiple projects, and potentially provides an easy test for contributors as it's a popular game that they might already have. Not to mention that the developers of the game might see the issue and chime in.

On the code side, I can confirm that the only thing our game does is OS.WindowBorderless = true, as we're using C#.

@bruvzg
Copy link
Member

bruvzg commented Jan 13, 2023

On the code side, I can confirm that the only thing our game does is OS.WindowBorderless = true, as we're using C#.

So it's not changing window size/position? What was the window size/position/state before setting it to borderless (it looks like a full-screen on the screenshots)?

@bruvzg
Copy link
Member

bruvzg commented Jan 13, 2023

Also, what's the exact configuration of displays (primary display and alignment), a screenshot of windows "System → Display" control panel would be helpful.

@bruvzg
Copy link
Member

bruvzg commented Jan 13, 2023

I suspect that the window had the same size as the screen before the change. And when borderless is applied, it's somehow confusing compositor/driver to enter full screen mode on the wrong display, since window origin is on it (due to window decoration or screen misalignment). Something like this:
Screenshot 2023-01-13 at 13 46 26
Normally it's only entering full-screen when borderless window have exactly the same rect as screen, so I'm not entry sure if it is the case.

But so for I was not able to reproduce it.

@Calinou
Copy link
Member

Calinou commented Jan 13, 2023

Related to #70962 and #62869 (though that issue is about Resizable).

@knivspark
Copy link
Author

Also, what's the exact configuration of displays (primary display and alignment), a screenshot of windows "System → Display" control panel would be helpful.

Display Settings - Screenshot 1

Display Settings - Screenshot 2

Note: Monitor 1 is the main display and both monitors have 1920x1080 resolution.

@knivspark
Copy link
Author

I use GeForce shadowplay for screen capture

Is it doing it only when screen capturing?

The issue occurs regardless, with or without screen capturing.

@knivspark
Copy link
Author

On the code side, I can confirm that the only thing our game does is OS.WindowBorderless = true, as we're using C#.

So it's not changing window size/position? What was the window size/position/state before setting it to borderless (it looks like a full-screen on the screenshots)?

In both scenarios/games I am changing from full-screen to bordless.

@knivspark
Copy link
Author

knivspark commented Jan 14, 2023

I suspect that the window had the same size as the screen before the change. And when borderless is applied, it's somehow confusing compositor/driver to enter full screen mode on the wrong display, since window origin is on it (due to window decoration or screen misalignment). Something like this: Screenshot 2023-01-13 at 13 46 26 Normally it's only entering full-screen when borderless window have exactly the same rect as screen, so I'm not entry sure if it is the case.

But so for I was not able to reproduce it.

Can confirm that the issue ONLY occurs for me when the monitors are not perfectly aligned vertically. If they are perfectly aligned the issue does not occur.

Updating the repro steps to include this step.

Display Settings - Screenshot 3

Display Settings - Screenshot 4

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

5 participants