Ignore unexpected GLX_BufferSwapComplete
authorOwen W. Taylor <otaylor@fishsoup.net>
Fri, 30 Apr 2010 18:56:07 +0000 (14:56 -0400)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Wed, 5 May 2010 11:00:40 +0000 (12:00 +0100)
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>
clutter/glx/clutter-event-glx.c

index 2034534..1fb9cec 100644 (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;
         }
     }