From c8ac922256709e51674a67195f9bdc270f9fc261 Mon Sep 17 00:00:00 2001 From: Tametomo Date: Wed, 24 Jun 2009 08:46:46 -0600 Subject: Release modal mouse focus in DropDowns when focus is lost. If not released, this can cause the user to think that the client has frozen up when dialogs such as the quit dialog take modal focus. Signed-off-by: Tametomo --- src/gui/widgets/dropdown.cpp | 6 ++++++ src/gui/widgets/dropdown.h | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index c45dc226..8b36f19f 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -234,6 +234,12 @@ void DropDown::keyPressed(gcn::KeyEvent& keyEvent) } } +void DropDown::focusLost(const gcn::Event& event) +{ + gcn::DropDown::focusLost(event); + releaseModalMouseInputFocus(); +} + void DropDown::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) { setSelected(getSelected() - 1); diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index 568e20a5..15c52767 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -58,6 +58,10 @@ class DropDown : public gcn::DropDown void drawFrame(gcn::Graphics *graphics); + // Inherited from FocusListener + + void focusLost(const gcn::Event& event); + // Inherited from KeyListener void keyPressed(gcn::KeyEvent& keyEvent); -- cgit v1.2.3-70-g09d2