qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] input: two bugfixes.
@ 2014-03-10 12:54 Gerd Hoffmann
  2014-03-10 12:54 ` [Qemu-devel] [PULL 1/2] input: sdl: fix guest_cursor logic Gerd Hoffmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2014-03-10 12:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

Two bugs in the input layer rewrite poped up,
here are the bugfixes for then.

please pull,
  Gerd

The following changes since commit f53f3d0a00b6df39ce8dfca942608e5b6a9a4f71:

  Merge remote-tracking branch 'remotes/kvaneesh/for-upstream' into staging (2014-03-08 12:38:43 +0000)

are available in the git repository at:


  git://git.kraxel.org/qemu tags/pull-input-5

for you to fetch changes up to dbb2a1326a7af6159861d3d7976c251a15ce0f92:

  input: map INPUT_BUTTON_WHEEL_{UP,DOWN} to legacy input z axis moves. (2014-03-10 13:49:44 +0100)

----------------------------------------------------------------
input: fixes for the rewrite.

----------------------------------------------------------------
Gerd Hoffmann (2):
      input: sdl: fix guest_cursor logic.
      input: map INPUT_BUTTON_WHEEL_{UP,DOWN} to legacy input z axis moves.

 ui/input-legacy.c | 14 ++++++++++++++
 ui/sdl.c          | 18 +++++++++++-------
 2 files changed, 25 insertions(+), 7 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 1/2] input: sdl: fix guest_cursor logic.
  2014-03-10 12:54 [Qemu-devel] [PULL 0/2] input: two bugfixes Gerd Hoffmann
@ 2014-03-10 12:54 ` Gerd Hoffmann
  2014-03-10 12:54 ` [Qemu-devel] [PULL 2/2] input: map INPUT_BUTTON_WHEEL_{UP, DOWN} to legacy input z axis moves Gerd Hoffmann
  2014-03-11 13:05 ` [Qemu-devel] [PULL 0/2] input: two bugfixes Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2014-03-10 12:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori

Unbreaks relative mouse mode with SDL.

Reported-by: Gabriel L. Somlo <gsomlo@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/sdl.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/ui/sdl.c b/ui/sdl.c
index c1a16be..4e7f920 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -455,13 +455,17 @@ static void sdl_send_mouse_event(int dx, int dy, int x, int y, int state)
                              real_screen->w);
         qemu_input_queue_abs(dcl->con, INPUT_AXIS_Y, y,
                              real_screen->h);
-    } else if (guest_cursor) {
-        x -= guest_x;
-        y -= guest_y;
-        guest_x += x;
-        guest_y += y;
-        qemu_input_queue_rel(dcl->con, INPUT_AXIS_X, x);
-        qemu_input_queue_rel(dcl->con, INPUT_AXIS_Y, y);
+    } else {
+        if (guest_cursor) {
+            x -= guest_x;
+            y -= guest_y;
+            guest_x += x;
+            guest_y += y;
+            dx = x;
+            dy = y;
+        }
+        qemu_input_queue_rel(dcl->con, INPUT_AXIS_X, dx);
+        qemu_input_queue_rel(dcl->con, INPUT_AXIS_Y, dy);
     }
     qemu_input_event_sync();
 }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 2/2] input: map INPUT_BUTTON_WHEEL_{UP, DOWN} to legacy input z axis moves.
  2014-03-10 12:54 [Qemu-devel] [PULL 0/2] input: two bugfixes Gerd Hoffmann
  2014-03-10 12:54 ` [Qemu-devel] [PULL 1/2] input: sdl: fix guest_cursor logic Gerd Hoffmann
@ 2014-03-10 12:54 ` Gerd Hoffmann
  2014-03-11 13:05 ` [Qemu-devel] [PULL 0/2] input: two bugfixes Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2014-03-10 12:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori

Unbreaks mouse wheel.

Reported-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/input-legacy.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/ui/input-legacy.c b/ui/input-legacy.c
index f38984b..7dc486b 100644
--- a/ui/input-legacy.c
+++ b/ui/input-legacy.c
@@ -359,6 +359,20 @@ static void legacy_mouse_event(DeviceState *dev, QemuConsole *src,
         } else {
             s->buttons &= ~bmap[evt->btn->button];
         }
+        if (evt->btn->down && evt->btn->button == INPUT_BUTTON_WHEEL_UP) {
+            s->qemu_put_mouse_event(s->qemu_put_mouse_event_opaque,
+                                    s->axis[INPUT_AXIS_X],
+                                    s->axis[INPUT_AXIS_Y],
+                                    -1,
+                                    s->buttons);
+        }
+        if (evt->btn->down && evt->btn->button == INPUT_BUTTON_WHEEL_DOWN) {
+            s->qemu_put_mouse_event(s->qemu_put_mouse_event_opaque,
+                                    s->axis[INPUT_AXIS_X],
+                                    s->axis[INPUT_AXIS_Y],
+                                    1,
+                                    s->buttons);
+        }
         break;
     case INPUT_EVENT_KIND_ABS:
         s->axis[evt->abs->axis] = evt->abs->value;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL 0/2] input: two bugfixes.
  2014-03-10 12:54 [Qemu-devel] [PULL 0/2] input: two bugfixes Gerd Hoffmann
  2014-03-10 12:54 ` [Qemu-devel] [PULL 1/2] input: sdl: fix guest_cursor logic Gerd Hoffmann
  2014-03-10 12:54 ` [Qemu-devel] [PULL 2/2] input: map INPUT_BUTTON_WHEEL_{UP, DOWN} to legacy input z axis moves Gerd Hoffmann
@ 2014-03-11 13:05 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2014-03-11 13:05 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 10 March 2014 12:54, Gerd Hoffmann <kraxel@redhat.com> wrote:
>   Hi,
>
> Two bugs in the input layer rewrite poped up,
> here are the bugfixes for then.
>
> please pull,
>   Gerd
>
> The following changes since commit f53f3d0a00b6df39ce8dfca942608e5b6a9a4f71:
>
>   Merge remote-tracking branch 'remotes/kvaneesh/for-upstream' into staging (2014-03-08 12:38:43 +0000)
>
> are available in the git repository at:
>
>
>   git://git.kraxel.org/qemu tags/pull-input-5
>
> for you to fetch changes up to dbb2a1326a7af6159861d3d7976c251a15ce0f92:
>
>   input: map INPUT_BUTTON_WHEEL_{UP,DOWN} to legacy input z axis moves. (2014-03-10 13:49:44 +0100)
>
> ----------------------------------------------------------------
> input: fixes for the rewrite.
>
> ----------------------------------------------------------------
> Gerd Hoffmann (2):
>       input: sdl: fix guest_cursor logic.
>       input: map INPUT_BUTTON_WHEEL_{UP,DOWN} to legacy input z axis moves.
>
>  ui/input-legacy.c | 14 ++++++++++++++
>  ui/sdl.c          | 18 +++++++++++-------
>  2 files changed, 25 insertions(+), 7 deletions(-)
>

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-11 13:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-10 12:54 [Qemu-devel] [PULL 0/2] input: two bugfixes Gerd Hoffmann
2014-03-10 12:54 ` [Qemu-devel] [PULL 1/2] input: sdl: fix guest_cursor logic Gerd Hoffmann
2014-03-10 12:54 ` [Qemu-devel] [PULL 2/2] input: map INPUT_BUTTON_WHEEL_{UP, DOWN} to legacy input z axis moves Gerd Hoffmann
2014-03-11 13:05 ` [Qemu-devel] [PULL 0/2] input: two bugfixes Peter Maydell

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).