wfreerdp: WM_SIZE: only update canvas diff if window size is bigger than 0
authorerbth <t.erbesdobler@team103.com>
Mon, 25 Aug 2014 13:24:04 +0000 (15:24 +0200)
committererbth <t.erbesdobler@team103.com>
Mon, 25 Aug 2014 13:24:04 +0000 (15:24 +0200)
client/Windows/wf_event.c

index 1f2c9c8..941ff52 100644 (file)
@@ -284,11 +284,14 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
                                        wfc->client_y = windowRect.top;
                                }
                                
-                               wf_size_scrollbars(wfc, LOWORD(lParam), HIWORD(lParam));
+                               if (wfc->client_width && wfc->client_height)
+                               {
+                                       wf_size_scrollbars(wfc, LOWORD(lParam), HIWORD(lParam));
 
-                               // Workaround: when the window is maximized, the call to "ShowScrollBars" returns TRUE but has no effect.
-                               if (wParam == SIZE_MAXIMIZED && !wfc->fullscreen)
-                                       SetWindowPos(wfc->hwnd, HWND_TOP, 0, 0, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, SWP_NOMOVE | SWP_FRAMECHANGED);
+                                       // Workaround: when the window is maximized, the call to "ShowScrollBars" returns TRUE but has no effect.
+                                       if (wParam == SIZE_MAXIMIZED && !wfc->fullscreen)
+                                               SetWindowPos(wfc->hwnd, HWND_TOP, 0, 0, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, SWP_NOMOVE | SWP_FRAMECHANGED);
+                               }
 
                                break;