• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows multi-monitor fullscreen issue

Ricardo

Member
Hi there!

I have two monitors. Monitor #1 is ultrawide (2560x1080), whereas monitor #2 is a regular 1920x1080.
If I try to maximize my game on monitor #1, everything works as expected. However, if I move the game window to monitor #2 and maximize it (window_set_fullscreen(true)), the game doesn't maximize right, it gets stretched (doesn't use the full monitor size, it gets black borders in the sides and the mouse position is offset) .

Using the debugger, I noticed that display_get_width() and display_get_height() were returning monitor #1's resolution (2560x1080), even if the game was running on monitor #2. Hmm, weird.

I then changed monitor #1 resolution to 1920x1080 (so both monitors were using the same size), and then fullscreen started working correctly on monitor #2.

So it seems like that have a multi-monitor setup in which the monitors have different resolutions causes issues in GMS2 games, at least when you try to maximize the game in a secondary display. Does anyone know a workaround or something I could try to get rid of this behavior?

Note: Other non-GMS2 games maximize right on monitor #2, so this is not a Windows/driver issue.
 

Ricardo

Member
I did a new test using a different machine, a 1920x1080 laptop connected to monitor #1 (2560x1080).
Here the behavior is slightly different, but it is still wrong. When trying to maximize the game on the attached monitor, the game is stretched to fill the whole screen instead of keep the correct proportion (scaling is set to "keep aspect ratio").

It seems like this full screen bug happens when the second monitor's aspect ratio is different from the main display's aspect ratio.
 
S

Sam (Deleted User)

Guest
This is a bug. YoYo must be using the GetSystemMetrics() function to get the display size, which only corresponds to the primary Monitor, which Microsoft very clearly states on their documentation that this function should not be used for this purpose under these circumstances, which I find hilarious.

They also are using the wrong X11 API on Linux for getting the display size. On Linux it isn't getting the size of the display the (0,0) x/y position of the window is on, instead, they are getting the width and height of all displays combined. I'm curious to know what where they messed up with this on Mac, which based on what they did for Windows and Linux, I doubt they tested these functions on a multiple monitor setup with any platform. On Linux, the window opens in the center of all monitors combined as a result of them reusing display_get_width()/height() to calculate the position, same applies to using window_center().

I already reported the Linux bug, knowing this is also done wrong on Windows doesn't surprise me. I'll file another ticket. (Third bug ticket filed in one day).
 
Last edited by a moderator:

Ricardo

Member
This is a bug. YoYo must be using the GetSystemMetrics() function to get the display size, which only corresponds to the primary Monitor, which Microsoft very clearly states on their documentation that this function should not be used for this purpose under these circumstances, which I find hilarious.

They also are using the wrong X11 API on Linux for getting the display size. On Linux it isn't getting the size of the display the (0,0) x/y position of the window is on, instead, they are getting the width and height of all displays combined. I'm curious to know what where they messed up with this on Mac, which based on what they did for Windows and Linux, I doubt they tested these functions on a multiple monitor setup with any platform. On Linux, the window opens in the center of all monitors combined as a result of them reusing display_get_width()/height() to calculate the position, same applies to using window_center().

I already reported the Linux bug, knowing this is also done wrong on Windows doesn't surprise me. I'll file another ticket. (Third bug ticket filed in one day).
I've reported this already, I'm waiting for the support response (EDIT: bug confirmed). I didn't test this on Linux, but I tested it on Mac (Macbook Air 2018 + my widescreen display) and luckily the bug doesn't happen there, the scaling is correct.
 
Last edited:
Top