Skip to contentSkip to conversation

Fixes 20210726 patches

GIT PULL Applied Gerd Hoffmann 2 participants 8 messages Jul 26, 2021 – Jul 27, 2021

lore
Share & tools
lore
#0 lore raw

The following changes since commit a2376507f615495b1d16685449ce0ea78c2caf9d:

Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2021-07-24 11:04:57 +0100)

are available in the Git repository at:

git://git.kraxel.org/qemu tags/fixes-20210726-pull-request

for you to fetch changes up to 584af1f1d955476aacba3350c4efb5865fc91c09:

ui/gtk: add a keyboard fifo to the VTE consoles (2021-07-26 10:24:49 +0200)

----------------------------------------------------------------
ui: fixes for 6.1

----------------------------------------------------------------

Akihiko Odaki (4):
ui/spice: Use HAVE_SPICE_GL for OpenGL checks ui/egl-headless: Remove a check for CONFIG_OPENGL ui/cocoa: Fix the type of main's argv
ui: update keycodemapdb submodule commit

Dennis Wölfing (1):
ui/gtk: Fix relative mouse with multiple monitors

Volker Rümelin (1):
ui/gtk: add a keyboard fifo to the VTE consoles

 include/ui/gtk.h  |  4 +++
 ui/egl-headless.c |  2 --
 ui/gtk.c          | 68 ++++++++++++++++++++++++++++-------------------
 ui/spice-app.c    |  3 ++-
 ui/spice-core.c   |  2 +-
 ui/cocoa.m        |  4 +--
 ui/keycodemapdb   |  2 +-
 7 files changed, 50 insertions(+), 35 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

[PULL 1/6] ui/gtk: Fix relative mouse with multiple monitors

From: Dennis Wölfing <[email protected]>

To handle relative mouse input the event handler needs to move the mouse away from the screen edges. Failing to do so results in the mouse getting stuck at invisible walls. However the current implementation for this is broken on hosts with multiple monitors.

With multiple monitors the mouse can be located outside of the current monitor which is not handled by the current code. Also the monitor itself might be located at coordinates different from (0, 0).

Message-Id: <[email protected]>

---
 ui/gtk.c | 26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)
ui/gtk.c +7 -19
index 376b4d528daa..18542c763312 100644
@@ -865,37 +865,25 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
         GdkWindow *win = gtk_widget_get_window(widget);
         GdkMonitor *monitor = gdk_display_get_monitor_at_window(dpy, win);
         GdkRectangle geometry;
-        int screen_width, screen_height;
 
         int x = (int)motion->x_root;
         int y = (int)motion->y_root;
 
         gdk_monitor_get_geometry(monitor, &geometry);
-        screen_width = geometry.width;
-        screen_height = geometry.height;
 
         /* In relative mode check to see if client pointer hit
-         * one of the screen edges, and if so move it back by
-         * 200 pixels. This is important because the pointer
+         * one of the monitor edges, and if so move it back to the
+         * center of the monitor. This is important because the pointer
          * in the server doesn't correspond 1-for-1, and so
          * may still be only half way across the screen. Without
          * this warp, the server pointer would thus appear to hit
          * an invisible wall */
