Bilal Elmoussaoui 4f08953fb0 dmabuf: Avoid division by 0
When opening mks for an already running VM, the QEMU dbus backend has no
way to tell to the VM refresh the display and submit a new UpdateDMABuf.

So by the time size_allocate is called, the height and width of the paintable are
still set to 0.

This should fix the size allocate warning we see now until we figure out a proper
fix from the QEMU side.
2023-08-29 11:42:15 +02:00
2023-08-29 11:42:15 +02:00
2023-06-15 13:57:19 +02:00
2023-02-08 18:06:08 -08:00
2023-06-01 12:04:35 +01:00
2023-08-15 20:43:51 +00:00
2023-08-23 08:46:43 +02:00
2023-08-23 08:46:06 +02:00

libmks

This library provides a "Mouse, Keyboard, and Screen" to QEMU using the D-Bus device support in QEMU and GTK 4.

Documentation

Nightly documentation can be found here.

Unit testing

Be sure you have lcov package installed on your system if you want coverage data.

meson setup builddir
meson configure -Db_coverage=true builddir  # if you want to collect coverage data
meson compile -C builddir
meson test -C builddir --suit "libmks"
rm -rf builddir/subprojects  # if you don't want subprojects coverage in the report
ninja coverage-html -C builddir  # if you want to generate coverage report

If generated, coverage report will be in builddir/meson-logs/coveragereport/index.html

Testing

By default, QEMU will connect to your user session D-Bus if you do not provide an address for -display dbus. Therefore, it is pretty easy to test things by running QEMU manually and then connecting with the test program ./tools/mks.

qemu-img create -f qcow2 fedora.img 30G
qemu-system-x86_64 \
    -enable-kvm \
    -cpu host \
    -device virtio-vga-gl,xres=1920,yres=1080 \
    -m 8G \
    -smp 4 \
    -display dbus,gl=on \
    -cdrom Fedora-Workstation.iso \
    -hda fedora.img \
    -boot d

and then to run the test widget

meson setup build
cd build
ninja
./tools/mks
Description
This library provides a "Mouse, Keyboard, and Screen" to QEMU using the D-Bus device support in QEMU and GTK 4.
Readme 402 KiB
Languages
C 96.6%
Meson 3.2%
Shell 0.2%