diff -ru xchat-gnome-0.26.1.orig//src/fe-gnome/main-window.c xchat-gnome-0.26.1/src/fe-gnome/main-window.c --- xchat-gnome-0.26.1.orig//src/fe-gnome/main-window.c 2011-02-20 23:33:37.037806173 -0700 +++ xchat-gnome-0.26.1/src/fe-gnome/main-window.c 2011-02-20 23:29:12.791378033 -0700 @@ -49,8 +49,10 @@ #include "../common/xchatc.h" #include "../common/outbound.h" #include "../common/fe.h" +#include "../common/xchat-plugin.h" +#include "../common/plugin.h" -static void on_main_window_close (GtkWidget *widget, GdkEvent *event, gpointer data); +static gboolean on_main_window_close (GtkWidget *widget, GdkEvent *event, gpointer data); static void on_pgup (GtkAccelGroup *accelgroup, GObject *arg1, guint arg2, GdkModifierType arg3, gpointer data); static void on_pgdn (GtkAccelGroup *accelgroup, GObject *arg1, guint arg2, GdkModifierType arg3, gpointer data); @@ -326,15 +331,23 @@ g_object_unref (client); } -static void +static gboolean on_main_window_close (GtkWidget *widget, GdkEvent *event, gpointer data) { + session *s = gui.current_session; + int r = plugin_emit_dummy_print (s, "Close Main"); + fprintf(stderr, "atrus: close-main-plugin-thing returned: %d. XCHAT_EAT_XCHAT is %d\n", r, XCHAT_EAT_XCHAT); + if (r & XCHAT_EAT_XCHAT) { + fprintf(stderr, "Ignoring close\n"); + return TRUE; + } save_main_window (); gui.quit = TRUE; gtk_widget_hide (GTK_WIDGET (gui.dcc)); userlist_gui_hide (); xchat_exit (); + return FALSE; } static void