summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-29 01:18:06 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-29 01:18:06 (EDT)
commit28ebf0ef8595715158b840c6213315efa634bfbd (patch)
treeeaeb26c199d36bd2b7822abeb3a737075fe4d41a /src
parentaaf715fbdc5801d7cb470383224c2e4f076c471a (diff)
downloadmarquee-28ebf0ef8595715158b840c6213315efa634bfbd.zip
marquee-28ebf0ef8595715158b840c6213315efa634bfbd.tar.gz
marquee-28ebf0ef8595715158b840c6213315efa634bfbd.tar.bz2
MqApplication: Save list of windows
Diffstat (limited to 'src')
-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 *