Interaction between TwinView, RandR, and Xinerama

I’m trying to create a basic program that queries geometry about each screen. When any of the given mechanisms are in use, it complicates this since screens are no longer per monitor. You instead have to use RandR or Xinerama extensions to query this information.

My question is how to deal when these mechanisms are missing. For instance, if RandR and Xinerama are not in use, would the screen still be one big virtual area because of TwinView? Or does TwinView rely on RandR being actively present in order to function? Does it interact at all with Xinerama other than providing info through the extension?

I’m not sure what exactly is TwinView (is it something nvidia-specific?). But when you create your own application, you should do it in more standard way (using xrandr or vidmode + xinerama). Personally I prefer xrandr.

Do you know a situation when xrandr mechanism is missing? I’m asking because I use it in my application. Some window managers don’t report which screen is “primary”, but I didn’t notice any other issues.

Even if resolution/position of screen was changed in other method, you still can read or modify it using previously mentioned xrandr.