summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-04-11 21:42:02 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2017-04-11 22:33:36 +0200
commit21c0b85b57c68d591108d5f8efc1c2247c05c74f (patch)
tree3ac1431dd4d15b9deb2cf690eab3c2cd9b591526 /plugingui
parent50f7827f48cd8b16415667d040486d40bf6778cb (diff)
Only make window decoration compensation if window has no parent (ie. actually is a window and not just an embbedded widget).
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/nativewindow_win32.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/plugingui/nativewindow_win32.cc b/plugingui/nativewindow_win32.cc
index c166d04..01a2fa8 100644
--- a/plugingui/nativewindow_win32.cc
+++ b/plugingui/nativewindow_win32.cc
@@ -408,15 +408,21 @@ void NativeWindowWin32::setFixedSize(std::size_t width, std::size_t height)
void NativeWindowWin32::resize(std::size_t width, std::size_t height)
{
auto hwnd = m_hwnd;
- if(parent_window)
- {
- hwnd = parent_window;
- }
+ //if(parent_window)
+ //{
+ // hwnd = parent_window;
+ //}
+
+ // Set requested size on the window (or parent)
SetWindowPos(hwnd, nullptr, -1, -1, (int)width, (int)height, SWP_NOMOVE);
+
+ // Ask the client window what size it actually got
RECT rect;
- GetClientRect(hwnd, &rect);
+ GetClientRect(m_hwnd, &rect);
int w = width - rect.right;
int h = height - rect.bottom;
+
+ // Set the compensated size on the window (or parent)
SetWindowPos(hwnd, nullptr, -1, -1, width + w, height + h, SWP_NOMOVE);
}