summaryrefslogtreecommitdiff
path: root/plugingui/eventhandler.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/eventhandler.cc
parentb2f7b6be4c6695fa741f2eafaef3af5bce5c30c2 (diff)
Make resize events fdo the right thing. Add move event.
Diffstat (limited to 'plugingui/eventhandler.cc')
-rw-r--r--plugingui/eventhandler.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugingui/eventhandler.cc b/plugingui/eventhandler.cc
index 083efae..a5249a6 100644
--- a/plugingui/eventhandler.cc
+++ b/plugingui/eventhandler.cc
@@ -55,10 +55,10 @@ std::shared_ptr<Event> EventHandler::peekNextEvent()
void EventHandler::processEvents()
{
+ Painter p(window); // Make sure we only redraw buffer one time.
+
while(hasEvent())
{
- Painter p(window); // Make sure we only redraw buffer one time.
-
auto event = getNextEvent();
if(event == nullptr)
@@ -71,6 +71,13 @@ void EventHandler::processEvents()
window.redraw();
break;
+ case EventType::move:
+ {
+ auto moveEvent = static_cast<MoveEvent*>(event.get());
+ window.moved(moveEvent->x, moveEvent->y);
+ }
+ break;
+
case EventType::resize:
{
while(true)