Multi monitor problem

Started by EgonOlsen, September 28, 2008, 13:47:12

Previous topic - Next topic

EgonOlsen

Hi,

i've got feedback from a beta-tester who tried to run my game (http://www.javagaming.org/index.php/topic,19230.0.html) in full screen on a system (Windows,i assume) with two monitors conneted. The game always appeared on the second monitor while the mouse was caught in the first. Sadly, i've no idea about the hardware he's using but maybe someone around here an idea about this!? It happened with both 2.0rc2+ and 1.1.4.

EgonOlsen

No idea? I have a user who gets the resolution of both monitors combined as the only one available and this one, who gets the output redirected to the wrong monitor. I would love to get multi-monitor working, but i don't know what to do!?

Matzon

I have 3 monitors at work - but I have been swamped with work lately, so no time to test anything. I'll try to find some time soon!

Matzon

I have been unable to reproduce this issues using the 'http://jpct.de/robombs/robombs.jnlp'; (lwjgl 2).
My setup is as follows:
[1][2][3] where 1,3 = Matrox and 2 = ATI. The ATI card is the primary.
My browser is in 1 and my browser download window is in 3. The JWS warning presents itself in 1 and the application (detecting hardware + initial swing window) is displayed in 2.
When I launch the game in fullscreen it is displayed in fullscreen on 2 - as expected. I am able to use the mouse in the game - no issues.
However, I was able to get it in an in-between state, if I feverishly clicked another window on 1 or 3 while the game loaded, in which case I was shown the taskbar while the game was in fullscreen. It still responded to my mouse however - so only a visual artifact that was removed once I clicked or if I alt-tab to the game.

EgonOlsen

Thank you for testing. I have no idea what was/is wrong with the setups that cause these problems. I think will just ignore it for now...

EgonOlsen

Another related issue: On Linux with a multi monitor setup, some people can select the multi monitor resolution only, i.e. something like 2720*1024. That's not always what one wants... ;) I guess this has something to do with the x-server not configured for anything else, but i'm no Linux expert. Any ideas on how to change this!?

princec

Yeah, I saw this the other day on Ubuntu - my game was nicely placed in the middle of two monitors. Entirely reasonable behaviour I suppose but not quite what we want... however I can't really see any way around it other than to add some API to query the exact screen configuration of the system.

Cas :)

EgonOlsen

Quote from: princec on February 03, 2009, 09:15:21
Yeah, I saw this the other day on Ubuntu - my game was nicely placed in the middle of two monitors. Entirely reasonable behaviour I suppose but not quite what we want... however I can't really see any way around it other than to add some API to query the exact screen configuration of the system.

Cas :)
At least you seemed to be able to use a resolution other than the native resolution of both monitors combined...
It's a bit disappointing that all i can say to users with these problems is "Pffffff....."... :'(

Matzon

Quote from: EgonOlsen on February 07, 2009, 07:47:12
It's a bit disappointing that all i can say to users with these problems is "Pffffff....."... :'(
I understand, but its really out of my hands - I dont have a multi monitor setup @ home - and @ work, I dont use linux ...
I could install something in vmware, but I am not sure that even works with multi monitor - nor do I have the time :/

You're best bet is probably to get elias's attention or try to find out why its happening.

wolf_m

If you're talking about fullscreen resolutions, that's perfectly normal. It's a side effect of using TwinView instead of 2 X servers. Same thing happens in SDL. I'm unsure what happens with Xinerama, probably something similar.

The X server reports the virtual screen size instead of the actual per-monitor size. There's really nothing you can do about it, except
- advising users to use an X setup that only uses 1 monitor for your games (you can run multiple X setups at the same time on XOrg)
- advising users to use 1 X server per screen
- implementing a windowed mode that appears to cover the whole screen

I'd recommend the first resolution.

For example, I have a setup that uses ServerLayouts in the XOrg configuration file.
One such layout is called 'leftLayout'.
It uses the screen 'left'.
The screen 'left' looks like this:
Section "Screen"
    Identifier     "left"
    Device         "tft"
    Monitor        "monitor"
    DefaultDepth    24
    Option         "AddARGBGLXVisuals" "true"
    Option         "MetaModes" "NULL,1280x1024"
    Option         "UseEdidDpi" "FALSE"
    Option         "NoLogo" "True"
    Option         "DPMS"
    Option         "TwinView"
    Option         "TripleBuffer" "true"
    SubSection     "Display"
        Virtual     1280 1024
        Depth       24
    EndSubSection
EndSection

The relevant thing here is the MetaModes Option. Although left and right are switched for reasons related to my specific configuration, you should see what I'm doing there instantly.
I call that layout with the following line from a terminal when X is not running:
xinit -- :1 -layout leftLayout

The configuration file .xinitrc in the user's home directory then handles the Window Manager startup.
The :1 is the offset relative to tty7, by the way.
So if it's :0, it's tty7; if it's :1, it's tty8 and so forth.

So if I want to call 3 KDEs, each with its own X server, the first on both screens, the second on the left and the third on the right, provided my .xinitrc starts KDE in some way, I would write
xinit -- :0 -layout bothLayout && xinit -- :1 -layout leftLayout && xinit -- :2 -layout rightLayout

And the layouts are all in /etc/X11/xorg.conf

---

A similar issue, by the way: The placement of the viewport is pretty random in fullscreen, also in SDL _and_ LWJGL; in my case, it's on the right monitor, and only half the viewport is displayed.

EgonOlsen

Quote from: wolf_m on February 07, 2009, 08:54:05
If you're talking about fullscreen resolutions, that's perfectly normal. It's a side effect of using TwinView instead of 2 X servers. Same thing happens in SDL. I'm unsure what happens with Xinerama, probably something similar.

The X server reports the virtual screen size instead of the actual per-monitor size. There's really nothing you can do about it, except
- advising users to use an X setup that only uses 1 monitor for your games (you can run multiple X setups at the same time on XOrg)
- advising users to use 1 X server per screen
- implementing a windowed mode that appears to cover the whole screen
Ok, but on my Linux machines, i can select all resolutions up to the native resolution of the desktop. On this multi monitor setup, the native resolution is the only one reported. Is that normal behaviour too?