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:
parent
32c7e6d15f
commit
1155ee1e3a
3 changed files with 18 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue