From a2d785e22a995e1f688bef03f0efb096922246f2 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 8 Apr 2015 20:53:34 -0400 Subject: [PATCH] "Fixed" initial Windows window shows for now (see previous commit). Not yet a clean fix; need to test some things on real Windows first. --- container_windows.c | 3 +++ uipriv_windows.h | 1 + window_windows.c | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/container_windows.c b/container_windows.c index d56830ec..27f01d26 100644 --- a/container_windows.c +++ b/container_windows.c @@ -94,10 +94,13 @@ void updateParent(uintptr_t h) if (h == 0) // no parent return; hwnd = (HWND) h; +/*TODO // TODO is there a better way? if (GetWindowRect(hwnd, &r) == 0) logLastError("error getting window rect for dummy move in updateParent()"); if (MoveWindow(hwnd, r.left, r.top, r.right - r.left, r.bottom - r.top, TRUE) == 0) logLastError("error moving window in updateParent()"); +*/ + SendMessageW(hwnd, msgUpdateChild, 0, 0); // TODO invalidate rect? } diff --git a/uipriv_windows.h b/uipriv_windows.h index bc8890a3..7f5f8c8d 100644 --- a/uipriv_windows.h +++ b/uipriv_windows.h @@ -33,6 +33,7 @@ enum { // redirected WM_COMMAND and WM_NOTIFY msgCOMMAND = WM_APP + 0x40, // start offset just to be safe msgNOTIFY, + msgUpdateChild, // fake because wine (only? TODO) seems to SWP_NOSIZE MoveWindow()s and SetWindowPos()s that don't change the window size (even if SWP_NOSIZE isn't specified) }; // debug_windows.c diff --git a/window_windows.c b/window_windows.c index 881173d6..88e7aaee 100644 --- a/window_windows.c +++ b/window_windows.c @@ -30,10 +30,12 @@ static LRESULT CALLBACK uiWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPA return lResult; switch (uMsg) { case WM_WINDOWPOSCHANGED: - if (w->child == NULL) - break; if ((wp->flags & SWP_NOSIZE) != 0) break; + // fall through + case msgUpdateChild: + if (w->child == NULL) + break; if (GetClientRect(w->hwnd, &r) == 0) logLastError("error getting window client rect for resize in uiWindowWndProc()"); resize(w->child, w->hwnd, r);