qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jindrich Makovicka <makovick@gmail.com>
To: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Cc: Jindrich Makovicka <makovick@gmail.com>
Subject: [Qemu-devel] [PATCH 1/3] sdl2: Do not hide the cursor on auxilliary windows
Date: Fri, 17 Nov 2017 12:22:56 +0100	[thread overview]
Message-ID: <20171117112258.5888-2-makovick@gmail.com> (raw)
In-Reply-To: <20171117112258.5888-1-makovick@gmail.com>

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
---
 ui/sdl2.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index 53dd447fd2..290b57b1b3 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -463,6 +463,10 @@ static void handle_mousemotion(SDL_Event *ev)
     int max_x, max_y;
     struct sdl2_console *scon = get_scon_from_window(ev->key.windowID);
 
+    if (!qemu_console_is_graphic(scon->dcl.con)) {
+        return;
+    }
+
     if (qemu_input_is_absolute() || absolute_enabled) {
         int scr_w, scr_h;
         SDL_GetWindowSize(scon->real_window, &scr_w, &scr_h);
@@ -490,6 +494,10 @@ static void handle_mousebutton(SDL_Event *ev)
     SDL_MouseButtonEvent *bev;
     struct sdl2_console *scon = get_scon_from_window(ev->key.windowID);
 
+    if (!qemu_console_is_graphic(scon->dcl.con)) {
+        return;
+    }
+
     bev = &ev->button;
     if (!gui_grab && !qemu_input_is_absolute()) {
         if (ev->type == SDL_MOUSEBUTTONUP && bev->button == SDL_BUTTON_LEFT) {
@@ -512,6 +520,10 @@ static void handle_mousewheel(SDL_Event *ev)
     SDL_MouseWheelEvent *wev = &ev->wheel;
     InputButton btn;
 
+    if (!qemu_console_is_graphic(scon->dcl.con)) {
+        return;
+    }
+
     if (wev->y > 0) {
         btn = INPUT_BUTTON_WHEEL_UP;
     } else if (wev->y < 0) {
@@ -652,6 +664,11 @@ static void sdl_mouse_warp(DisplayChangeListener *dcl,
                            int x, int y, int on)
 {
     struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl);
+
+    if (!qemu_console_is_graphic(scon->dcl.con)) {
+        return;
+    }
+
     if (on) {
         if (!guest_cursor) {
             sdl_show_cursor();
-- 
2.15.0

  reply	other threads:[~2017-11-17 11:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17 11:22 [Qemu-devel] [PATCH v4] SDL2 various fixes Jindrich Makovicka
2017-11-17 11:22 ` Jindrich Makovicka [this message]
2017-11-17 11:22 ` [Qemu-devel] [PATCH 2/3] sdl2 uses surface relative coordinates Jindrich Makovicka
2017-11-17 11:22 ` [Qemu-devel] [PATCH 3/3] sdl2: Ignore UI hotkeys after a focus change when GUI modifier is held Jindrich Makovicka
2018-01-01 20:16 ` [Qemu-devel] [PATCH v4] SDL2 various fixes Jindřich Makovička
2018-01-08 10:45   ` Gerd Hoffmann
2018-01-12 13:48 ` Gerd Hoffmann

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=20171117112258.5888-2-makovick@gmail.com \
    --to=makovick@gmail.com \
    --cc=kraxel@redhat.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).