Only one monitor detected X11

X11 nomenclature is… a mess.

GLFW only supports a single X11 screen, chosen by glfwInit. X11 screens are (nowadays) like virtual screens and can cover any number of physical monitors using XRandR or (deprecated) Xinerama. Each X11 screen has its own window hierarchy and windows cannot move between them. We pass a window to XRRGetScreenResourcesCurrent to let it know which X11 screen we are interested in.

One can run a GLFW program on any existing X11 screen by setting the DISPLAY environment variable, which is typically set to :0.0. The last number is the X11 screen number.

env DISPLAY=:0.1 ./my_game

The matching of GLFW monitors against screens by area in GLFW uses Xinerama screens, not X11 screens. Xinerama screens are viewports into a single X11 screen much like XRandR monitors and CRTCs. The window manager protocol for making windows full screen take Xinerama screen indices instead of XRandR IDs, which is why GLFW needs them.

It would be possible to support multiple X11 screens in GLFW but I believe it would be too much extra complexity and maintenance for such a rare setup. It would also break some existing assumptions like being able to place a window on any monitor.