GDK Event skipping...
- From: Tom Gilbert <gilbertt tomgilbert freeserve co uk>
- To: gtk-list gnome org
- Subject: GDK Event skipping...
- Date: Thu, 17 Aug 2000 20:43:28 +0000
Hey,
Okay I'm stumped. Been fiddling for a while... but...
I need to do in GDK the equivalent of a:
while (XCheckTypedWindowEvent
(disp, ev->xmotion.window, MotionNotify, ev));
That is, in a MotionNotify event, to skip over all the other queued
MotionNotify events and continue on to process the most recent one...
(Doing intensive graphical work in the MotionNotify, Motion events tend
to build up in the queue faster than they can be dispatched...)
I tried something really crufty like:
if (gdk_events_pending())
{
if ((e = gdk_event_get()) != NULL)
{
if (e->type == GDK_MOTION_NOTIFY)
{
D(5, ("skipping event, new one coming\n"));
event = e;
}
else
gdk_event_put((GdkEvent *) e);
}
}
Which *sometimes* prints the debugging message, when things are *really*
crawling, but it doesn't skip all the duplicate events...
Have I missed something really simple in the API, or do I have to
reinvent XCheckTypedEvent myself? Any tips?
Tom.
--
.------------------------------------------------------.
.^. | Tom Gilbert, England | http://www.linuxbrit.co.uk |
/V\ |----------------------| gilbertt@linuxbrit.co.uk |
// \\ | Sites I recommend: `-------------------------------|
/( )\ | www.freshmeat.net www.enlightenment.org slashdot.org |
^^-^^ `------------------------------------------------------'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]