From 28ebf0ef8595715158b840c6213315efa634bfbd Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 29 Sep 2017 01:18:06 -0400 Subject: MqApplication: Save list of windows --- (limited to 'src') 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 * -- cgit v0.9.1