From d98bd419b419be1d5069c0fe77fa2a7b6379e45f Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 2 Apr 2005 21:30:01 +0000 Subject: Work around Guichan focussing bug. --- src/configuration.cpp | 4 ++-- src/gui/gui.cpp | 9 +++++++++ src/gui/gui.h | 5 +++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/configuration.cpp b/src/configuration.cpp index dbf44baf..b73e9427 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -145,7 +145,7 @@ std::string Configuration::getValue(const std::string &key, std::string deflt) { std::map::iterator iter = options.find(key); if (iter != options.end()) { - return options[key]; + return (*iter).second; } return deflt; } @@ -154,7 +154,7 @@ float Configuration::getValue(const std::string &key, float deflt) { std::map::iterator iter = options.find(key); if (iter != options.end()) { - return atof(options[key].c_str()); + return atof((*iter).second.c_str()); } return deflt; } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 899ae374..943584ce 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -80,6 +80,15 @@ Gui::~Gui() delete guiInput; } +void Gui::logic() +{ + gcn::Gui::logic(); + + // Work around Guichan bug of only applying focus on mouse or keyboard + // events. + mFocusHandler->applyChanges(); +} + void Gui::draw() { guiGraphics->pushClipArea(guiTop->getDimension()); diff --git a/src/gui/gui.h b/src/gui/gui.h index 5051b788..66f7cb0f 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -51,6 +51,11 @@ class Gui : public gcn::Gui, public gcn::MouseListener */ ~Gui(); + /** + * Works around Guichan bug + */ + void logic(); + /** * Draws the whole Gui by calling draw functions down in the * Gui hierarchy. It also draws the mouse pointer. -- cgit v1.2.3-70-g09d2