68 - A fullscreen window spans multiple monitors in a twinview setup #67

Closed
jlnr opened this Issue Mar 8, 2011 · 9 comments

Comments

Projects
None yet
2 participants
Owner

jlnr commented Mar 8, 2011

What steps will reproduce the problem?
-> use linux
-> use NVidias with at least 2 monitors and Twinview
-> create a fullscreen window Gosu::Window.new(1024, 768, true)

What is the expected output? What do you see instead?
-> When running Linux and NVidias' Twinview, a Gosu fullscreen window 
spans all monitors (and eventually stretches), even though it should only 
go fullscreen on one of them, when the desired resolution isn't bigger 
than the primary screen

What operating system are you using?
-> Linux 

Please provide any additional information below.
-> I have only confirmed this with 2 monitors, but I expect it to behave 
the same with 3 and more

Original link: http://code.google.com/p/gosu/issues/detail?id=68
Contributor

JayThirtySeven commented Nov 1, 2011

I can confirm that it stretches across three monitors in linux using AMD Eyefinity on a Radeon HD 5500, with the latest 'nouveau' drivers (open source driver for AMD/ATI cards). Using gosu 0.7.38. Probably not the highest priority bug, but I'd like to see this one fixed if possible.

Owner

jlnr commented Nov 1, 2011

Hmm, I wanted to dodge this problem by saying that Gosu should really use GLFW soon on Linux- but then again, I fear they implement fullscreen via resolution changes and that's not what I want either. :(

It would be great if you could mention a few Linux apps that handle fullscreen just perfectly. Maybe VLC? It's fullscreen window seems pretty snappy on OS X at least.

Contributor

JayThirtySeven commented Nov 2, 2011

Without knowing a whole lot about what constitutes "Fullscreen" exactly, I can say that VLC Media Player, Chromium, Firefox, LibreOffice, Inkscape, and the Gimp all seem to handle fullscreen mode correctly; in all of these cases, if I press F11 the application window expands to cover whichever monitor it is on (or whichever monitor has the majority of the window, if it's on more than one) and moves in front of all of the other windows, panels, etc..

I've never had to code low-level support for this sort of thing so I don't know many details, but I believe that screen geometry information is made available through the "Xinerama" extension of the X server; this is true even when using Twinview or Eyefinity (in those cases xinerama is not actually running, but you still get screen geometry by polling the xinerama extension). Once you have access to that information, I think you just signal the windowing environment that your window should be treated as "full screen", then internally move/resize the window based on whatever information you got from Xinerama.

Sorry I can't give you more specific information than that. This sort of stuff is not really my area of expertise.

Owner

jlnr commented Nov 2, 2011

Thanks, that helps a lot already! :)

Contributor

JayThirtySeven commented Nov 12, 2011

I cloned the git repository to my machine and tinkered with the code for a while; I've gotten it to open a fullscreen window occupying only the "primary" screen on my multi-monitor setup. I had some trouble with not being able to re-focus the window if it lost focus; I couldn't figure out how to fix it properly, so instead I made it grab mouse input when the window is shown. It covers up the issue, and being unable to mouse over to the other monitors is not that bad because it's functionally similar to being fullscreened on a single monitor.

I don't really know what is the correct way to share my changes; I had to tweak several different files to get it to work right and also compile right. I guess I'll see if I can make a fork here on github and try to apply the changes there?

Contributor

JayThirtySeven commented Nov 12, 2011

Alright created a fork and pushed my changes https://github.com/JayThirtySeven/gosu

I apologize if it's a little bit of a mess; I'm not much of a C++ coder. Let me know if you need more information about exactly what I did or why.

Owner

jlnr commented Apr 1, 2013

@JayThirtySeven Sorry for the long delay - your fork has died a github 404 already. :( Do you still have a diff?

Contributor

JayThirtySeven commented Apr 1, 2013

As far as I'm aware, you already pulled all of those changes into the library. When I check GosuImpl/WindowX.cpp, I see the changes I made are there. Random line in the middle of some of my code: https://github.com/jlnr/gosu/blob/master/GosuImpl/WindowX.cpp#L262

Owner

jlnr commented Apr 1, 2013

@JayThirtySeven oh awesome - I got confused with all the Linux changes around the time! :)

It was apparently part of this release: https://github.com/jlnr/gosu/wiki/Change-Log#0740

Thanks again.

@jlnr jlnr closed this Apr 1, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment