X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glws_glx.cpp;h=95cdab078951eef107b8936d8a56fa34f3df58b4;hb=bfa8b255d1fdfe68f595c189e75eb44a312c8567;hp=efc11c4362fc7c7a72bc4915ddfde5346db30862;hpb=53d224eb79529d0c0f45fa4f68251822c9c7bb6a;p=apitrace diff --git a/glws_glx.cpp b/glws_glx.cpp index efc11c4..95cdab0 100644 --- a/glws_glx.cpp +++ b/glws_glx.cpp @@ -26,9 +26,12 @@ #include #include -#include "glimports.hpp" #include "glws.hpp" +#include +#include +#include + namespace glws { @@ -135,9 +138,6 @@ public: display, window, name, name, None, (char **)NULL, 0, &sizehints); - XMapWindow(display, window); - - waitForEvent(window, Expose); glXWaitX(); } @@ -158,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); } @@ -210,6 +229,7 @@ public: GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, + GLX_ALPHA_SIZE, 1, GLX_DEPTH_SIZE, 1, GLX_STENCIL_SIZE, 1, None @@ -220,6 +240,7 @@ public: GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, + GLX_ALPHA_SIZE, 1, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 1, GLX_STENCIL_SIZE, 1,