View Full Version : Display Fullscreen on Second Monitor

02-03-2013, 09:41 AM
I'm hoping this is an easy question, but I could not find any info in my web searches, so here goes:

I'm running Linux and my machine has two monitors. I can create OpenGL windows in FullScreen mode on the primary monitor. However, I can't figure out how to tell OpenGL (or glut, actually) to open the FullScreen window on the secondary monitor. Does anyone know how to do this?

Dark Photon
02-04-2013, 05:36 AM
There are multiple ways to have an X server span multiple monitors, and which method is applicable to you depends on which you are using.

If you have each monitor set up on its own X screen, then you should be able to force GLUT to put your window on the second monitor by putenv'ing DISPLAY=:0.1 before you call glutInit (haven't tried that myself though).

To see if this is how you have it set up, bring up a shell window on each monitor and do an echo $DISPLAY. If you see :0.0 on one monitor, and :0.1 on the second monitor, then you have each monitor on its own X screen. Try xclock -display :0.1 or glxgears -display :0.1 -fullscreen

02-04-2013, 06:16 AM
Thanks for your replay.

I tried 'glxgears -display :0.1 -fullscreen' amd it didn't work. It couldn't open display :0.1.

I'm not sure how to create a shell window on the second display: they are always created on the first display.

Do you know how I can configure the X server to work this way?

Dark Photon
02-04-2013, 04:35 PM
Ultimately it boils down to cooking an /etc/X11/xorg.conf file. Read the docs on that for details. You want "multiple X screens" (websearch tht). If you're running an NVidia card, you can use nvidia-xconfig to do the config work pretty quickly for various common configs. See the --separate-x-screens option.

02-04-2013, 06:03 PM
An xorg.conf file? I was hoping you wouldn't say that. This machine does not has an ATI card, so I can't use nvidia-settings. However, I do have access to an Nvidia machine and I tried it and it worked. So I saved that xorg.conf file and hopefully that will help me with on the ATI machine.

Thank you.