[comp.windows.x] Multiple Screens on a Sun

kaleb@mars.jpl.nasa.gov (Kaleb Keithley) (11/04/89)

We have a Sun4/260 which has two CG2 framebuffers with two Sun color monitors.

We have experienced the same problem that has been reported over the net 
lately when trying to parent a client on screen 0 when running both screens.

We are using the standard Mit release 3 server with the Purdue speedups.

I wrote the following program to attempt to investigate the problem:


#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>

static
Display *display;

main()

{
	int loop;

	XWindowAttributes windowattributes;

	static char display_name[] = "unix:0";

	if ((display = XOpenDisplay(display_name)) == 0) {

		printf("cannot open display %s\n",display_name);
		exit(1);
	}

	printf("display has %d screen(s)\n",display->nscreens);

	for (loop = 0; loop < display->nscreens; loop++) {

		printf("\nscreen %d root window id = 0x%x\n",
		  loop,
	 	  display->screens[loop].root);

		if (XGetWindowAttributes(display,
		  display->screens[loop].root,
		  &windowattributes)) {

			printf(" visual ptr in root windowattributes = 0x%x\n",
			  windowattributes.visual);
			printf(" visual ptr in screen                = 0x%x\n",
			  display->screens[loop].root_visual);
		}
	}

	XCloseDisplay(display);

}

If I start the Server with -dev /dev/cgtwo0 and run the above program I get
the following output:

display has 1 screen(s)

screen 0 root window id = 0x8006b
 visual ptr in root windowattributes = 0xf0f0
 visual ptr in screen              = 0xf0f0

This leads me to believe that the visual ptrs should be the same(?)

If I start the Server without the -dev option it defaults to two screens and
when I run the above program I get the following output:


display has 2 screen(s)

screen 0 root window id = 0x8006d
 visual ptr in root windowattributes = 0x0
 visual ptr in screen                = 0x0

screen 1 root window id = 0x80070
 visual ptr in root windowattributes = 0xf190
 visual ptr in screen                = 0xf1e8

Three points come to mind:
    1) The NULL pointer for the visual of screen 0 implies that no visual is
attached to the screen, with some potential implications.  XCreateSimpleWindow
and XCreateWindow fail when the visual is inherited from the parent.  What
visual should be used to create a window on screen 0?
    2) Why are the visual pointers on screen 1 different?  The one screen
scenario implies that they should be the same, or should they?
    3) Since there seem to be two different visuals, is it that the
Server is having trouble getting the visuals attached to the right screens?

Does anyone have any ideas about where to go from here?  Has this already
been documented and fixed?  In R3?  In R4?  Should I submit this to xbugs?

Thank you

"Where are we gonna go? -- Planet 10"
Kaleb Keithley                                     kaleb@mars.jpl.nasa.gov
Jet Propulsion Laboratory          (818)354-8771 

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (11/04/89)

    Does anyone have any ideas about where to go from here?  Has this already
    been documented and fixed?  In R3?  In R4?  Should I submit this to xbugs?

If you think there's a bug, certainly submit it to xbugs.  We at MIT have only
a few Sun configurations to play with, and a CG2 isn't one of them.  In general,
we rely on the vendors to give us working ddx code.  Unless Sun provides us with
a fix, it probably won't be fixed in R4.