qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>,
	Maria Klimushenkova <maria.klimushenkova@ispras.ru>
Subject: [Qemu-devel] [PULL 2/3] sdl2: fix copypaste issues
Date: Tue, 26 Jun 2018 15:56:24 +0200	[thread overview]
Message-ID: <20180626135625.7078-3-kraxel@redhat.com> (raw)
In-Reply-To: <20180626135625.7078-1-kraxel@redhat.com>

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

This patch fixes text and mouse event processing. These functions used
'key' field of the event instead of appropriate 'text', 'motion', 'button',
or 'wheel'.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Signed-off-by: Maria Klimushenkova <maria.klimushenkova@ispras.ru>
Message-id: 20180626064017.17031.47954.stgit@pasha-VirtualBox
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/sdl2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index 3ae4719c32..3fff9f5b63 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -424,7 +424,7 @@ static void handle_keyup(SDL_Event *ev)
 
 static void handle_textinput(SDL_Event *ev)
 {
-    struct sdl2_console *scon = get_scon_from_window(ev->key.windowID);
+    struct sdl2_console *scon = get_scon_from_window(ev->text.windowID);
     QemuConsole *con = scon ? scon->dcl.con : NULL;
 
     if (qemu_console_is_graphic(con)) {
@@ -436,7 +436,7 @@ static void handle_textinput(SDL_Event *ev)
 static void handle_mousemotion(SDL_Event *ev)
 {
     int max_x, max_y;
-    struct sdl2_console *scon = get_scon_from_window(ev->key.windowID);
+    struct sdl2_console *scon = get_scon_from_window(ev->motion.windowID);
 
     if (!qemu_console_is_graphic(scon->dcl.con)) {
         return;
@@ -468,7 +468,7 @@ static void handle_mousebutton(SDL_Event *ev)
 {
     int buttonstate = SDL_GetMouseState(NULL, NULL);
     SDL_MouseButtonEvent *bev;
-    struct sdl2_console *scon = get_scon_from_window(ev->key.windowID);
+    struct sdl2_console *scon = get_scon_from_window(ev->button.windowID);
 
     if (!qemu_console_is_graphic(scon->dcl.con)) {
         return;
@@ -492,7 +492,7 @@ static void handle_mousebutton(SDL_Event *ev)
 
 static void handle_mousewheel(SDL_Event *ev)
 {
-    struct sdl2_console *scon = get_scon_from_window(ev->key.windowID);
+    struct sdl2_console *scon = get_scon_from_window(ev->wheel.windowID);
     SDL_MouseWheelEvent *wev = &ev->wheel;
     InputButton btn;
 
-- 
2.9.3

  parent reply	other threads:[~2018-06-26 13:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26 13:56 [Qemu-devel] [PULL 0/3] Ui 20180626 patches Gerd Hoffmann
2018-06-26 13:56 ` [Qemu-devel] [PULL 1/3] Add gles support to egl-helpers, wire up in egl-headless and gtk Gerd Hoffmann
2018-06-26 13:56 ` Gerd Hoffmann [this message]
2018-06-26 13:56 ` [Qemu-devel] [PULL 3/3] sdl2: add checking for NULL Gerd Hoffmann
2018-06-26 16:37 ` [Qemu-devel] [PULL 0/3] Ui 20180626 patches Peter Maydell

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=20180626135625.7078-3-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=Pavel.Dovgaluk@ispras.ru \
    --cc=maria.klimushenkova@ispras.ru \
    --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).