From a4644cc58db3d2e96c81c7e7ef63561a661c7b04 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 22 Jul 2018 09:00:13 +0000 Subject: [PATCH] GTK: fix message dialogs not being responsive to buttons. --- src/platform/guigtk.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/platform/guigtk.cpp b/src/platform/guigtk.cpp index 207314b6..4a774ac2 100644 --- a/src/platform/guigtk.cpp +++ b/src/platform/guigtk.cpp @@ -1084,15 +1084,6 @@ public: Gtk::BUTTONS_NONE, /*modal=*/true) { SetTitle("Message"); - - gtkDialog.signal_response().connect([this](int gtkResponse) { - ProcessResponse(gtkResponse); - }); - gtkDialog.signal_hide().connect([this] { - auto it = std::remove(shownMessageDialogs.begin(), shownMessageDialogs.end(), - shared_from_this()); - shownMessageDialogs.erase(it); - }); } void SetType(Type type) override { @@ -1167,7 +1158,17 @@ public: } void ShowModal() override { + gtkDialog.signal_hide().connect([this] { + auto it = std::remove(shownMessageDialogs.begin(), shownMessageDialogs.end(), + shared_from_this()); + shownMessageDialogs.erase(it); + }); shownMessageDialogs.push_back(shared_from_this()); + + gtkDialog.signal_response().connect([this](int gtkResponse) { + gtkDialog.hide(); + ProcessResponse(gtkResponse); + }); gtkDialog.show(); }