summaryrefslogtreecommitdiff
path: root/endless/eoswindow.c
diff options
context:
space:
mode:
Diffstat (limited to 'endless/eoswindow.c')
-rw-r--r--endless/eoswindow.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/endless/eoswindow.c b/endless/eoswindow.c
index 84d8434..1e963f4 100644
--- a/endless/eoswindow.c
+++ b/endless/eoswindow.c
@@ -510,6 +510,15 @@ eos_window_forall (GtkContainer *container,
callback_data);
}
+/* Our default delete event handler destroys the window. */
+static gboolean
+eos_window_default_delete (GtkWidget* window,
+ gpointer user_data)
+{
+ gtk_widget_destroy (GTK_WIDGET (window));
+ return FALSE;
+}
+
static void
eos_window_class_init (EosWindowClass *klass)
{
@@ -531,6 +540,7 @@ eos_window_class_init (EosWindowClass *klass)
widget_class->unmap = eos_window_unmap;
widget_class->show = eos_window_show;
container_class->forall = eos_window_forall;
+ widget_class->delete_event = eos_window_default_delete;
/**
* EosWindow:application:
@@ -575,7 +585,10 @@ on_close_clicked_cb (GtkWidget* top_bar,
{
if (user_data != NULL)
{
- gtk_widget_destroy (GTK_WIDGET (user_data));
+ // We don't actually care about the return value, the default "delete-event" handler
+ // will take care of closing windows for us
+ gboolean dummy = FALSE;
+ g_signal_emit_by_name (G_OBJECT (user_data), "delete-event", NULL, &dummy);
}
}