Slow XQueryPointer?

Alan Coopersmith alan.coopersmith at oracle.com
Thu Jan 26 10:42:07 PST 2012


On 01/26/12 07:51 AM, Lauri Kasanen wrote:
> On Thu, 26 Jan 2012 09:37:28 -0500
> Adam Jackson<ajax at redhat.com>  wrote:
>
> Hi Adam
>
>>> Any suggestions on making the call faster? Would it be possible to use
>>> it with a timeout, say, if it takes over 1ms, abort?
>>
>> Xlib doesn't work that way.  You could do that with XCB and a main loop
>> though.
>
> XCB is unfortunately not possible.

You don't have to convert the entire app to XCB to be able to use it for
just one or two calls, for example, most of xdpyinfo uses libX11 calls
still, but the loop to list extensions uses xcb to be able to send all
the queries and then wait for all the responses instead of doing a blocking
call for every single extension:

http://cgit.freedesktop.org/xorg/app/xdpyinfo/commit/?id=072fc46b2af370e78fa53426626ca3c33b74bdf2

More in-depth explanations at:

http://xcb.freedesktop.org/MixingCalls/
http://blogs.oracle.com/alanc/entry/porting_xwininfo_to_xcb

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System




More information about the xorg mailing list