smcameron / space-nerds-in-space

Multi-player spaceship bridge simulator game. Captain your starship through adventures with your friends. See https://smcameron.github.io/space-nerds-in-space
GNU General Public License v2.0
732 stars 75 forks source link

Multiple monitors causes weird window resolutions #62

Open loansindi opened 9 years ago

loansindi commented 9 years ago

When launching the client on a machine with multiple monitors configured in non-clone setups, the client window takes up about half the vertical resolution of whichever screen it is on.

smcameron commented 9 years ago

Ok... as a workaround, you can specify the aspect ratio via the --aspect-ratio x,y option. I don't have a machine with multiple monitors so this is difficult for me to test. The code just calls

    sw = gdk_screen_get_width(s);
    sh = gdk_screen_get_height(s);

to get the aspect ratio. It has no idea whether this is one big monitor, several monitors, or what. What do you think it ought to do?

loansindi commented 9 years ago

I do almost no programming with graphics, but looking at the GDK api, it looks like the term for an X 'screen' is 'monitor' - that's kind of confusing.

it looks like gdk_screen_get_monitor_geometry() might be a better method: https://developer.gnome.org/gdk3/stable/GdkScreen.html#gdk-screen-get-monitor-geometry

smcameron commented 9 years ago

Thanks. That does look like it might be on the right track. I probably won't get to work on this for a week or so though, and I don't have a way to test it properly.

loansindi commented 9 years ago

If you reply to this issue with any commits that address it, I'd be happy to test them.