From dbb7820cefed1b23de43eb5568e47fd7873b2189 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 20 Oct 2021 02:04:06 +0300 Subject: [PATCH 30/30] gtk: Destroy toplevel window on quit See osdn #43072 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.0/gui_main.c | 1 + client/gui-gtk-3.22/gui_main.c | 1 + client/gui-gtk-4.0/gtkcompat.h | 8 ++++++++ client/gui-gtk-4.0/gui_main.c | 1 + 4 files changed, 11 insertions(+) diff --git a/client/gui-gtk-3.0/gui_main.c b/client/gui-gtk-3.0/gui_main.c index 52a5b5edc0..39378f52a1 100644 --- a/client/gui-gtk-3.0/gui_main.c +++ b/client/gui-gtk-3.0/gui_main.c @@ -1840,6 +1840,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-3.22/gui_main.c b/client/gui-gtk-3.22/gui_main.c index d6cf524047..a3807e9eaa 100644 --- a/client/gui-gtk-3.22/gui_main.c +++ b/client/gui-gtk-3.22/gui_main.c @@ -1926,6 +1926,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..cd9d94f5a8 100644 --- a/client/gui-gtk-4.0/gtkcompat.h +++ b/client/gui-gtk-4.0/gtkcompat.h @@ -54,6 +54,14 @@ void gtk_scrolled_window_set_has_frame(GtkScrolledWindow *wnd, bool shadow); #endif /* GTK version < 3.98.3 */ +#if !GTK_CHECK_VERSION(3,98,4) +/* Compatibility mode */ + +#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 ddaa66ad89..d7ade04db5 100644 --- a/client/gui-gtk-4.0/gui_main.c +++ b/client/gui-gtk-4.0/gui_main.c @@ -1767,6 +1767,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