Skip to contentSkip to conversation

input: two more fixes

GIT PULL Applied Gerd Hoffmann 2 participants 4 messages Mar 13, 2014

lore
Share & tools
lore
#0 lore raw

Hi,

Two more input bugfixes. Well, the gtk wheel support could be considered a new feature. On top of the input layer rewrite it is pretty simple and straight forward patch, so I think it is fine for 2.0 nevertheless.

please pull,
Gerd

The following changes since commit 239618707637ec87eba8c452d2b2f75dc5ca20c7:

Merge remote-tracking branch 'remotes/kvm/uq/master' into staging (2014-03-11 19:39:17 +0000)

are available in the git repository at:

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

for you to fetch changes up to d58b9122716bc444305515ead3a69b91d807bf3c:

gtk: Add mouse wheel support (2014-03-12 10:44:45 +0100)

----------------------------------------------------------------
input: activate legacy kbd
gtk: Add mouse wheel support

----------------------------------------------------------------
Gerd Hoffmann (1):
input: activate legacy kbd

Jan Kiszka (1):
gtk: Add mouse wheel support

 ui/gtk.c          | 23 +++++++++++++++++++++++
 ui/input-legacy.c |  1 +
 2 files changed, 24 insertions(+)
#1 lore raw

[Qemu-devel] [PULL 1/2] input: activate legacy kbd

Restores traditional behavior: Keyboard input will be routed to the most recently added keyboard. Without this all kbd input goes to the ps/2 keyboard, even if you add a usb keyboard to your guest.

---
 ui/input-legacy.c | 1 +
 1 file changed, 1 insertion(+)
ui/input-legacy.c +1 -0
index 7dc486b..1aa2605 100644
@@ -333,6 +333,7 @@ QEMUPutKbdEntry *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *opaque)
     entry->opaque = opaque;
     entry->s = qemu_input_handler_register((DeviceState *)entry,
                                            &legacy_kbd_handler);
+    qemu_input_handler_activate(entry->s);
     return entry;
 }
 
Signature · 1 line
1.8.3.1
#2 lore raw

[Qemu-devel] [PULL 2/2] gtk: Add mouse wheel support

In reply to Gerd Hoffmann

From: Jan Kiszka <[email protected]>

Hook into scroll-event to properly forward mouse wheel movements to the guest, just like we already do in SDL.

---
 ui/gtk.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
ui/gtk.c +23 -0
index 1851495..c3ac448 100644
@@ -683,6 +683,27 @@ static gboolean gd_button_event(GtkWidget *widget, GdkEventButton *button,
     return TRUE;
 }
 
+static gboolean gd_scroll_event(GtkWidget *widget, GdkEventScroll *scroll,
+                                void *opaque)
+{
+    GtkDisplayState *s = opaque;
+    InputButton btn;
+
+    if (scroll->direction == GDK_SCROLL_UP) {
+        btn = INPUT_BUTTON_WHEEL_UP;
+    } else if (scroll->direction == GDK_SCROLL_DOWN) {
+        btn = INPUT_BUTTON_WHEEL_DOWN;
+    } else {
+        return TRUE;
+    }
+
+    qemu_input_queue_btn(s->dcl.con, btn, true);
+    qemu_input_event_sync();
+    qemu_input_queue_btn(s->dcl.con, btn, false);
+    qemu_input_event_sync();
+    return TRUE;
+}
+
 static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
 {
     GtkDisplayState *s = opaque;
@@ -1229,6 +1250,8 @@ static void gd_connect_signals(GtkDisplayState *s)
                      G_CALLBACK(gd_button_event), s);
     g_signal_connect(s->drawing_area, "button-release-event",
                      G_CALLBACK(gd_button_event), s);
+    g_signal_connect(s->drawing_area, "scroll-event",
+                     G_CALLBACK(gd_scroll_event), s);
     g_signal_connect(s->drawing_area, "key-press-event",
                      G_CALLBACK(gd_key_event), s);
     g_signal_connect(s->drawing_area, "key-release-event",
Signature · 1 line
1.8.3.1
#3 lore raw
In reply to Gerd Hoffmann
Quoted 14 lines · Gerd Hoffmann

Hi,

Two more input bugfixes. Well, the gtk wheel support could be considered a new feature. On top of the input layer rewrite it is pretty simple and straight forward patch, so I think it is fine for 2.0 nevertheless.

please pull,
Gerd

The following changes since commit 239618707637ec87eba8c452d2b2f75dc5ca20c7:

Merge remote-tracking branch 'remotes/kvm/uq/master' into staging (2014-03-11 19:39:17 +0000)

Quoted 9 lines

are available in the git repository at:

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

for you to fetch changes up to d58b9122716bc444305515ead3a69b91d807bf3c:

gtk: Add mouse wheel support (2014-03-12 10:44:45 +0100)

Applied, thanks.

-- PMM