summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/application.c3
-rw-r--r--src/application.h2
-rw-r--r--src/window.c8
3 files changed, 9 insertions, 4 deletions
diff --git a/src/application.c b/src/application.c
index 43a236a..b3a5f33 100644
--- a/src/application.c
+++ b/src/application.c
@@ -63,8 +63,7 @@ mq_application_add_window(MqApplication *application, const gchar **uris)
}
void
-mq_application_delete_window(GtkWidget __attribute__((unused)) *window,
- MqApplication *application)
+mq_application_delete_window(MqApplication *application, MqWindow *window)
{
if (--application->window_count == 0) {
gtk_main_quit();
diff --git a/src/application.h b/src/application.h
index 2cfebf0..e6267f9 100644
--- a/src/application.h
+++ b/src/application.h
@@ -42,6 +42,6 @@ MqWindow *
mq_application_add_window(MqApplication *application, const gchar **uris);
void
-mq_application_delete_window(GtkWidget *window, MqApplication *application);
+mq_application_delete_window(MqApplication *application, MqWindow *window);
#endif
diff --git a/src/window.c b/src/window.c
index 15230ba..7244f1e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -28,6 +28,12 @@
#include "tab.h"
static void
+destroy_cb(GtkWidget __attribute__((unused)) *widget, MqWindow *window)
+{
+ mq_application_delete_window(window->application, window);
+}
+
+static void
set_title(MqWindow *window, const gchar *title)
{
gchar *window_title;
@@ -73,7 +79,7 @@ mq_window_new(MqApplication *application, const gchar **uris)
window->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(window->window), 1024, 768);
g_signal_connect(window->window, "destroy",
- G_CALLBACK(mq_application_delete_window), application);
+ G_CALLBACK(destroy_cb), window);
window->notebook = gtk_notebook_new();
gtk_notebook_set_scrollable(GTK_NOTEBOOK(window->notebook), TRUE);