diff --git a/gtk/Utils.cc b/gtk/Utils.cc index 0395ddf4b..e8b20ab43 100644 --- a/gtk/Utils.cc +++ b/gtk/Utils.cc @@ -655,6 +655,13 @@ void gtr_widget_set_visible(Gtk::Widget& widget, bool is_visible) for (auto* const top_level_window : Gtk::Window::list_toplevels()) { +#if !GTKMM_CHECK_VERSION(4, 0, 0) + if (top_level_window->get_window_type() != Gtk::WINDOW_TOPLEVEL) + { + continue; + } +#endif + if (top_level_window->get_transient_for() != window || top_level_window->get_visible() == is_visible) { continue;