Queuing of deferred Expose events.
This commit is contained in:
parent
4f7dc46ca2
commit
7401463528
|
@ -217,14 +217,25 @@ void EVENT_ProcessEvent( XEvent *event )
|
||||||
if (TSXCheckTypedWindowEvent(display,((XAnyEvent *)event)->window,
|
if (TSXCheckTypedWindowEvent(display,((XAnyEvent *)event)->window,
|
||||||
ConfigureNotify, &new_event)) {
|
ConfigureNotify, &new_event)) {
|
||||||
EVENT_ProcessEvent( &new_event );
|
EVENT_ProcessEvent( &new_event );
|
||||||
EVENT_Expose( pWnd, (XExposeEvent *)event );
|
if (!EVENT_Expose( pWnd, (XExposeEvent *)event ))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* no luck at this time, defer Expose event for later */
|
/* no luck at this time, defer Expose event for later */
|
||||||
if (!pWnd->expose_event) pWnd->expose_event = malloc( sizeof(XExposeEvent) );
|
/* use "type" for an event counter, it is never rechecked */
|
||||||
else { FIXME(x11,"can't handle more than one deferred Expose events\n"); }
|
if (!pWnd->expose_event) {
|
||||||
*(pWnd->expose_event) = *(XExposeEvent *)event;
|
pWnd->expose_event = malloc( sizeof(XExposeEvent) );
|
||||||
|
pWnd->expose_event[0] = *(XExposeEvent *)event;
|
||||||
|
pWnd->expose_event[0].type = 1;
|
||||||
|
} else {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = ++pWnd->expose_event[0].type;
|
||||||
|
pWnd->expose_event = realloc( pWnd->expose_event,
|
||||||
|
i * sizeof(XExposeEvent) );
|
||||||
|
pWnd->expose_event[i-1] = *(XExposeEvent *)event;
|
||||||
|
FIXME(x11, "Try and combine Expose events? %d queued.\n", i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -237,8 +248,13 @@ void EVENT_ProcessEvent( XEvent *event )
|
||||||
if (!pWnd) return;
|
if (!pWnd) return;
|
||||||
EVENT_ConfigureNotify( pWnd, (XConfigureEvent*)event );
|
EVENT_ConfigureNotify( pWnd, (XConfigureEvent*)event );
|
||||||
if (pWnd->expose_event) {
|
if (pWnd->expose_event) {
|
||||||
/* process deferred Expose event */
|
/* process deferred Expose event(s) */
|
||||||
EVENT_Expose( pWnd, pWnd->expose_event );
|
int i;
|
||||||
|
|
||||||
|
for (i=0; i<pWnd->expose_event[0].type; i++) {
|
||||||
|
if(EVENT_Expose( pWnd, &pWnd->expose_event[i] ))
|
||||||
|
ERR(x11, "Unprocessed expose event discarded\n");
|
||||||
|
}
|
||||||
free( pWnd->expose_event );
|
free( pWnd->expose_event );
|
||||||
pWnd->expose_event = NULL;
|
pWnd->expose_event = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue