Fullscreen over 2 monitors

xeethrax wrote on Monday, April 11, 2011:


I’ve been trying to get my app to run in fullscreen over 2 x 1680x1050 22"
widescreen monitors with GLFW without success. This was in latest Ubuntu using
Nvidia TwinView. It works fine with Glut, but for some reason Glut will spend
40-50ms swapping buffers when they’re 1680x2100 big… So I decided to try GLFW
before going with Sdl.

The problem is that it only fullscreens in one window. Which screen it chooses
is actually dependant from which screen is “active” when I start the app. I’ve
set proper metamodes (although nvidia does this task perfectly fine for
you), and made sure everything is appropriate as far as Xorg.conf is
concerned. I’ve also checked that it in fact sets the correct resolution with
glfwGetWindowSize. And again, Glut fullscreen works fine…

Same happens in windows though - in fact, I have yet to get GLFW fullscreen
mode to work at all. Could you confirm or deny (or better yet, offer a
solution) whether GLFW is to blame here, before change to Sdl?

PS: I also get lower framerates with glfw than with glut?

elmindreda wrote on Monday, April 11, 2011:

You are most likely using a modern window manager on Ubuntu, which means that
GLFW leaves most of the details of fullscreen placement to the WM. In almost
all cases, this is what people want.

Since you dont’ want this, you could try disabling the EWMH check in
x11_window.c and so force GLFW to use the older override-redirect code path.

Please clarify what you mean by GLFW fullscreen mode not working at all. What
happens when you request a fullscreen window?

xeethrax wrote on Monday, April 11, 2011:

Hey, thanks for your swift reply. :slight_smile:

My apologies if I did not make myself properly understood. Fullscreen actually
works, but only one one screen. glfwGetWindowSize reports 1680x2100 as it
should be, but it only goes fullscreen on the one screen, only using 1680x1050
in reality. Furthermore, it will use the screen from which I launch the app
(ie, the screen that contains the console window from which I launch the

It is very possible indeed that the WM is to blame, but as dual monitor gaming
in linux appears to be a bit dodgy, I thought I’d check if there was any known
issues regarding my problem. I Couldn’t find anything relating to my issue

I did notice that when doing windowed mode that neither resizing across the
screen or moving the window with glfw made any difference whatsoever. Probably
gnome is to blame. I still don’t understand why glfw reports its using the
correct resolution (1680x2100), when it’s in fact using 1680x1050. According
to nvidia, TwinView knows internally that there are two screens (and handles
them with metamodes) - but as far as X is concerned, it only sees it as 1 big
device with 1 big buffer. This seems to be confirmed by the fact that glfw
only finds one resolution (1680x2100), so you’d think it’d work as you’d
expect, but sadly this isn’t the case…

I guess I could give your suggestion a try though, before I move on to Sdl…

elmindreda wrote on Monday, April 11, 2011:

That glfwGetWindowSize reports the requested instead of the actual window size
sounds like a bug. I will investigate this. Having the window appear on the
same monitor as the terminal that was used to start it matches the behaviour
on my machine, but I don’t consider that a bug.

If the window was put into EWMH fullscreen mode then as a user you can’t
really change its size, and the WM will actively fight you if you try. It’s
the same behaviour that for example media players use. Also, X may see only
one screen, but Metacity seems very aware of where the actual monitors are. I
assume I’m going to find out how when I add multi-monitor support to GLFW 3.

As for your actual problem, with GLFW 2.x the only advice I can give is to try
disabling the EWMH support in GLFW. That might give you the behaviour you
need. I’ll keep this use case in mind for GLFW 3, however.

xeethrax wrote on Tuesday, April 12, 2011:

Thanks again for you reply. It’s always nice to see such activity among devs
on a long standing project :slight_smile:

I will try disabling the EWMH check in x11_window.c hopefully sometime during
the day.