-        if (x == 0) {
-            x += 200;
-        }
-        if (y == 0) {
-            y += 200;
-        }
-        if (x == (screen_width - 1)) {
-            x -= 200;
-        }
-        if (y == (screen_height - 1)) {
-            y -= 200;
-        }
-
-        if (x != (int)motion->x_root || y != (int)motion->y_root) {
+        if (x <= geometry.x || x - geometry.x >= geometry.width - 1 ||
+            y <= geometry.y || y - geometry.y >= geometry.height - 1) {
             GdkDevice *dev = gdk_event_get_device((GdkEvent *)motion);
+            x = geometry.x + geometry.width / 2;
+            y = geometry.y + geometry.height / 2;
+
             gdk_device_warp(dev, screen, x, y);
             s->last_set = FALSE;
             return FALSE;
Signature · 1 line
2.31.1
#2 lore raw

[PULL 3/6] ui/egl-headless: Remove a check for CONFIG_OPENGL

In reply to Gerd Hoffmann

From: Akihiko Odaki <[email protected]>

ui/egl-headless is only built when CONFIG_OPENGL is defined because it depends on CONFIG_OPENGL without condition. Remove a redundant conditonal in ui/egl-headless.c

Message-Id: <[email protected]>

---
 ui/egl-headless.c | 2 --
 1 file changed, 2 deletions(-)
ui/egl-headless.c +0 -2
index 75404e0e8700..a26a2520c496 100644
@@ -214,6 +214,4 @@ static void register_egl(void)
 
 type_init(register_egl);
 
-#ifdef CONFIG_OPENGL
 module_dep("ui-opengl");
-#endif
Signature · 1 line
2.31.1
#3 lore raw

[PULL 5/6] ui: update keycodemapdb submodule commit

In reply to Gerd Hoffmann

From: Akihiko Odaki <[email protected]>

The change of ui/keycodemapdb effective on QEMU is only commit d21009b1c9f94b740ea66be8e48a1d8ad8124023, which adds mappings for key codes added in commit d7696ff884e35c6dacf83a7cbe3355e3b0a90125.

d21009b1c9f94b740ea66be8e48a1d8ad8124023 Add QEMU QKeyCode "lang1" and "lang2" 320f92c36a80bfafc5d57834592a7be5fd79f104 rust: fix cargo clippy e62d42f0fd76f7bb8bf78385a83c060e66ff52b0 tests: add rust test 3e25e1ca1772fc3f2039f739f8f920450dc68e50 gen: add --lang rust 9133a0b8022d1fb063a81cc2ba3b627c14ccdfd1 tests: fix argument order

Message-Id: <[email protected]>

---
 ui/keycodemapdb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ui/keycodemapdb +1 -1
index 6119e6e19a05..d21009b1c9f9 160000
@@ -1 +1 @@
-Subproject commit 6119e6e19a050df847418de7babe5166779955e4
+Subproject commit d21009b1c9f94b740ea66be8e48a1d8ad8124023
Signature · 1 line
2.31.1
#4 lore raw

[PULL 6/6] ui/gtk: add a keyboard fifo to the VTE consoles

In reply to Gerd Hoffmann

From: Volker Rümelin <[email protected]>

Since commit 8eb13bbbac ("ui/gtk: vte: fix sending multiple characeters") it's very easy to lock up QEMU with the GTK ui. If you configure a guest with a serial device and the guest doesn't listen on this device, QEMU will lock up after entering two characters in the serial console. That's because current code uses a busy loop for the chardev write retries and the busy loop doesn't terminate in this case.

To fix this problem add a fifo to the VTE consoles and use the chr_accept_input() callback function to write the remaining characters in the queue to the chardev.

The fifo has a size of 4096 bytes, so one can copy and paste a fairly large URL or file path.

Fixes 8eb13bbbac ("ui/gtk: vte: fix sending multiple characeters")

Message-Id: <[email protected]>

---
 include/ui/gtk.h |  4 ++++
 ui/gtk.c         | 42 +++++++++++++++++++++++++++++++++---------
 2 files changed, 37 insertions(+), 9 deletions(-)
include/ui/gtk.h +4 -0
index 9516670ebc87..80d6bbd9b5f3 100644
@@ -25,6 +25,9 @@
 #include "ui/egl-helpers.h"
 #include "ui/egl-context.h"
 #endif
+#ifdef CONFIG_VTE
+#include "qemu/fifo8.h"
+#endif
 
 #define MAX_VCS 10
 
@@ -62,6 +65,7 @@ typedef struct VirtualVteConsole {
     GtkWidget *scrollbar;
     GtkWidget *terminal;
     Chardev *chr;
+    Fifo8 out_fifo;
     bool echo;
 } VirtualVteConsole;
 #endif
ui/gtk.c +33 -9

79 lines not on this page · raw message

Signature · 1 line
2.31.1
#5 lore raw

[PULL 2/6] ui/spice: Use HAVE_SPICE_GL for OpenGL checks

In reply to Gerd Hoffmann

From: Akihiko Odaki <[email protected]>

Some code in ui/spice used CONFIG_OPENGL for OpenGL conditionals, but SPICE also depends on CONFIG_GBM and SPICE server whose version is 0.13.1 or later for OpenGL. Always use HAVE_SPICE_GL, which defines the precise condition.

Message-Id: <[email protected]>

---
 ui/spice-app.c  | 3 ++-
 ui/spice-core.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
ui/spice-app.c +2 -1
index 641f4a9d53e3..7e71e18da9ad 100644
@@ -27,6 +27,7 @@
 #include <gio/gio.h>
 
 #include "ui/console.h"
+#include "ui/spice-display.h"
 #include "qemu/config-file.h"
 #include "qemu/option.h"
 #include "qemu/cutils.h"
@@ -175,7 +176,7 @@ static void spice_app_display_early_init(DisplayOptions *opts)
     qemu_opt_set(qopts, "addr", sock_path, &error_abort);
     qemu_opt_set(qopts, "image-compression", "off", &error_abort);
     qemu_opt_set(qopts, "streaming-video", "off", &error_abort);
-#ifdef CONFIG_OPENGL
+#ifdef HAVE_SPICE_GL
     qemu_opt_set(qopts, "gl", opts->has_gl ? "on" : "off", &error_abort);
     display_opengl = opts->has_gl;
 #endif
ui/spice-core.c +1 -1
index 86d43783acac..0371055e6c17 100644
@@ -1039,6 +1039,6 @@ static void spice_register_config(void)
 opts_init(spice_register_config);
 module_opts("spice");
 
-#ifdef CONFIG_OPENGL
+#ifdef HAVE_SPICE_GL
 module_dep("ui-opengl");
 #endif
Signature · 1 line
2.31.1
#6 lore raw

[PULL 4/6] ui/cocoa: Fix the type of main's argv

In reply to Gerd Hoffmann

From: Akihiko Odaki <[email protected]>

Message-Id: <[email protected]>

---
 ui/cocoa.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
ui/cocoa.m +2 -2
index 9f72844b0793..68a6302184ab 100644
@@ -1888,12 +1888,12 @@ static void *call_qemu_main(void *opaque)
     exit(status);
 }
 
-int main (int argc, const char * argv[]) {
+int main (int argc, char **argv) {
     QemuThread thread;
 
     COCOA_DEBUG("Entered main()\n");
     gArgc = argc;
-    gArgv = (char **)argv;
+    gArgv = argv;
 
     qemu_sem_init(&display_init_sem, 0);
     qemu_sem_init(&app_started_sem, 0);
Signature · 1 line
2.31.1
#7 lore raw
In reply to Gerd Hoffmann
Quoted 9 lines · Gerd Hoffmann

The following changes since commit a2376507f615495b1d16685449ce0ea78c2caf9d:

Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2021-07-24 11:04:57 +0100)

are available in the Git repository at:

git://git.kraxel.org/qemu tags/fixes-20210726-pull-request

Quoted 8 lines

for you to fetch changes up to 584af1f1d955476aacba3350c4efb5865fc91c09:

ui/gtk: add a keyboard fifo to the VTE consoles (2021-07-26 10:24:49 +0200)

----------------------------------------------------------------
ui: fixes for 6.1

----------------------------------------------------------------

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.1
for any user-visible changes.

-- PMM