[PATCH v3 5/7] ui/gtk: implement show-cursor option

Gerd Hoffmann kraxel at redhat.com
Fri Feb 7 10:17:51 UTC 2020


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 at redhat.com>
---
 ui/gtk.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index d18892d1de61..a685d1ae0848 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2243,8 +2243,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);
-- 
2.18.1




More information about the libvir-list mailing list