summary refs log tree commit diff stats
path: root/src/fe-gtk
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2014-05-27 03:07:03 -0400
committerTingPing <tingping@tingping.se>2014-05-27 03:07:03 -0400
commit0f6434986f576bf680e0231e0208bf0f977465e8 (patch)
treed13b3ec8e05670c8ddf76035efb959caa03b6b7c /src/fe-gtk
parentf43b7524e0b4444ce138f04a3d9bed9ee5f29926 (diff)
osx: Properly handle quitting
Diffstat (limited to 'src/fe-gtk')
-rw-r--r--src/fe-gtk/fe-gtk.c10
1 files changed, 10 insertions, 0 deletions
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 ();