[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/5] ui/gtk: implement show-cursor option
From: |
Gerd Hoffmann |
Subject: |
[PATCH 2/5] ui/gtk: implement show-cursor option |
Date: |
Wed, 5 Feb 2020 12:03:53 +0100 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/gtk.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ui/gtk.c b/ui/gtk.c
index d18892d1de61..78b197ade4c1 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -247,6 +247,7 @@ static void gd_update_cursor(VirtualConsole *vc)
{
GtkDisplayState *s = vc->s;
GdkWindow *window;
+ bool allow_hide_cursor = true;
if (vc->type != GD_VC_GFX ||
!qemu_console_is_graphic(vc->gfx.dcl.con)) {
@@ -257,8 +258,13 @@ static void gd_update_cursor(VirtualConsole *vc)
return;
}
+ if (s->opts->has_show_cursor && s->opts->show_cursor) {
+ allow_hide_cursor = false;
+ }
+
window = gtk_widget_get_window(GTK_WIDGET(vc->gfx.drawing_area));
- if (s->full_screen || qemu_input_is_absolute() || s->ptr_owner == vc) {
+ if (allow_hide_cursor &&
+ (s->full_screen || qemu_input_is_absolute() || s->ptr_owner == vc)) {
gdk_window_set_cursor(window, s->null_cursor);
} else {
gdk_window_set_cursor(window, NULL);
--
2.18.1