diff --git a/src/selectiondialog.cc b/src/selectiondialog.cc index 9965b98..8b73072 100644 --- a/src/selectiondialog.cc +++ b/src/selectiondialog.cc @@ -64,6 +64,7 @@ void SelectionDialogBase::add_row(const std::string& row, const std::string& too } void SelectionDialogBase::show() { + shown=true; move(); window->show_all(); } @@ -72,8 +73,9 @@ void SelectionDialogBase::hide() { window->hide(); if(tooltips) tooltips->hide(); - if(on_hide) + if(on_hide && shown) on_hide(); + shown=false; } void SelectionDialogBase::update_tooltips() { diff --git a/src/selectiondialog.h b/src/selectiondialog.h index abdd59b..e454a3c 100644 --- a/src/selectiondialog.h +++ b/src/selectiondialog.h @@ -31,6 +31,8 @@ protected: std::unique_ptr tooltips; std::unordered_map tooltip_texts; std::string last_row; +private: + bool shown=false; }; class SelectionDialog : public SelectionDialogBase {