You can clone with
GLFW seems to have a problem with fullscreen modes if one screen is set on top of another (working in X11 with XRandr).
I normally set up my screens like this: 'xrandr --output DVI-I-1 --auto --pos 0x0 --primary --output DVI-D-0 --below DVI-I-1 --output HDMI-0 --auto --pos 100x100'. In english, that's a large 1920x1080 monitor (DVI-D-0) for my primary screen, another large 1920x1080 monitor (DVI-I-1) above the main screen for rendering output, and then a sub-region of the rendering screen which shows the output targeted at a small 1280x800 monitor (HDMI-0).
The reason I'm superimposing my screens is because I'm doing software development for the Oculus Rift. It's viewed by the system as a monitor, but you can't really see normal desktop stuff through it very well, so having the output for it overlaid on one of my other monitors is usually helpful for debugging.
Here's how it looks when I create a GLFW window using this code
window = glfwCreateWindow(w, h, "glfw", NULL, NULL);
I see this:
But when I try to do full screen with this code
GLFWmonitor * target = ...;
window = glfwCreateWindow(w, h, "glfw", target, NULL);
The Rift display is still showing the same sub-region of the top screen, meaning I see something approximately like this:
When I don't do superimposition, but instead set the Rift outside the areas covered by the existing monitors, then I don't have a problem, and the Rift display looks correct. I'd rather not have to use xrandr to reset the screen layouts every time I want to test something for fullscreen.
I certainly want GLFW to work well with the Rift. I think that's a very important piece of hardware to support. However, I'm currently attending a conference and won't have time to look into this until Monday at the earliest.
Thanks. I have a workaround for the time being.
So this is more of a RandR thing and less of a Rift thing.
The reason that the window gets expanded to fill the second DVI monitor is that your window manager thinks that this is the monitor the window should go full screen on. GLFW uses the EWMH full screen mechanism where available, which leaves almost all such logic up to the window manager. In effect, all GLFW is doing is moving the window to the right monitor and then telling the WM "full screen, please".
As for possible workarounds, you can try forcing non-EWMH full screen by tinkering with detectEWMH in x11_init.c, which will also disable iconification, or use a windowed mode window and move it to the correct position.
I'm going to look into whether using _NET_WM_FULLSCREEN_MONITORS can help solve this properly.