4c93ce54 | 23-May-2023 |
Mauro Matteo Cascella <mcascell@redhat.com> |
ui/cursor: make width/height unsigned 16-bit integer
Although not actually exploitable at the moment, a negative width/height could make datasize wrap around and potentially lead to buffer overflow.
ui/cursor: make width/height unsigned 16-bit integer
Although not actually exploitable at the moment, a negative width/height could make datasize wrap around and potentially lead to buffer overflow. Since there is no reason a negative width/height is ever appropriate, modify QEMUCursor struct and cursor_alloc prototype to accept uint16_t. This protects us against accidentally introducing future bugs.
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com> Reported-by: Jacek Halon <jacek.halon@gmail.com> Reported-by: Yair Mizrahi <yairh33@gmail.com> Reported-by: Elsayed El-Refa'ei <e.elrefaei99@gmail.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230523163023.608121-1-mcascell@redhat.com>
show more ...
|
1dfea3f2 | 18-Apr-2023 |
Volker Rümelin <vr_qemu@t-online.de> |
ui/sdl2: disable SDL_HINT_GRAB_KEYBOARD on Windows
Windows sends an extra left control key up/down input event for every right alt key up/down input event for keyboards with international layout. Si
ui/sdl2: disable SDL_HINT_GRAB_KEYBOARD on Windows
Windows sends an extra left control key up/down input event for every right alt key up/down input event for keyboards with international layout. Since commit 830473455f ("ui/sdl2: fix handling of AltGr key on Windows") QEMU uses a Windows low level keyboard hook procedure to reliably filter out the special left control key and to grab the keyboard on Windows.
The SDL2 version 2.0.16 introduced its own Windows low level keyboard hook procedure to grab the keyboard. Windows calls this callback before the QEMU keyboard hook procedure. This disables the special left control key filter when the keyboard is grabbed.
To fix the problem, disable the SDL2 Windows low level keyboard hook procedure.
Reported-by: Bernhard Beschow <shentey@gmail.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Bernhard Beschow <shentey@gmail.com> Message-Id: <20230418062823.5683-1-vr_qemu@t-online.de>
show more ...
|
083db9db | 17-Apr-2023 |
Bernhard Beschow <shentey@gmail.com> |
ui/sdl2: Grab Alt+F4 also under Windows
SDL doesn't grab Alt+F4 under Windows by default. Pressing Alt+F4 thus closes the VM immediately without confirmation, possibly leading to data loss. Fix this
ui/sdl2: Grab Alt+F4 also under Windows
SDL doesn't grab Alt+F4 under Windows by default. Pressing Alt+F4 thus closes the VM immediately without confirmation, possibly leading to data loss. Fix this by always grabbing Alt+F4 on Windows hosts, too.
Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20230417192139.43263-3-shentey@gmail.com>
show more ...
|
efc00a37 | 17-Apr-2023 |
Bernhard Beschow <shentey@gmail.com> |
ui/sdl2: Grab Alt+Tab also in fullscreen mode
By default, SDL grabs Alt+Tab only in non-fullscreen mode. This causes Alt+Tab to switch tasks on the host rather than in the VM in fullscreen mode whil
ui/sdl2: Grab Alt+Tab also in fullscreen mode
By default, SDL grabs Alt+Tab only in non-fullscreen mode. This causes Alt+Tab to switch tasks on the host rather than in the VM in fullscreen mode while it switches tasks in non-fullscreen mode in the VM. Fix this confusing behavior by grabbing Alt+Tab in fullscreen mode, always causing tasks to be switched in the VM.
Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20230417192139.43263-2-shentey@gmail.com>
show more ...
|
da1d066c | 15-May-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
ui/dbus: add a FIXME about texture/dmabuf scanout handling
Except SDL, display backends seem to fail at handing full scanout geometry correctly. It would need some test/reproducer to actually check
ui/dbus: add a FIXME about texture/dmabuf scanout handling
Except SDL, display backends seem to fail at handing full scanout geometry correctly. It would need some test/reproducer to actually check it. In the meantime, fill some missing fields, and leave a FIXME.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230515132537.1026310-1-marcandre.lureau@redhat.com>
show more ...
|
57430aa4 | 15-May-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
gtk: add gl-area support on win32
On Windows, we don't use the low-level GBM/EGL helpers (no dmabuf etc), we can turn on GL area support for the rest of rendering.
(fwiw, GDK backend may be either
gtk: add gl-area support on win32
On Windows, we don't use the low-level GBM/EGL helpers (no dmabuf etc), we can turn on GL area support for the rest of rendering.
(fwiw, GDK backend may be either WGL or EGL)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Bernhard Beschow <shentey@gmail.com> Message-Id: <20230515132527.1026064-1-marcandre.lureau@redhat.com>
show more ...
|
0b31e48d | 15-May-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
ui/dbus: fix compilation when GBM && !OPENGL
commit 4814d3cbf ("ui/dbus: restrict opengl to gbm-enabled config") assumes that whenever GBM is available, OpenGL is. This is not always the case, let's
ui/dbus: fix compilation when GBM && !OPENGL
commit 4814d3cbf ("ui/dbus: restrict opengl to gbm-enabled config") assumes that whenever GBM is available, OpenGL is. This is not always the case, let's further restrict opengl-related paths and fix some compilation issues.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230515132348.1024663-1-marcandre.lureau@redhat.com>
show more ...
|
b3a654d8 | 11-May-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
ui/sdl2: fix surface_gl_update_texture: Assertion 'gls' failed
Before sdl2_gl_update() is called, sdl2_gl_switch() may decide to destroy the console window and its associated shaders.
Resolves: htt
ui/sdl2: fix surface_gl_update_texture: Assertion 'gls' failed
Before sdl2_gl_update() is called, sdl2_gl_switch() may decide to destroy the console window and its associated shaders.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1644 Fixes: c84ab0a500a8 ("ui/console: optionally update after gfx switch")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Bin Meng <bin.meng@windriver.com> Message-Id: <20230511074217.4171842-1-marcandre.lureau@redhat.com>
show more ...
|
f8a951bb | 20-Mar-2023 |
Erico Nunes <ernunes@redhat.com> |
ui/gtk-egl: fix scaling for cursor position in scanout mode
vc->gfx.w and vc->gfx.h are not updated appropriately in this code path, which leads to a different scaling factor for rendering the curso
ui/gtk-egl: fix scaling for cursor position in scanout mode
vc->gfx.w and vc->gfx.h are not updated appropriately in this code path, which leads to a different scaling factor for rendering the cursor on some edge cases (e.g. the focus has left and re-entered the gtk window). This can be reproduced using vhost-user-gpu with the gtk ui on the x11 backend. Use the surface dimensions which are already updated accordingly.
Signed-off-by: Erico Nunes <ernunes@redhat.com> Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230320160856.364319-2-ernunes@redhat.com>
show more ...
|
2f31663e | 20-Mar-2023 |
Erico Nunes <ernunes@redhat.com> |
ui/gtk: use widget size for cursor motion event
The gd_motion_event size has some calculations for the cursor position, which also take into account things like different size of the framebuffer com
ui/gtk: use widget size for cursor motion event
The gd_motion_event size has some calculations for the cursor position, which also take into account things like different size of the framebuffer compared to the window size. The use of window size makes things more difficult though, as at least in the case of Wayland includes the size of ui elements like a menu bar at the top of the window. This leads to a wrong position calculation by a few pixels. Fix it by using the size of the widget, which already returns the size of the actual space to render the framebuffer.
Signed-off-by: Erico Nunes <ernunes@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20230320160856.364319-1-ernunes@redhat.com>
show more ...
|
49152ac4 | 20-Feb-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
ui: fix crash on serial reset, during init
For ex, when resetting the xlnx-zcu102 machine:
(lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x50
ui: fix crash on serial reset, during init
For ex, when resetting the xlnx-zcu102 machine:
(lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x50) * frame #0: 0x10020a740 gd_vc_send_chars(vc=0x000000000) at gtk.c:1759:41 [opt] frame #1: 0x100636264 qemu_chr_fe_accept_input(be=<unavailable>) at char-fe.c:159:9 [opt] frame #2: 0x1000608e0 cadence_uart_reset_hold [inlined] uart_rx_reset(s=0x10810a960) at cadence_uart.c:158:5 [opt] frame #3: 0x1000608d4 cadence_uart_reset_hold(obj=0x10810a960) at cadence_uart.c:530:5 [opt] frame #4: 0x100580ab4 resettable_phase_hold(obj=0x10810a960, opaque=0x000000000, type=<unavailable>) at resettable.c:0 [opt] frame #5: 0x10057d1b0 bus_reset_child_foreach(obj=<unavailable>, cb=(resettable_phase_hold at resettable.c:162), opaque=0x000000000, type=RESET_TYPE_COLD) at bus.c:97:13 [opt] frame #6: 0x1005809f8 resettable_phase_hold [inlined] resettable_child_foreach(rc=0x000060000332d2c0, obj=0x0000600002c1c180, cb=<unavailable>, opaque=0x000000000, type=RESET_TYPE_COLD) at resettable.c:96:9 [opt] frame #7: 0x1005809d8 resettable_phase_hold(obj=0x0000600002c1c180, opaque=0x000000000, type=RESET_TYPE_COLD) at resettable.c:173:5 [opt] frame #8: 0x1005803a0 resettable_assert_reset(obj=0x0000600002c1c180, type=<unavailable>) at resettable.c:60:5 [opt] frame #9: 0x10058027c resettable_reset(obj=0x0000600002c1c180, type=RESET_TYPE_COLD) at resettable.c:45:5 [opt]
While the chardev is created early, the VirtualConsole is associated after, during qemu_init_displays().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230220072251.3385878-1-marcandre.lureau@redhat.com>
show more ...
|
9b6611f4 | 01-Mar-2023 |
Erico Nunes <ernunes@redhat.com> |
ui/sdl2: remove workaround forcing x11
This workaround was put in place in the original implementation almost 10 years ago, considering a very old SDL2 version. Currently it prevents users to run in
ui/sdl2: remove workaround forcing x11
This workaround was put in place in the original implementation almost 10 years ago, considering a very old SDL2 version. Currently it prevents users to run in a wayland-only environment without manually forcing the backend. The SDL2 wayland backend has been supported by distributions for a very long time (e.g. in Fedora, first available 8 years ago), and is now considered stable and becoming the default for new SDL2 releases. Instead of requiring the x11 backend to exist by default, let new qemu releases run with the default chosen by the installed SDL2 version.
Signed-off-by: Erico Nunes <ernunes@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230301141205.514338-1-ernunes@redhat.com>
show more ...
|
3c293a46 | 19-Mar-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
ui: return the default console cursor when con == NULL
VNC code relies on con==NULL to mean the default console.
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1548
Fixes: commit 385ac97f8 (
ui: return the default console cursor when con == NULL
VNC code relies on con==NULL to mean the default console.
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1548
Fixes: commit 385ac97f8 ("ui: keep current cursor with QemuConsole") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reported-by: Helge Konetzka <hk@zapateado.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230319111017.1319880-1-marcandre.lureau@redhat.com>
show more ...
|
281a77df | 20-Mar-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
ui/gtk: fix cursor moved to left corner
Do not attempt to move the pointer if the widget is not yet realized. The mouse cursor is placed to the corner of the screen, on X11 at least, as x_root and y
ui/gtk: fix cursor moved to left corner
Do not attempt to move the pointer if the widget is not yet realized. The mouse cursor is placed to the corner of the screen, on X11 at least, as x_root and y_root are then miscalculated. (this is not reproducible on Wayland, because Gtk doesn't implement device warping there)
This also fixes the following warning at start: qemu: Gdk: gdk_window_get_root_coords: assertion 'GDK_IS_WINDOW (window)' failed
Fixes: 6effaa16ac98 ("ui: set cursor position upon listener registration") Reported-by: Bernhard Beschow <shentey@gmail.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Tested-by: Bernhard Beschow <shentey@gmail.com> Message-Id: <20230320132624.1612464-1-marcandre.lureau@redhat.com>
show more ...
|
74bc00c6 | 20-Mar-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
ui/dbus: fix passing SOCKET to GSocket API & leak
-display dbus is not currently available to win32 users, so it's not considered a regression.
Note also the close() leak fix in case of error.
Sig
ui/dbus: fix passing SOCKET to GSocket API & leak
-display dbus is not currently available to win32 users, so it's not considered a regression.
Note also the close() leak fix in case of error.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230320133643.1618437-4-marcandre.lureau@redhat.com>
show more ...
|