aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2014-03-12 08:33:50 +0100
committerGerd Hoffmann <kraxel@redhat.com>2014-03-17 14:33:55 +0100
commit881249c79292b6883ecf4bdb79c11cc7dbdb4878 (patch)
tree54e7b7a97908429b354a07f249f12959f863b5ed /ui
parentf4b11eee2f562c23b3efc33b96ba4542c9ca81aa (diff)
gtk: Allow to activate grab-on-hover from the command line
As long as we have no persistent GTK configuration, this allows to enable the useful grab-on-hover feature already when starting the VM. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> [ kraxel: fix warning with CONFIG_GTK=n ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index c3ac448e52..016804d3c2 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1438,7 +1438,7 @@ static const DisplayChangeListenerOps dcl_ops = {
.dpy_cursor_define = gd_cursor_define,
};
-void gtk_display_init(DisplayState *ds, bool full_screen)
+void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
{
GtkDisplayState *s = g_malloc0(sizeof(*s));
char *filename;
@@ -1517,6 +1517,9 @@ void gtk_display_init(DisplayState *ds, bool full_screen)
if (full_screen) {
gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item));
}
+ if (grab_on_hover) {
+ gtk_menu_item_activate(GTK_MENU_ITEM(s->grab_on_hover_item));
+ }
register_displaychangelistener(&s->dcl);