If cairo (master branch and earlier as well) is compiled with xlib-xcb enabled, starting a VM in virt-manager will result in an integrated VNC/Spice viewer widget that stops updating after approx. 1 sec or less. Taking screenshots still works (with an actual up to date image) as well as connecting with the external Spice or VNC client (which then works just fine). After I waded through the sources of virt-manager to debug this, I finally figured the problem was rooted at a much lower level which lead me to cairo eventually. Once cairo is compiled without the xlib-xcb adapter, everything works just fine again. By the way, this happens with the following versions I tested: virt-manager: 1.0.1, 1.1.0 and master. libvirt: 1.2.6 and 1.2.9. spice-gtk: 0.25 and master qemu: 2.1.1 Kernel: 3.16.1 pygobject: 3.12.2 and master If there is anything I can do to help debug this further, please let me know.
Just for completeness, this is the bug report for virt-manager that I opened before I came to realize that this was a cairo problem: https://bugzilla.redhat.com/show_bug.cgi?id=1151830
This seems to be still present in cairo 1.14.2, any news on this bug? Thanks
Sigh. The bug is in spice. In `spike-gtk-0.25` (I'm looking at the version in debian testing), go to `gtk/spice-widget-cairo.c`, line 126. After the `if (d->ximage) {` add `cairo_surface_mark_dirty(d->ximage)` and see if that fixes the problem. It might also make everything die with an assertion failure. I cannot find any code that draws to the cairo image surface that is saved in `d->ximage`, but from what I see is that spice is modifying the image data inside of an image surface behind of cairo's back. Spice has to call `cairo_surface_flush()` before drawing directly to that data and `cairo_surface_mark_dirty()` or `cairo_surface_mark_dirty_area()` afterwards. Without this, cairo assumes that the pixel content of the image surface did not change and thus does some clever caching to speed things up. This might only break with `xlib-xcb`, but is still a bug in spice.
It seems like the function `invalidate()` in spice-widget.c gets notified about changes part of the image. I guess this should call `cairo_surface_mark_dirty_rectangle()` with the right arguments (directly the arguments of the function?).
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.