From 5aad0006b4cf04f3accd29912ca11312b65858dc Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 10 Mar 2013 13:46:53 +0100 Subject: Make sure we resize the window to the exact size requested (window size in win32 includes window decorations). --- plugingui/nativewindow_win32.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'plugingui/nativewindow_win32.cc') diff --git a/plugingui/nativewindow_win32.cc b/plugingui/nativewindow_win32.cc index b1e22c5..f7044db 100644 --- a/plugingui/nativewindow_win32.cc +++ b/plugingui/nativewindow_win32.cc @@ -98,8 +98,13 @@ GUI::NativeWindowWin32::~NativeWindowWin32() void GUI::NativeWindowWin32::resize(int width, int height) { - SetWindowPos(gctx->m_hwnd, NULL, -1, -1, (int)width, (int)height + 27, - SWP_NOMOVE); + SetWindowPos(gctx->m_hwnd, NULL, -1, -1, (int)width, (int)height, SWP_NOMOVE); + RECT r; + GetClientRect(gctx->m_hwnd, &r); + int w = width - r.right; + int h = height - r.bottom; + + SetWindowPos(gctx->m_hwnd, NULL, -1, -1, width + w, height + h, SWP_NOMOVE); } void GUI::NativeWindowWin32::move(int x, int y) -- cgit v1.2.3