diff options
author | Brian Paul <[email protected]> | 2013-04-17 16:16:24 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-04-17 16:23:19 -0600 |
commit | 02039066a8bd4e9cdce7f7d4c90606b54018d74e (patch) | |
tree | 3f8ae3122c642f27b069c72279892a546485b0b2 /src/gallium | |
parent | 505ac6ddc6f83ee17655d54cf46ed71ead9e578c (diff) |
st/wgl: fix issue with SwapBuffers of minimized windows
If a window's minimized we get a zero-size window. Skip the SwapBuffers
in that case to avoid some warning messages with the VMware svga driver.
Internal bug #996695
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/wgl/stw_framebuffer.c | 22 | ||||
-rw-r--r-- | src/gallium/state_trackers/wgl/stw_framebuffer.h | 2 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.c b/src/gallium/state_trackers/wgl/stw_framebuffer.c index c22e0f153f0..18ecb05e94f 100644 --- a/src/gallium/state_trackers/wgl/stw_framebuffer.c +++ b/src/gallium/state_trackers/wgl/stw_framebuffer.c @@ -140,6 +140,8 @@ stw_framebuffer_get_size( struct stw_framebuffer *fb ) width = client_rect.right - client_rect.left; height = client_rect.bottom - client_rect.top; + fb->minimized = width == 0 || height == 0; + if (width <= 0 || height <= 0) { /* * When the window is minimized GetClientRect will return zeros. Simply @@ -530,15 +532,17 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data) } } - if(fb->shared_surface) { - stw_dev->stw_winsys->compose(screen, - res, - fb->shared_surface, - &fb->client_rect, - data->PresentHistoryToken); - } - else { - stw_dev->stw_winsys->present( screen, res, hdc ); + if (!fb->minimized) { + if (fb->shared_surface) { + stw_dev->stw_winsys->compose(screen, + res, + fb->shared_surface, + &fb->client_rect, + data->PresentHistoryToken); + } + else { + stw_dev->stw_winsys->present( screen, res, hdc ); + } } stw_framebuffer_update(fb); diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.h b/src/gallium/state_trackers/wgl/stw_framebuffer.h index 3ba51ba6898..cee28e8a19a 100644 --- a/src/gallium/state_trackers/wgl/stw_framebuffer.h +++ b/src/gallium/state_trackers/wgl/stw_framebuffer.h @@ -79,6 +79,8 @@ struct stw_framebuffer /* FIXME: Make this work for multiple contexts bound to the same framebuffer */ boolean must_resize; + boolean minimized; /**< Is the window currently minimized? */ + unsigned width; unsigned height; |