aboutsummaryrefslogtreecommitdiff
path: root/ui/gtk.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-01-31 11:54:48 +0100
committerGerd Hoffmann <kraxel@redhat.com>2020-02-12 13:25:17 +0100
commit9cfca0b937d2b947e6a821436180f7bcea208f66 (patch)
tree09a7c87f5bc2ddce67ba1a170ec926bc2ab82ef4 /ui/gtk.c
parent3487da6aeb127407f4f0bf5f683c90fe5c34d6c5 (diff)
downloadqemu-9cfca0b937d2b947e6a821436180f7bcea208f66.zip
qemu-9cfca0b937d2b947e6a821436180f7bcea208f66.tar.gz
qemu-9cfca0b937d2b947e6a821436180f7bcea208f66.tar.bz2
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 <kraxel@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
Diffstat (limited to 'ui/gtk.c')
-rw-r--r--ui/gtk.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index 850c49b..f3f0af8 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);