Skip to content
Snippets Groups Projects
Commit 16d42af6 authored by Jose Fonseca's avatar Jose Fonseca
Browse files

st/wgl: Prevent spurious framebuffer sizes when the window is minimized.

When the window is minimized GetClientRect will return zeros.

Instead of creating a 1x1 framebuffer, simply preserve the current window
size, until the window is restored or maximized again.
parent b5829c0d
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,7 @@ stw_framebuffer_release(
static INLINE void
stw_framebuffer_get_size( struct stw_framebuffer *fb )
{
unsigned width, height;
LONG width, height;
RECT client_rect;
RECT window_rect;
POINT client_pos;
......@@ -126,10 +126,17 @@ stw_framebuffer_get_size( struct stw_framebuffer *fb )
width = client_rect.right - client_rect.left;
height = client_rect.bottom - client_rect.top;
if(width < 1)
width = 1;
if(height < 1)
height = 1;
if (width <= 0 || height <= 0) {
/*
* When the window is minimized GetClientRect will return zeros. Simply
* preserve the current window size, until the window is restored or
* maximized again.
*/
assert(width == 0 && height == 0);
return;
}
if(width != fb->width || height != fb->height) {
fb->must_resize = TRUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment