summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/application.c19
-rw-r--r--src/window.c10
2 files changed, 14 insertions, 15 deletions
diff --git a/src/application.c b/src/application.c
index fcb0867..925ac02 100644
--- a/src/application.c
+++ b/src/application.c
@@ -30,6 +30,7 @@
#include <gtk/gtk.h>
#include <webkit2/webkit2.h>
+#include "accel-group.h"
#include "config/config.h"
#include "config/profiles.h"
#include "download.h"
@@ -39,13 +40,14 @@
#include "window.h"
struct MqApplication {
- GList *windows;
- GHashTable *tabs;
- gint64 last_tab_id;
- MqProfiles *profiles;
- MqConfig *config;
- gboolean marquee_mode;
- gchar *resources_dir;
+ GList *windows;
+ GHashTable *tabs;
+ gint64 last_tab_id;
+ MqProfiles *profiles;
+ MqConfig *config;
+ MqAccelGroup *accel_group;
+ gboolean marquee_mode;
+ gchar *resources_dir;
};
static void
@@ -91,6 +93,7 @@ mq_application_new(const gchar *profile)
mq_profiles_set_current(application->profiles, profile);
application->config = mq_profiles_get_current_config(
application->profiles);
+ application->accel_group = mq_accel_group_new(application->config);
application->windows = NULL;
application->tabs = g_hash_table_new_full(g_int64_hash, g_int64_equal,
@@ -246,6 +249,8 @@ mq_application_add_window(MqApplication *application, const gchar **uris)
MqWindow *window;
window = mq_window_new(application, uris);
+ gtk_window_add_accel_group(GTK_WINDOW(window),
+ GTK_ACCEL_GROUP(application->accel_group));
application->windows = g_list_prepend(application->windows, window);
diff --git a/src/window.c b/src/window.c
index 55b09d0..feebd7b 100644
--- a/src/window.c
+++ b/src/window.c
@@ -26,7 +26,6 @@
#include <glib.h>
#include <gtk/gtk.h>
-#include "accel-group.h"
#include "application.h"
#include "config/config.h"
#include "i18n.h"
@@ -194,9 +193,8 @@ set_title(MqWindow *window, const gchar *title)
static void
constructed(GObject *object)
{
- MqWindow *window;
- gsize i;
- MqAccelGroup *accel_group;
+ MqWindow *window;
+ gsize i;
window = MQ_WINDOW(object);
@@ -219,10 +217,6 @@ constructed(GObject *object)
FALSE);
}
- accel_group = mq_accel_group_new(window->config);
- gtk_window_add_accel_group(GTK_WINDOW(window),
- GTK_ACCEL_GROUP(accel_group));
-
gtk_widget_show_all(GTK_WIDGET(window));
}