[Xcb] sending a custom event

Jim Crafton jim.crafton at gmail.com
Tue Mar 27 12:51:02 PDT 2007


Well what I'd like is what I can do in Win32, that is send custom
events/messages to the event loop running in the current thread, and
then just respond to these messages. From what you're saying this
isn't really feasible. So I guess I need to handle this on my own.

While I understand the reasons for this feature not being there, it's
absence, IMHO, does make it (programming on X and xcb specifically)
harder to use. No timers, no easy way to send messages to yourself,
etc. It would be nice if a lot of this had a default implementation,
so that app/toolkit developers didn't have to re-implement and worry
about whether or not they did it correctly.

Cheers

Jim

On 3/27/07, Jamey Sharp <jamey at minilop.net> wrote:
> 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
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFGCXMbp1aplQ4I9mURAknsAJ4qKE9ZNnAvP3wi3OKXFUQA038uCgCfeRbZ
> 9aSR4ChvPFrJbPNX6O7q4RA=
> =Ei/J
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
>


More information about the Xcb mailing list