diff options
author | José Fonseca <jfonseca@vmware.com> | 2011-10-26 18:43:21 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2011-10-26 18:43:21 +0100 |
commit | 79ae5703b55b13194e1dc50db7f5813d107e8806 (patch) | |
tree | b2cf5d8c7c08288ce20bc2ab321fdad35578fca7 /glws_wgl.cpp | |
parent | 212718d6191b4a43c710a7979e566dbbb4123585 (diff) |
Cleanup X11 event handling.
Fixes an infinite loop on GlxDrawable::show() in certain traces.
Diffstat (limited to 'glws_wgl.cpp')
-rw-r--r-- | glws_wgl.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/glws_wgl.cpp b/glws_wgl.cpp index adc99578..1958b5fc 100644 --- a/glws_wgl.cpp +++ b/glws_wgl.cpp @@ -136,21 +136,28 @@ public: void resize(int w, int h) { - Drawable::resize(w, h); + if (w == width && h == height) { + return; + } + RECT rClient, rWindow; GetClientRect(hWnd, &rClient); GetWindowRect(hWnd, &rWindow); w += (rWindow.right - rWindow.left) - rClient.right; h += (rWindow.bottom - rWindow.top) - rClient.bottom; SetWindowPos(hWnd, NULL, rWindow.left, rWindow.top, w, h, SWP_NOMOVE); + + Drawable::resize(w, h); } void show(void) { - if (!visible) { - ShowWindow(hWnd, SW_SHOW); - - Drawable::show(); + if (visible) { + return; } + + ShowWindow(hWnd, SW_SHOW); + + Drawable::show(); } void swapBuffers(void) { |