GTK: fix message dialogs not being responsive to buttons.

pull/348/head
whitequark 2018-07-22 09:00:13 +00:00
parent 8426992f27
commit a4644cc58d
1 changed files with 10 additions and 9 deletions

View File

@ -1084,15 +1084,6 @@ public:
Gtk::BUTTONS_NONE, /*modal=*/true) Gtk::BUTTONS_NONE, /*modal=*/true)
{ {
SetTitle("Message"); 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 { void SetType(Type type) override {
@ -1167,7 +1158,17 @@ public:
} }
void ShowModal() override { 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()); shownMessageDialogs.push_back(shared_from_this());
gtkDialog.signal_response().connect([this](int gtkResponse) {
gtkDialog.hide();
ProcessResponse(gtkResponse);
});
gtkDialog.show(); gtkDialog.show();
} }