- Oct 03, 2023
-
-
Marc-André Lureau authored
dpy_get_ui_info() shouldn't be called if the underlying GPU doesn't support it. Before the assert() was added and the regression introduced, GTK code used to get "zero" UI info, for ex with a simple VGA device. The assert was added to prevent from calling when there are no console too. The other display backend that calls dpy_get_ui_info() correctly checks that pre-condition. Calling dpy_set_ui_info() is "safe" in this case, it will simply return an error that can be generally ignored. Fixes: commit a92e7bb4 ("ui: add precondition for dpy_get_ui_info()") Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-
Akihiko Odaki authored
Although an input is routed depending on the console, qemu_input_is_absolute() had no mechanism to specify the console. Accept QemuConsole as an argument for qemu_input_is_absolute, and let the display know the absolute/relative state for a particular console. Signed-off-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230921082936.28100-1-akihiko.odaki@daynix.com>
-
- Sep 29, 2023
-
-
Markus Armbruster authored
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-ID: <20230921121312.1301864-4-armbru@redhat.com>
-
- Sep 12, 2023
-
-
Marc-André Lureau authored
It's already part of PIXMAN image. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com>
-
Marc-André Lureau authored
They are QemuTextConsole functions, let's make it clear. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com>
-
- Sep 04, 2023
-
-
Dmitry Frolov authored
It is true, that there is no problem during runtime from the first sight, because the memory is lost just before qemu exits. Nevertheless, this change is necessary, because AddressSanitizer is not able to recognize this situation and produces crash-report (which is false-positive in fact). Lots of False-Positive warnings are davaluing problems, found with fuzzing, and thus the whole methodology of dynamic analysis. This patch eliminates such False-Positive reports, and makes every problem, found with fuzzing, more valuable. Fixes: 060ab763 ("gtk: don't exit early in case gtk init fails") Signed-off-by:
Dmitry Frolov <frolov@swemel.ru> Reviewed-by:
Michael Tokarev <mjt@tls.msk.ru> Message-Id: <20230825115818.1091936-1-frolov@swemel.ru>
-
Marc-André Lureau authored
Those functions are specifc to text/vc console, make that explicit from the argument type. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230830093843.3531473-45-marcandre.lureau@redhat.com>
-
Marc-André Lureau authored
In commit 6f974c84 ("gtk: overwrite the console.c char driver"), I shared the VC console parse handler with GTK. And later on in commit d8aec9d9 ("display: add -display spice-app launching a Spice client"), I also used it to handle spice-app VC. This is not necessary, the VC console options (width/height/cols/rows) are specific, and unused by tty-level GTK/Spice VC. This is not a breaking change, as those options are still being parsed by QAPI ChardevVC. Adjust the documentation about it. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230830093843.3531473-44-marcandre.lureau@redhat.com>
-
- Jun 27, 2023
-
-
Dongwon Kim authored
Set vc->gfx.guest_fb.dmabuf to NULL to prevent any further access to it after the dmabuf is released. v2: move declaration of vc inside ifdef Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com> Signed-off-by:
Dongwon Kim <dongwon.kim@intel.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20230627005316.5627-1-dongwon.kim@intel.com>
-
Bilal Elmoussaoui authored
To share code between the GTK and DBus UI bakcends see the next commit for details Signed-off-by:
Bilal Elmoussaoui <belmouss@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230619095337.9899-2-belmouss@redhat.com>
-
- May 28, 2023
-
-
Sergio Lopez authored
GTK3 provides the infrastructure to receive and process multi-touch events through the "touch-event" signal and the GdkEventTouch type. Make use of it to transpose events from the host to the guest. This allows users of machines with hardware capable of receiving multi-touch events to run guests that can also receive those events and interpret them as gestures, when appropriate. An example of this in action can be seen here: https://fosstodon.org/@slp/109545849296546767 Signed-off-by:
Sergio Lopez <slp@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230526112925.38794-7-slp@redhat.com>
-
Marc-André Lureau authored
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>
-
Erico Nunes authored
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>
-
- Mar 21, 2023
-
-
Marc-André Lureau authored
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>
-
Marc-André Lureau authored
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: 6effaa16 ("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>
-
- Feb 14, 2023
-
-
Thomas Huth authored
Include it in the .c files instead that use the error reporting functions. Message-Id: <20230210111931.1115489-1-thuth@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Feb 08, 2023
-
-
Markus Armbruster authored
Tracked down with the help of scripts/clean-includes. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Acked-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by:
Greg Kurz <groug@kaod.org> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Reviewed-by:
Juan Quintela <quintela@redhat.com> Message-Id: <20230202133830.2152150-21-armbru@redhat.com>
-
- Nov 23, 2022
-
-
Claudio Fontana authored
The GTK Clipboard implementation may cause guest hangs. Therefore implement new configure switch: --enable-gtk-clipboard, as a meson option disabled by default, which warns in the help text about the experimental nature of the feature. Regenerate the meson build options to include it. The initialization of the clipboard is gtk.c, as well as the compilation of gtk-clipboard.c are now conditional on this new option to be set. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1150 Signed-off-by:
Claudio Fontana <cfontana@suse.de> Acked-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Jim Fehlig <jfehlig@suse.com> Message-Id: <20221121135538.14625-1-cfontana@suse.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Oct 24, 2022
-
-
Volker Rümelin authored
Commit 8f9abdf5 ("chardev: src buffer const for write functions") changed the type of the second parameter of qemu_chr_be_write() from uint8_t * to const uint8_t *. Remove the now useless type casts from qemu_chr_be_write() function calls in ui/console.c and ui/gtk.c. Cc: qemu-trivial@nongnu.org Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Claudio Fontana <cfontana@suse.de> Message-Id: <20221022141204.29358-1-vr_qemu@t-online.de> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Oct 12, 2022
-
-
Bryce Mills authored
The patch adds "show_menubar" command line option for GTK UI similar to "show_tabs". This option allows to hide menu bar initially, it still can be toggled by shortcut and other shortcuts still work. Signed-off-by:
Bryce Mills <brycemills@proton.me> Acked-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <NWO_zx1CT5Aj9vAXsRlqBppXd63gcKwL9V1qM1Meh36M_9tCw-EsCnfpvONXhHjmtKIUoSuCy9OO6cHS7M8b0oHBOCZG6f1jZ4Q2tqgI2Qo=@proton.me> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Akihiko Odaki authored
Although the grab menu item represents the tabbed displays, the old implicit mouse ungrabbing logic changes the grab menu item even for an untabbed display. Leave the grab menu item when implicitly ungrabbing mouse for an untabbed display. The new ungrabbing logic introduced in gd_mouse_mode_change() strictly follows the corresponding grabbing logic found in gd_button_event(). Signed-off-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20221008140116.11473-1-akihiko.odaki@daynix.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Jul 19, 2022
-
-
Felix xq Queißner authored
The patch adds "show_tabs" command line option for GTK ui similar to "grab_on_hover". This option allows tabbed view mode to not have to be enabled by hand at each start of the VM. Signed-off-by:
Felix "xq" Queißner <xq@random-projects.net> Reviewed-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Message-Id: <20220712133753.18937-1-xq@random-projects.net> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Jun 14, 2022
-
-
Akihiko Odaki authored
This change adds a new member, refresh_rate to QemuUIInfo in include/ui/console.h. It represents the refresh rate of the physical display backend, and it is more appropriate than GUI update interval as the refresh rate which the emulated device reports: - sdl may set GUI update interval shorter than the refresh rate of the physical display to respond to user-generated events. - sdl and vnc aggressively changes GUI update interval, but a guests is typically not designed to respond to frequent refresh rate changes, or frequent "display mode" changes in general. The frequency of refresh rate changes of the physical display backend matches better to the guest's expectation. QemuUIInfo also has other members representing "display mode", which makes it suitable for refresh rate representation. It has a throttling of update notifications, and prevents frequent changes of the display mode. Signed-off-by:
Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20220226115516.59830-3-akihiko.odaki@gmail.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Mar 18, 2022
-
-
K. Lange authored
GTK already produces corresponding GDK_BUTTON_PRESS events alongside 2BUTTON and 3BUTTON_PRESS events. The 2BUTTON and 3BUTTON_PRESS events were incorrectly being interpreted and passed to guests as button release events. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/558 Signed-off-by:
K. Lange <klange@toaruos.org> Message-Id: <20220305104521.3583703-1-klange@toaruos.org> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Mar 14, 2022
-
-
Marc-André Lureau authored
As expected from the "compatible_dcl" comment, a simple comparison of ops isn't enough. The following patch will fix a regression introduced by this limited check by extending the compatibility callback for egl-headless. For now, this patch simply replaces the the "compatible_dcl" ops pointer with a "dpy_gl_ctx_is_compatible_ctx" callback. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Jan 13, 2022
-
-
Dmitry Petrov authored
Signed-off-by:
Dmitry Petrov <dpetroff@gmail.com> Message-Id: <20220108153947.171861-4-dpetroff@gmail.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Dec 21, 2021
-
-
Marc-André Lureau authored
This will allow to have one GL context but a variable number of listeners. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Marc-André Lureau authored
GraphicHw.gl_flushed was introduced to notify the device (vhost-user-gpu) that the GL resources (the display scanout) are no longer needed. It was decoupled from QEMU own gl-blocking mechanism, but that difference isn't helping. Instead, we can reuse QEMU gl-blocking and notify virtio_gpu_gl_flushed() when unblocking (to unlock vhost-user-gpu). An extra block/unblock is added arount dpy_gl_update() so existing backends that don't block will have the flush event handled. It will also help when there are no backends associated. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Marc-André Lureau authored
Consoles can have an associated GL context, without listeners (they may be added or removed later on). Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Marc-André Lureau authored
A remote client, such as Spice, will already avoid flooding the stream by delaying the resize requests. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Nov 22, 2021
-
-
Dongwon Kim authored
The dmabuf often becomes invalid right after unblocking pipeline and graphic_hw_gl_flushed in case a new scanout blob is submitted because the dmabuf associated with the current guest scanout is freed after swapping. So both graphic_hw_gl_block and graphic_hw_gl_flushed should be executed after closing fence_fd for the current dmabuf. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com> Signed-off-by:
Dongwon Kim <dongwon.kim@intel.com> Message-Id: <20211121172237.14937-1-dongwon.kim@intel.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Alexander Orzechowski authored
Signed-off-by:
Alexander Orzechowski <orzechowski.alexander@gmail.com> Message-Id: <20211121065504.29101-3-orzechowski.alexander@gmail.com> [ kraxel: codestyle fix ] Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Nov 05, 2021
-
-
Dongwon Kim authored
gd_draw_event shouldn't try to repaint if surface does not exist for the VC. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by:
Dongwon Kim <dongwon.kim@intel.com> Message-Id: <20211104065153.28897-4-dongwon.kim@intel.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Dongwon Kim authored
An old esurface should be destroyed and set to be NULL when doing un-tab and re-tab so that a new esurface an context can be created for the window widget that those will be bound to. v2: enabling opengl specific routines only when CONFIG_OPENGL is set Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by:
Dongwon Kim <dongwon.kim@intel.com> Signed-off-by:
Khairul Anuar Romli <khairul.anuar.romli@intel.com> Message-Id: <20211104065153.28897-1-dongwon.kim@intel.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Sep 15, 2021
-
-
Vivek Kasireddy authored
Instead of immediately drawing and submitting, queue and wait for the draw signal if the dmabuf submitted is a blob. Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Gerd Hoffmann <kraxel@redhat.com> Signed-off-by:
Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210914211837.3229977-5-vivek.kasireddy@intel.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Vivek Kasireddy authored
Create sync objects and fences only for dmabufs that are blobs. Once a fence is created (after glFlush) and is signalled, graphic_hw_gl_flushed() will be called and virtio-gpu cmd processing will be resumed. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by:
Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210914211837.3229977-4-vivek.kasireddy@intel.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Vivek Kasireddy authored
Since the texture release mechanism is same for both gtk-egl and gtk-glarea, move the helper from gtk-egl to common gtk code so that it can be shared by both gtk backends. Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Gerd Hoffmann <kraxel@redhat.com> Signed-off-by:
Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210914211837.3229977-2-vivek.kasireddy@intel.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Aug 10, 2021
-
-
Volker Rümelin authored
Commit 584af1f1 ("ui/gtk: add a keyboard fifo to the VTE consoles") changed the VTE chardev backend code to rely on the chr_accept_input() callback function. The code expects a chr_accept_input() call whenever qemu_chr_be_can_write() bytes were written. It turns out this is wrong. Some chardev frontends only call this callback after can_write was 0. Change the code to send data until the keyboard fifo is empty or qemu_chr_be_can_write() returns 0. Fixes: 584af1f1 ("ui/gtk: add a keyboard fifo to the VTE consoles") Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210810063257.17411-1-vr_qemu@t-online.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Jul 26, 2021
-
-
Volker Rümelin authored
Since commit 8eb13bbb ("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: 8eb13bbb ("ui/gtk: vte: fix sending multiple characeters") Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210725165039.5242-1-vr_qemu@t-online.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Dennis Wölfing authored
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). Signed-off-by:
Dennis Wölfing <denniswoelfing@gmx.de> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210720143940.291413-1-denniswoelfing@gmx.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-