diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index 7236a9520..ad9f1b337 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -237,7 +237,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) fMultiWindow #endif )) { - DWORD dwWidth, dwHeight; + DWORD dwWidth = 0, dwHeight = 0; if (s_pScreenInfo->fMultipleMonitors) { /* resize to new virtual desktop size */ @@ -273,8 +273,9 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) */ /* Set screen size to match new size, if it is different to current */ - if ((s_pScreenInfo->dwWidth != dwWidth) || - (s_pScreenInfo->dwHeight != dwHeight)) { + if (((dwWidth != 0) && (dwHeight != 0)) && + ((s_pScreenInfo->dwWidth != dwWidth) || + (s_pScreenInfo->dwHeight != dwHeight))) { winDoRandRScreenSetSize(s_pScreen, dwWidth, dwHeight,