summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-04-02 20:35:34 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2017-04-02 20:35:34 +0200
commit07205d12ab39a05274249a0628bb1ec0c2094383 (patch)
treedc11cec3bf35f1aeb62cbab4b62ca775fafe9202
parent3439a3a8423913a2b33c564bed87a2812ab16e6f (diff)
Fix missing win32 initial size when embedded in prent window - part 2.
-rw-r--r--plugingui/nativewindow_win32.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugingui/nativewindow_win32.cc b/plugingui/nativewindow_win32.cc
index 5ee912b..502bfe9 100644
--- a/plugingui/nativewindow_win32.cc
+++ b/plugingui/nativewindow_win32.cc
@@ -377,8 +377,12 @@ NativeWindowWin32::NativeWindowWin32(void* native_window, Window& window)
// Resize newly created window to fit into parent.
RECT rect;
GetClientRect(parent_window, &rect);
- resize(rect.right - rect.left, rect.bottom - rect.top);
+ // Hack to make sure we scale the child and not simply the parent (again).
+ auto tmp = parent_window;
+ parent_window = nullptr;
+ resize(rect.right - rect.left, rect.bottom - rect.top);
+ parent_window = tmp;
}
}