[Xcb] magical callback funness

Jeremy Kolb jkolb at brandeis.edu
Thu Mar 24 09:14:51 PST 2005


Henrik Sandklef wrote:
>>I've run into a snag with record.  It there's a request/reply called
>>RecordGetContext.  This gets the events recorded on the current
>>connection.
> 
> 
> When working with RECORD you use a context type. When having made one such
> you can:
> 
>  1 Query the state
>   -------------------
>   Done using the function XRecordGetContext
> 
>   The request "RecordGetContext" is sent after the
>   function XRecordGetContext has been called
> 
>   2 Start/stop recording
>   -------------------
>   Done using the function XRecordEnableContext/XRecordDisableContext
> 
>   The request RecordEnableContext is sent after the
>   function XRecordEnableContext has been called
> 
>   The request RecordDisableContext is sent after the
>   function XRecordDisableContext has been called
> 

Right.  Thanks.  That's a good breakdown :)

> 
> 
>>However when calling the reply it enters a loop and prints
>>out how no record was found for such and such an event.
> 
> 
> Calling the reply? Can you please give some more info? Do you mean sending?
> 

In XCB we separate this out into two functions.  One sends the request, 
another waits for the reply.  For example, with RecordGetContext we have 
  XCBRecordGetContext() which sends the request and 
XCBRecordGetContextReply which waits for the reply.

> Can you show me your source code?
> 
> 
>> The problem is
>>that I can't get out of this loop to do other things like parse the
>>information and what not.
> 
> 
> Where is your code located? In the client or the server?
> 

Uses XCB on the client side.

> 
> 
>>Xlib seems to solve this problem by installing a callback (I'm not
>>really sure how it works though). when enabling the context
>>(RecordEnableContext).
> 
> This is right.
> 
Well, the problem here is that XCB only implements at the protocol 
level.  The callback is added in xlib above the protocol.
> 
>>I'm not sure how to solve this.  Ideas, suggestions?
> 
> Show the sources :)
> 
> /h
> 

Jeremy


More information about the xcb mailing list