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

Alan Coopersmith alan.coopersmith at oracle.com
Sat Aug 25 12:13:27 PDT 2012


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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Return-connection-failure-if-display-string-specifie.patch
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20120825/f79b639b/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Bug-53242-xwininfo-segfaults-on-invalid-screen.patch
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20120825/f79b639b/attachment-0001.ksh>


More information about the Xcb mailing list