[Xcb] DefaultScreen

Vincent Torri Vincent.Torri at iecn.u-nancy.fr
Wed Dec 7 22:20:43 PST 2005


>
> > And about DefaultScreen, as I talk about it :D, how can I get it ?
> >
> > in xcl (old version), it's:
> > dpy->fd = XCBOpen(display_name, &dpy->default_screen);
> > which is strange as XCBOpen takes an int and not an int * as 2nd
> > parameter.
> >
> > So, i'm a bit confused.
>
> This is one of the API warts I've been meaning to clean up for months.
>
> The XCBConnect function, as documented on the XcbApi page but not yet
> implemented, has exactly the interface that apparently XCBOpen had a
> long time ago. And that's exactly the right interface for most
> applications, I think.
>
> At the moment, all you can do is call
>
> 	char *host = 0;
> 	int dsp;
> 	int screen;
> 	XCBParseDisplay(getenv("DISPLAY"), &host, &dsp, &screen);
> 	free(host);
>
> and then screen will contain the same value as Xlib's DefaultScreen
> would have returned. Ugly.
>

And with XCBConnectBasic, default_screen is equal to 0, right ?

> Note that I don't intend XCB to track the "default screen" number for
> you, so when you're implementing ecore you should find out what the
> screen is on startup and save it somewhere yourself.

That's what I thought. I wanted to be sure of that.

thank you

Vincent


More information about the Xcb mailing list