diff mbox series

[PULL,07/10] ui/gtk: implement show-cursor option

Message ID 20200212161835.28576-8-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series [PULL,01/10] ui/gtk: Update gd_refresh_rate_millihz() to handle VirtualConsole | expand

Commit Message

Gerd Hoffmann Feb. 12, 2020, 4:18 p.m. UTC
When specified just set null_cursor to NULL so we get the default
pointer instead of a blank pointer.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 ui/gtk.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/ui/gtk.c b/ui/gtk.c
index 850c49bee02a..f3f0af8921d9 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);