[Xmonad] Xinerama

Aldo Cortesi aldo at nullcube.com
Tue Jun 12 10:33:10 EDT 2007


Hi folks,


I'm seeing symptoms similar to the the same Xinerama-related problem reported
here:

http://www.haskell.org/pipermail/xmonad/2007-June/000491.html

In that same thread, Jason Creighton suggested running the following test
script:

"""
    import Graphics.X11.Xlib
    import Graphics.X11.Xinerama

    main = do
        d <- openDisplay ""
        xineramaQueryScreens d >>= print
        getScreenInfo d >>= print
"""

On my system, this outputs:

"""
Nothing
[Rectangle {rect_x = 0, rect_y = 0, rect_width = 1920, rect_height = 1200}]
"""

Now the plot thickens. The following snippet of C should be very nearly
equivalent to the script above:

"""
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xinerama.h>
#include <stdio.h>
#include <stdlib.h>

int main (){
    Display *dpy;
    XineramaScreenInfo *xsi;
    int i, num;
    dpy = XOpenDisplay("\0");
    printf("%s\n", XDisplayString(dpy));
    if((xsi = XineramaQueryScreens(dpy, &num))) {
        printf("%i screens\n", num);
        for(i = 0; i < num; i++) {
           printf("%i: %ix%i\n", xsi[i].screen_number, xsi[i].width, xsi[i].height);
        }
       XFree(xsi);
    }
    XCloseDisplay(dpy);
    return 0;
}
"""

However, from this, I get the following output:

2 screens
0: 1920x1200
1: 1280x1024

As you can see, the Xinerama screens are detected correctly. Xinerama under
other window managers (e.g. KDE) also seems to work flawlessly with the same X
configuration. Despite this is being my first real foray into Haskell, I
bravely ploughed through the appropriate bindings in X11-extras and X11-1.2.2,
but I could see no obvious errors. 

I have a hunch that the problem is related to the fact that I have an NVidia
graphics card with TwinView (NVidia's magic sauce that allows you to connect
multiple screens to the same GPU). Apparently, Twinview is known to cause
problems with some window managers - see, for example, the FAQ section of this
page from NVidia:

http://http.download.nvidia.com/XFree86/Linux-x86/1.0-8178/README/appendix-g.html

The FAQ entry is pretty vague about exactly what form these "problems" might
take.  

I'm keen to give XMonad a try, so I'd be happy to spend time helping to
troubleshoot this problem...





Cheers,




Aldo




-- 
Aldo Cortesi
aldo at nullcube.com
http://www.nullcube.com
Mob: 0419 492 863


More information about the Xmonad mailing list