summaryrefslogtreecommitdiff
path: root/plugingui/nativewindow_win32.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-11-29 09:32:52 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2015-11-29 09:32:52 +0100
commitf59d2329c904e8cb5f6509050444bf2aee4b8f65 (patch)
treec1e2ed264664c030d96399016221072e9dabfc8e /plugingui/nativewindow_win32.cc
parent77cd0b84e1cef83a4fa9b77663cea65b42355f7a (diff)
Move event skip optimization fromNativeWindowXYZ to EventHandler
Diffstat (limited to 'plugingui/nativewindow_win32.cc')
-rw-r--r--plugingui/nativewindow_win32.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/plugingui/nativewindow_win32.cc b/plugingui/nativewindow_win32.cc
index 9f8936f..72e0598 100644
--- a/plugingui/nativewindow_win32.cc
+++ b/plugingui/nativewindow_win32.cc
@@ -411,7 +411,7 @@ void NativeWindowWin32::grabMouse(bool grab)
bool NativeWindowWin32::hasEvent()
{
MSG msg;
- return PeekMessage(&msg, nullptr, 0, 0, 0) != 0;
+ return PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE) != 0;
}
Event* NativeWindowWin32::getNextEvent()
@@ -431,4 +431,21 @@ Event* NativeWindowWin32::getNextEvent()
return event;
}
+Event* NativeWindowWin32::peekNextEvent()
+{
+ Event* event = nullptr;
+
+ MSG msg;
+ if(PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+
+ event = this->event;
+ this->event = nullptr;
+
+ return event;
+}
+
} // GUI::