From: Gerd Hoffmann Date: Fri, 31 Jan 2020 10:54:48 +0000 (+0100) Subject: ui/gtk: implement show-cursor option X-Git-Tag: v5.0.0-rc0~97^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9cfca0b937d2b947e6a821436180f7bcea208f66;p=thirdparty%2Fqemu.git ui/gtk: implement show-cursor option When specified just set null_cursor to NULL so we get the default pointer instead of a blank pointer. Signed-off-by: Gerd Hoffmann Reviewed-by: Ján Tomko --- diff --git a/ui/gtk.c b/ui/gtk.c index 850c49bee02..f3f0af8921d 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -2246,8 +2246,12 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts) textdomain("qemu"); window_display = gtk_widget_get_display(s->window); - s->null_cursor = gdk_cursor_new_for_display(window_display, - GDK_BLANK_CURSOR); + if (s->opts->has_show_cursor && s->opts->show_cursor) { + s->null_cursor = NULL; /* default pointer */ + } else { + s->null_cursor = gdk_cursor_new_for_display(window_display, + GDK_BLANK_CURSOR); + } s->mouse_mode_notifier.notify = gd_mouse_mode_change; qemu_add_mouse_mode_change_notifier(&s->mouse_mode_notifier);