Package: freeglut3
Version: 2.7.0~svnr876-1waitmap
Severity: normal

Hello

running the piglit read-front test causes

 - BadMatch on swrast
 - garbage returned on gallium

because the window is not mapped before the drawing happens.

Attaching a patch that fixes the problem for me.

https://sourceforge.net/tracker/?func=detail&aid=3048705&group_id=1032&atid=101032

-- System Information:
Debian Release: squeeze/sid
  APT prefers stable
  APT policy: (900, 'stable'), (700, 'testing'), (500, 'unstable'), (200, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.35-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages freeglut3 depends on:
ii  libc6                         2.11.2-2   Embedded GNU C Library: Shared lib
ii  libgl1-mesa-glx [libgl1]      7.8.2-2    A free implementation of the OpenG
ii  libx11-6                      2:1.3.3-3  X11 client-side library
ii  libxext6                      2:1.1.2-1  X11 miscellaneous extension librar

freeglut3 recommends no packages.

freeglut3 suggests no packages.

-- no debconf information
Index: trunk/freeglut/freeglut/src/freeglut_window.c
===================================================================
--- freeglut/src/freeglut_window.c	(revision 876)
+++ freeglut/src/freeglut_window.c	(working copy)
@@ -31,6 +31,7 @@
 
 #if TARGET_HOST_POSIX_X11
 #include <limits.h>  /* LONG_MAX */
+#include <unistd.h>  /* usleep */
 #endif
 
 #if defined(_WIN32_WCE)
@@ -886,8 +887,17 @@
 #endif
 #endif
 
+#if TARGET_HOST_POSIX_X11
+static Bool isVisible( Display *display, XEvent *event, XPointer arg)
+{
+    Window window = arg;
+    return (event->type == MapNotify) && (event->xmap.window == window);
+}
 
+#endif
 
+
+
 /*
  * Opens a window. Requires a SFG_Window object created and attached
  * to the freeglut structure. OpenGL context is created here.
@@ -903,6 +913,7 @@
     XTextProperty textProperty;
     XSizeHints sizeHints;
     XWMHints wmHints;
+    XEvent _; /* return buffer required for a call */
     unsigned long mask;
     unsigned int current_DisplayMode = fgState.DisplayMode ;
 
@@ -1088,6 +1099,9 @@
 
     XFree(visualInfo);
 
+    if( !isSubWindow)
+        XPeekIfEvent( fgDisplay.Display, &_, &isVisible, window->Window.Handle );
+
 #elif TARGET_HOST_MS_WINDOWS
 
     WNDCLASS wc;

Reply via email to