summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-03-10 13:46:53 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2013-03-10 13:46:53 +0100
commit5aad0006b4cf04f3accd29912ca11312b65858dc (patch)
treed87e0596bd30ab00c9c6fbb6bcd0c668efee1409 /plugingui
parent275780d3edd1772537822b607cc60875cc9f98f6 (diff)
Make sure we resize the window to the exact size requested (window size in win32 includes window decorations).
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/nativewindow_win32.cc9
1 files changed, 7 insertions, 2 deletions
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)