summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/application.c7
-rw-r--r--src/application.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/application.c b/src/application.c
index b3a5f33..d4fa802 100644
--- a/src/application.c
+++ b/src/application.c
@@ -34,7 +34,7 @@ mq_application_new(gchar __attribute__((unused)) *profile,
MqApplication *application;
application = malloc(sizeof(*application));
- application->window_count = 0;
+ application->windows = NULL;
webkit_web_context_set_favicon_database_directory(
webkit_web_context_get_default(), NULL);
@@ -57,7 +57,7 @@ mq_application_add_window(MqApplication *application, const gchar **uris)
window = mq_window_new(application, uris);
- ++application->window_count;
+ application->windows = g_list_prepend(application->windows, window);
return window;
}
@@ -65,7 +65,8 @@ mq_application_add_window(MqApplication *application, const gchar **uris)
void
mq_application_delete_window(MqApplication *application, MqWindow *window)
{
- if (--application->window_count == 0) {
+ application->windows = g_list_remove(application->windows, window);
+ if (!application->windows) {
gtk_main_quit();
}
}
diff --git a/src/application.h b/src/application.h
index e6267f9..a4b373c 100644
--- a/src/application.h
+++ b/src/application.h
@@ -29,7 +29,7 @@ typedef struct MqApplication MqApplication;
#include "window.h"
struct MqApplication {
- guint window_count;
+ GList *windows;
};
MqApplication *