From 08a33b8c13c53191353e70c9a7570621c75dc86d Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 20 Oct 2021 01:52:48 +0300 Subject: [PATCH 48/48] gtk: Destroy toplevel window on quit See osdn #43072 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.22/gui_main.c | 1 + client/gui-gtk-4.0/gtkcompat.h | 7 +++++++ client/gui-gtk-4.0/gui_main.c | 1 + 3 files changed, 9 insertions(+) diff --git a/client/gui-gtk-3.22/gui_main.c b/client/gui-gtk-3.22/gui_main.c index f2c16c4095..2a8392b1e7 100644 --- a/client/gui-gtk-3.22/gui_main.c +++ b/client/gui-gtk-3.22/gui_main.c @@ -1947,6 +1947,7 @@ void ui_main(int argc, char **argv) free_unit_table(); editgui_free(); gtk_widget_destroy(toplevel_tabs); + gtk_widget_destroy(toplevel); message_buffer = NULL; /* Result of destruction of everything */ tileset_free_tiles(tileset); } diff --git a/client/gui-gtk-4.0/gtkcompat.h b/client/gui-gtk-4.0/gtkcompat.h index b779082cb8..c41bac5361 100644 --- a/client/gui-gtk-4.0/gtkcompat.h +++ b/client/gui-gtk-4.0/gtkcompat.h @@ -54,6 +54,13 @@ void gtk_scrolled_window_set_has_frame(GtkScrolledWindow *wnd, bool shadow); #endif /* GTK version < 3.98.3 */ +#if !GTK_CHECK_VERSION(3,98,4) + +#define gtk_window_destroy(_wnd_) gtk_widget_destroy(_wnd_) + +#endif /* GTK version < 3.98.4 */ + + #if !GTK_CHECK_VERSION(3,99,0) /* Compatibility mode */ diff --git a/client/gui-gtk-4.0/gui_main.c b/client/gui-gtk-4.0/gui_main.c index d629e67576..3512c908d3 100644 --- a/client/gui-gtk-4.0/gui_main.c +++ b/client/gui-gtk-4.0/gui_main.c @@ -1787,6 +1787,7 @@ void ui_main(int argc, char **argv) free_unit_table(); editgui_free(); gtk_widget_destroy(toplevel_tabs); + gtk_window_destroy(toplevel); message_buffer = NULL; /* Result of destruction of everything */ tileset_free_tiles(tileset); } -- 2.33.0