From e9636ea5f1077d86a98e2dfb777d6f27edaa7fc8 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Thu, 13 Oct 2016 14:45:00 +0300 Subject: [PATCH] don't resize window if app is minimized - to fix dlangide#181 --- src/dlangui/platforms/windows/winapp.d | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/dlangui/platforms/windows/winapp.d b/src/dlangui/platforms/windows/winapp.d index 7e750c7e..32e75836 100644 --- a/src/dlangui/platforms/windows/winapp.d +++ b/src/dlangui/platforms/windows/winapp.d @@ -1309,15 +1309,14 @@ LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) WINDOWPOS * pos = cast(WINDOWPOS*)lParam; Log.d("WM_WINDOWPOSCHANGED: ", *pos); GetClientRect(hwnd, &rect); - //window.onResize(pos.cx, pos.cy); - //if (!(pos.flags & 0x8000)) { //SWP_NOACTIVATE)) { - //if (pos.x > -30000) { + if (pos.x > -30000) {// to ignore minimized state int dx = rect.right - rect.left; int dy = rect.bottom - rect.top; - window.onResize(dx, dy); - InvalidateRect(hwnd, null, FALSE); - //} - //} + if (window.width != dx || window.height != dy) { + window.onResize(dx, dy); + InvalidateRect(hwnd, null, FALSE); + } + } } } return 0;