Skip to content

Commit

Permalink
ui/gtk: implement show-cursor option
Browse files Browse the repository at this point in the history
When specified just set null_cursor to NULL so we get the default
pointer instead of a blank pointer.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Ján Tomko <[email protected]>
  • Loading branch information
kraxel committed Feb 12, 2020
1 parent 3487da6 commit 9cfca0b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/gtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9cfca0b

Please sign in to comment.