[Xcb] sending a custom event

Jamey Sharp jamey at minilop.net
Tue Mar 27 12:40:11 PDT 2007


On Tue, Mar 27, 2007 at 02:59:27PM -0400, Jim Crafton wrote:
> What's the right way to send a custom event to my event loop using
> xcb? Any sample code for this? I haven't found much of anything, but
> maybe I'm looking in the wrong places.

I'm not sure what you're looking for.

If you want your event loop to process additional events that aren't X
events, which is fairly reasonable, you need to provide your own
mechanism for getting those events there. The X event queue is no place
for non-X events. :-)

You can use the SendEvent request to dispatch a custom ClientMessage
event to another client, but you generally shouldn't use that for
sending messages to yourself. If you do, you have to wait for the
message to get to the server and then come back; plus, you get very
little data space to work with.

Perhaps you're trying to port code that uses XPutBackEvent? XCB doesn't
support that functionality (for very good reasons), though you can
emulate it by keeping your own event queue and periodically moving X
events from XCB into your queue.

Does any of that help?

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20070327/868af03a/attachment.pgp


More information about the Xcb mailing list