From 8b58bbab8ee810d99d7e2653f7d86fc8dd3f48d6 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 1 Oct 2013 17:20:39 +0200 Subject: Make sure we redraw if GUI is changed by engine event. --- plugingui/plugingui.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugingui/plugingui.cc b/plugingui/plugingui.cc index a4f99d7..4f16b34 100644 --- a/plugingui/plugingui.cc +++ b/plugingui/plugingui.cc @@ -188,6 +188,8 @@ void PluginGUI::stopThread() void PluginGUI::handleMessage(Message *msg) { + GUI::Painter p(window);// Make sure we only redraw buffer one time. + switch(msg->type()) { case Message::LoadStatus: { @@ -248,14 +250,14 @@ void PluginGUI::thread_main() msghandler.sendMessage(MSGRCV_ENGINE, msg); } - while(1) { + while(running) { #ifdef WIN32 SleepEx(50, FALSE); #else usleep(50000); #endif/*WIN32*/ - if(!running) break; + // DEBUG(gui, "loop"); window->eventHandler()->processEvents(); handleMessages(); -- cgit v1.2.3