summaryrefslogtreecommitdiff
path: root/plugingui/nativewindow_win32.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-12-02 19:24:57 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2017-01-21 14:51:32 +0100
commitea6883e9ba851db5e6557b1d71d1268f6ab25c64 (patch)
tree7bc0778d2b42a4040552fb44b4b7c011b5f09989 /plugingui/nativewindow_win32.cc
parentb2f7b6be4c6695fa741f2eafaef3af5bce5c30c2 (diff)
Make resize events fdo the right thing. Add move event.
Diffstat (limited to 'plugingui/nativewindow_win32.cc')
-rw-r--r--plugingui/nativewindow_win32.cc26
1 files changed, 11 insertions, 15 deletions
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 <cstring>
+#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>();
- resizeEvent->width = LOWORD(lp);
- resizeEvent->height = HIWORD(lp);
- native->event_queue.push(resizeEvent);
- first = false;
- }
+ auto resizeEvent = std::make_shared<ResizeEvent>();
+ 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>();
-// moveEvent->x = (short)LOWORD(lp);
-// moveEvent->y = (short)HIWORD(lp);
-// native->event_queue.push(moveEvent);
+ auto moveEvent = std::make_shared<MoveEvent>();
+ moveEvent->x = (short)LOWORD(lp);
+ moveEvent->y = (short)HIWORD(lp);
+ native->event_queue.push(moveEvent);
}
break;