[Xcb] Where should check for valid screen lie - libxcb or callers?

Jeremy Huddleston Sequoia jeremyhu at freedesktop.org
Sat Aug 25 12:28:06 PDT 2012


I feel more comfortable with #1.  I don't like the idea of applications having differing behaviors for handling this error.  If a client asks libxcb to connect to :0.1 and :0.1 doesn't exist, then the connection should fail.

That being said, I think a bit of a hybrid would be good.  I'd be up for using a different error code so clients could tell the difference between "no server is listening on that display" versus "the server which we were able to connect to doesn't know about that screen"

On Aug 25, 2012, at 12:13, Alan Coopersmith <alan.coopersmith at oracle.com> wrote:

> https://bugs.freedesktop.org/show_bug.cgi?id=53242 notes that our
> xcb-converted xwininfo now segfaults if you put an invalid screen
> number in the display string, where it used to get "unable to open display"
> errors thanks to Xlib checking & enforcing the existence of a specified
> screen (for instance if the server at :0 has only one screen :0.1 is an
> error).
> 
> Should libxcb similarly have a centralized check for this, as shown in
> the first attached patch, or should we expect all callers to check
> themselves, as shown in the second patch, which could give them the freedom
> to tell the user "That screen doesn't exist, so I picked one myself" and
> carry on?
> 
> -- 
> 	-Alan Coopersmith-              alan.coopersmith at oracle.com
> 	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
> <0001-Return-connection-failure-if-display-string-specifie.patch><0001-Bug-53242-xwininfo-segfaults-on-invalid-screen.patch>_______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb



More information about the Xcb mailing list