aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-05-11 01:07:39 +0200
committerGerd Hoffmann <kraxel@redhat.com>2018-05-15 10:47:01 +0200
commit677b490501823c1cb6946d8bb9e7907c12cd0c71 (patch)
tree65c9d61335c5b3f49ac06223f393215b0d8845fa /ui
parentcd6cd8fa0da7839b11ca7e5d7d45b73810394395 (diff)
gtk: disable the F10 menubar key
The F10 key is used in various applications, disable it unconditionally (do not limit it to grab mode). Note that this property is deprecated and might be removed in the future (GTK+ commit b082fb598d). Fixes: https://bugs.launchpad.net/qemu/+bug/1726910 Signed-off-by: Peter Wu <peter@lekensteyn.nl> Message-id: 20180510230739.28459-2-peter@lekensteyn.nl Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index ef6ca7179e..dbce970dc4 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2321,6 +2321,8 @@ static GtkWidget *gd_create_menu_view(GtkDisplayState *s)
static void gd_create_menus(GtkDisplayState *s)
{
+ GtkSettings *settings;
+
s->accel_group = gtk_accel_group_new();
s->machine_menu = gd_create_menu_machine(s);
s->view_menu = gd_create_menu_view(s);
@@ -2336,6 +2338,10 @@ static void gd_create_menus(GtkDisplayState *s)
g_object_set_data(G_OBJECT(s->window), "accel_group", s->accel_group);
gtk_window_add_accel_group(GTK_WINDOW(s->window), s->accel_group);
+
+ /* Disable the default "F10" menu shortcut. */
+ settings = gtk_widget_get_settings(s->window);
+ g_object_set(G_OBJECT(settings), "gtk-menu-bar-accel", "", NULL);
}