Ignore unexpected GLX_BufferSwapComplete

A server that supports GLX_BufferSwapComplete will always send
these events, so we should just silently ignore them if we've
chosen not to take advantage of the INTEL_swap_event GLX
extension.

http://bugzilla.openedhand.com/show_bug.cgi?id=2102

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
Owen W. Taylor 2010-04-30 14:56:07 -04:00 committed by Emmanuele Bassi
parent 21914eaead
commit d8e1bd989c

View File

@ -82,14 +82,15 @@ clutter_backend_glx_handle_event (ClutterBackendX11 *backend_x11,
if (stage_x11->xwin == swap_complete_event->drawable)
{
if (G_UNLIKELY (stage_glx->pending_swaps == 0))
{
g_warning ("Spurious GLX_BufferSwapComplete event received for "
"stage drawable = 0x%08lx",
swap_complete_event->drawable);
}
else
/* Early versions of the swap_event implementation in Mesa
* deliver BufferSwapComplete event when not selected for,
* so if we get a swap event we aren't expecting, just ignore it.
*
* https://bugs.freedesktop.org/show_bug.cgi?id=27962
*/
if (stage_glx->pending_swaps > 0)
stage_glx->pending_swaps--;
return TRUE;
}
}