From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
jtomko@redhat.com, libvir-list@redhat.com,
Markus Armbruster <armbru@redhat.com>,
jpewhacker@gmail.com, Gerd Hoffmann <kraxel@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH v2 2/6] ui/gtk: implement show-cursor option
Date: Thu, 6 Feb 2020 12:29:04 +0100 [thread overview]
Message-ID: <20200206112908.5002-3-kraxel@redhat.com> (raw)
In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
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
next prev parent reply other threads:[~2020-02-06 11:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 11:29 [PATCH v2 0/6] ui: rework -show-cursor option Gerd Hoffmann
2020-02-06 11:29 ` [PATCH v2 1/6] ui: add show-cursor option Gerd Hoffmann
2020-02-06 12:14 ` Markus Armbruster
2020-02-06 11:29 ` Gerd Hoffmann [this message]
2020-02-06 11:29 ` [PATCH v2 3/6] ui/sdl: implement " Gerd Hoffmann
2020-02-06 11:29 ` [PATCH v2 4/6] ui/cocoa: " Gerd Hoffmann
2020-02-06 11:29 ` [PATCH v2 5/6] ui: wire up legacy -show-cursor option Gerd Hoffmann
2020-02-06 11:29 ` [PATCH v2 6/6] ui: deprecate " Gerd Hoffmann
2020-02-06 11:52 ` [PATCH v2 0/6] ui: rework " Peter Maydell
2020-02-06 13:20 ` Gerd Hoffmann
2020-02-06 14:39 ` Peter Maydell
2020-02-07 8:03 ` Erik Skultety
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200206112908.5002-3-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=armbru@redhat.com \
--cc=jpewhacker@gmail.com \
--cc=jtomko@redhat.com \
--cc=libvir-list@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).