summaryrefslogtreecommitdiff
path: root/plugingui/eventhandler.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-09-27 20:16:12 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-09-27 20:16:12 +0200
commita5d271dd8f3c2726aa42929c923704f98ad37010 (patch)
treee4a30dd1c425903060ac60d360b81c8f123f3213 /plugingui/eventhandler.cc
parentf26b9cb7418917b3ecc7fec877e11eedcb7fefa9 (diff)
Optimise repaint events greatly improving GUI responsiveness.
Diffstat (limited to 'plugingui/eventhandler.cc')
-rw-r--r--plugingui/eventhandler.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugingui/eventhandler.cc b/plugingui/eventhandler.cc
index 7eae827..cec5fab 100644
--- a/plugingui/eventhandler.cc
+++ b/plugingui/eventhandler.cc
@@ -27,6 +27,7 @@
#include "eventhandler.h"
#include "window.h"
+#include "painter.h"
GUI::EventHandler::EventHandler(GUI::NativeWindow *n, GUI::Window *w)
{
@@ -56,6 +57,8 @@ void GUI::EventHandler::registerCloseHandler(void (*handler)(void *), void *ptr)
void GUI::EventHandler::processEvents()
{
while(hasEvent()) {
+ Painter p(window); // Make sure we only redraw buffer one time.
+
Event *event = getNextEvent();
if(event == NULL) continue;
@@ -72,7 +75,7 @@ void GUI::EventHandler::processEvents()
ResizeEvent *re = (ResizeEvent*)event;
if(re->width != window->width() || re->height != window->height()) {
window->resized(re->width, re->height);
- window->repaint_r(NULL);
+ //window->repaint_r(NULL);
}
}
break;