From 06c2bb7c25a1612e8e98bdded498ecca4be359d0 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 8 Apr 2015 18:04:46 -0400 Subject: Fixed initial (and future) window redraw issues on Windows. --- new/container_windows.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'new/container_windows.c') diff --git a/new/container_windows.c b/new/container_windows.c index 2056653..20d7d8d 100644 --- a/new/container_windows.c +++ b/new/container_windows.c @@ -82,3 +82,19 @@ void resize(uiControl *control, HWND parent, RECT r) logLastError("error releasing DC in resize()"); (*(control->resize))(control, r.left, r.top, r.right - r.left, r.bottom - r.top, &d); } + +void updateParent(uintptr_t h) +{ + HWND hwnd; + RECT r; + + if (h == 0) // no parent + return; + hwnd = (HWND) h; + // 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()"); + // TODO invalidate rect? +} -- cgit v1.2.3