qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "andrzej zaborowski" <balrog@zabor.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] -show-cursor switch to inhibit SDL hiding cursor.
Date: Fri, 16 Mar 2007 23:10:13 +0100	[thread overview]
Message-ID: <fb249edb0703161510ved771e1s4b109003c774ffbc@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

Systems with touchscreens usually don't display a cursor (in fact they
can't know where the stylus is if it's not touching the screen in this
moment) so it makes sense to not hide the host's mouse cursor even
when grabbed. Only SDL.

Cheers,
Andrew

[-- Attachment #2: 0016-show-cursor-switch-to-inhibit-SDL-hiding-cursor.txt --]
[-- Type: text/plain, Size: 2437 bytes --]

From e0111f822059b9905e842bb1d29e7c6fa8c65a8e Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <balrog@zabor.org>
Date: Fri, 16 Mar 2007 17:28:44 +0100
Subject: [PATCH] -show-cursor switch to inhibit SDL hiding cursor.

---
 sdl.c |    6 ++++++
 vl.c  |    6 ++++++
 vl.h  |    1 +
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/sdl.c b/sdl.c
index 0cb2241..1330df4 100644
--- a/sdl.c
+++ b/sdl.c
@@ -228,6 +228,9 @@ static void sdl_update_caption(void)
 
 static void sdl_hide_cursor(void)
 {
+    if (!cursor_hide)
+        return;
+
     if (kbd_mouse_is_absolute()) {
         SDL_ShowCursor(1);
         SDL_SetCursor(sdl_cursor_hidden);
@@ -238,6 +241,9 @@ static void sdl_hide_cursor(void)
 
 static void sdl_show_cursor(void)
 {
+    if (!cursor_hide)
+        return;
+
     if (!kbd_mouse_is_absolute()) {
         SDL_ShowCursor(1);
         SDL_SetCursor(sdl_cursor_normal);
diff --git a/vl.c b/vl.c
index 94260b4..292c677 100644
--- a/vl.c
+++ b/vl.c
@@ -184,6 +184,7 @@ const char *vnc_display;
 int acpi_enabled = 1;
 int fd_bootchk = 1;
 int no_reboot = 0;
+int cursor_hide = 1;
 int snapshot = 0;
 const char *sd_filename = 0;
 const char *mtd_filename = 0;
@@ -6613,6 +6614,7 @@ enum {
     QEMU_OPTION_vnc,
     QEMU_OPTION_no_acpi,
     QEMU_OPTION_no_reboot,
+    QEMU_OPTION_show_cursor,
     QEMU_OPTION_daemonize,
     QEMU_OPTION_option_rom,
     QEMU_OPTION_semihosting
@@ -6704,6 +6706,7 @@ const QEMUOption qemu_options[] = {
     { "cirrusvga", 0, QEMU_OPTION_cirrusvga },
     { "no-acpi", 0, QEMU_OPTION_no_acpi },
     { "no-reboot", 0, QEMU_OPTION_no_reboot },
+    { "show-cursor", 0, QEMU_OPTION_show_cursor },
     { "daemonize", 0, QEMU_OPTION_daemonize },
     { "option-rom", HAS_ARG, QEMU_OPTION_option_rom },
 #if defined(TARGET_ARM)
@@ -7413,6 +7416,9 @@ int main(int argc, char **argv)
             case QEMU_OPTION_no_reboot:
                 no_reboot = 1;
                 break;
+            case QEMU_OPTION_show_cursor:
+                cursor_hide = 0;
+                break;
 	    case QEMU_OPTION_daemonize:
 		daemonize = 1;
 		break;
diff --git a/vl.h b/vl.h
index 3eb204a..2211d1d 100644
--- a/vl.h
+++ b/vl.h
@@ -156,6 +156,7 @@ extern int kqemu_allowed;
 extern int win2k_install_hack;
 extern int usb_enabled;
 extern int smp_cpus;
+extern int cursor_hide;
 extern int snapshot;
 extern const char *sd_filename;
 extern const char *mtd_filename;
-- 
1.4.4.3


                 reply	other threads:[~2007-03-16 22:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=fb249edb0703161510ved771e1s4b109003c774ffbc@mail.gmail.com \
    --to=balrog@zabor.org \
    --cc=balrogg@gmail.com \
    --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).