From ea6883e9ba851db5e6557b1d71d1268f6ab25c64 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 2 Dec 2016 19:24:57 +0100 Subject: Make resize events fdo the right thing. Add move event. --- plugingui/nativewindow_win32.cc | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'plugingui/nativewindow_win32.cc') diff --git a/plugingui/nativewindow_win32.cc b/plugingui/nativewindow_win32.cc index 9e80be0..172850d 100644 --- a/plugingui/nativewindow_win32.cc +++ b/plugingui/nativewindow_win32.cc @@ -26,10 +26,10 @@ */ #include "nativewindow_win32.h" -#include "window.h" - #include +#include "window.h" + namespace GUI { LRESULT CALLBACK NativeWindowWin32::dialogProc(HWND hwnd, UINT msg, @@ -49,24 +49,20 @@ LRESULT CALLBACK NativeWindowWin32::dialogProc(HWND hwnd, UINT msg, switch(msg) { case WM_SIZE: { - static bool first = true; - if(!first) - { - auto resizeEvent = std::make_shared(); - resizeEvent->width = LOWORD(lp); - resizeEvent->height = HIWORD(lp); - native->event_queue.push(resizeEvent); - first = false; - } + auto resizeEvent = std::make_shared(); + resizeEvent->width = LOWORD(lp); + resizeEvent->height = HIWORD(lp); + //native->event_queue.push(resizeEvent); + native->window.resized(resizeEvent->width, resizeEvent->height); } break; case WM_MOVE: { -// auto moveEvent = std::make_shared(); -// moveEvent->x = (short)LOWORD(lp); -// moveEvent->y = (short)HIWORD(lp); -// native->event_queue.push(moveEvent); + auto moveEvent = std::make_shared(); + moveEvent->x = (short)LOWORD(lp); + moveEvent->y = (short)HIWORD(lp); + native->event_queue.push(moveEvent); } break; -- cgit v1.2.3