From 0f6434986f576bf680e0231e0208bf0f977465e8 Mon Sep 17 00:00:00 2001 From: TingPing Date: Tue, 27 May 2014 03:07:03 -0400 Subject: osx: Properly handle quitting --- src/fe-gtk/fe-gtk.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index 35aff3b2..5df37779 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -300,11 +300,21 @@ fe_init (void) input_style = create_input_style (gtk_style_new ()); } +#ifdef HAVE_GTK_MAC +static void +gtkosx_application_terminate (GtkosxApplication *app, gpointer userdata) +{ + hexchat_exit(); +} +#endif + void fe_main (void) { #ifdef HAVE_GTK_MAC gtkosx_application_ready(osx_app); + g_signal_connect (G_OBJECT(osx_app), "NSApplicationWillTerminate", + G_CALLBACK(gtkosx_application_terminate), NULL); #endif gtk_main (); -- cgit 1.4.1