Escape no longer escapes the gui2 dialog.

This caused the quit message to show when using escape in the message
dialog. (Fixes part 1 of bug #14458.)
This commit is contained in:
Mark de Wever 2009-10-09 20:21:27 +00:00
parent 32c7e6d15f
commit 1155ee1e3a
3 changed files with 18 additions and 1 deletions

View file

@ -104,6 +104,7 @@ static Uint32 timer_sdl_poll_events(Uint32, void*)
class thandler
: public events::handler
{
friend bool gui2::is_in_dialog();
public:
thandler();
@ -599,5 +600,10 @@ std::ostream& operator<<(std::ostream& stream, const tevent event)
} // namespace event
bool is_in_dialog()
{
return event::handler && !event::handler->dispatchers_.empty();
}
} // namespace gui2

View file

@ -200,6 +200,13 @@ std::ostream& operator<<(std::ostream& stream, const tevent event);
} // namespace event
/**
* Is a dialog open?
*
* @note added as backwards compatibility for gui::is_in_dialog.
*/
bool is_in_dialog();
} // namespace gui2
#endif

View file

@ -18,6 +18,7 @@
#include "display.hpp"
#include "gettext.hpp"
#include "gui/auxiliary/event/handler.hpp"
#include "help.hpp"
#include "log.hpp"
#include "marked-up_text.hpp"
@ -48,7 +49,10 @@ const int dialog_frame::title_border_h = 5;
bool in_dialog() { return is_in_dialog; }
bool in_dialog()
{
return is_in_dialog || gui2::is_in_dialog();
}
dialog_manager::dialog_manager() : cursor::setter(cursor::NORMAL), reset_to(is_in_dialog)
{