diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-06 22:42:16 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-06 22:42:16 (EDT) |
commit | 243da5ff85177f8731865f7a69343f662cfb1644 (patch) | |
tree | 685a899a8d434bd38b37d11522caea7b4d332189 | |
parent | 267f6675db90c97bdf603db8fa68d83c09a06954 (diff) | |
download | marquee-243da5ff85177f8731865f7a69343f662cfb1644.zip marquee-243da5ff85177f8731865f7a69343f662cfb1644.tar.gz marquee-243da5ff85177f8731865f7a69343f662cfb1644.tar.bz2 |
MqWindow: Set window.width and window.height on resize
-rw-r--r-- | src/window.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c index f3a10a3..8c756e9 100644 --- a/src/window.c +++ b/src/window.c @@ -37,6 +37,15 @@ is_maximized_cb(GtkWindow *window, } static void +configure_event_cb(GtkWindow __attribute__((unused)) *window, + GdkEventConfigure *event, MqConfig *config) +{ + mq_config_set_integer(config, "window.width", event->width); + mq_config_set_integer(config, "window.height", event->height); + mq_config_save(config); +} + +static void destroy_cb(GtkWidget __attribute__((unused)) *widget, MqWindow *window) { mq_application_delete_window(window->application, window); @@ -98,6 +107,8 @@ mq_window_new(MqApplication *application, const gchar **uris) mq_config_get_integer(config, "window.height")); g_signal_connect(window->window, "notify::is-maximized", G_CALLBACK(is_maximized_cb), config); + g_signal_connect(window->window, "configure-event", + G_CALLBACK(configure_event_cb), config); g_signal_connect(window->window, "destroy", G_CALLBACK(destroy_cb), window); |