]> git.cworth.org Git - apitrace/blobdiff - glws_glx.cpp
Add missing file to glxtrace.so
[apitrace] / glws_glx.cpp
index bba108a43a5d64c175368cc0cacfd1068c5d04f9..95cdab078951eef107b8936d8a56fa34f3df58b4 100644 (file)
 #include <stdlib.h>
 #include <iostream>
 
-#include "glimports.hpp"
 #include "glws.hpp"
 
 #include <X11/Xlib.h>
+#include <GL/gl.h>
 #include <GL/glx.h>
 
 
@@ -138,9 +138,6 @@ public:
             display, window, name, name,
             None, (char **)NULL, 0, &sizehints);
 
-        XMapWindow(display, window);
-
-        waitForEvent(window, Expose);
         glXWaitX();
     }
 
@@ -161,11 +158,30 @@ public:
 
         XResizeWindow(display, window, w, h);
 
+        // Tell the window manager to respect the requested size
+        XSizeHints *size_hints;
+        size_hints = XAllocSizeHints();
+        size_hints->max_width  = size_hints->min_width  = w;
+        size_hints->max_height = size_hints->min_height = h;
+        size_hints->flags = PMinSize | PMaxSize;
+        XSetWMNormalHints(display, window, size_hints);
+        XFree(size_hints);
+
         waitForEvent(window, ConfigureNotify);
 
         glXWaitX();
     }
 
+    void show(void) {
+        if (!visible) {
+            XMapWindow(display, window);
+
+            waitForEvent(window, Expose);
+
+            Drawable::show();
+        }
+    }
+
     void swapBuffers(void) {
         glXSwapBuffers(display, window);
     }