Bug 104841 - display is corrupted on hidpi clients
Summary: display is corrupted on hidpi clients
Status: RESOLVED MOVED
Alias: None
Product: Spice
Classification: Unclassified
Component: spice-gtk (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Spice Bug List
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-29 18:56 UTC by Michael Chudobiak
Modified: 2018-06-03 10:20 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
correct lo-dpi screenshot (111.27 KB, image/png)
2018-01-29 18:56 UTC, Michael Chudobiak
Details
corrupted hi-dpi screenshot (470.09 KB, image/png)
2018-01-29 18:57 UTC, Michael Chudobiak
Details

Description Michael Chudobiak 2018-01-29 18:56:31 UTC
I'm running a Windows XP guest on a Fedora 27 host, with this command line:

/usr/bin/qemu-kvm -hda /var/lib/libvirt/images/MikeOfficeXP.img -usbdevice tablet -usb -device usb-host,hostbus=1,hostaddr=2 -device usb-host,hostbus=1,hostaddr=3 -parallel /dev/parport0 -m 4096 -k en-us -vga qxl -spice port=5931,disable-ticketing -net nic,model=rtl8139 -net user &

spicy renders this correctly on a standard lo-dpi monitor, but visible rendering artifacts are visible on the hi-dpi monitor. See the attached screenshots. The hi-dpi screenshot has twice the resolution in each axis, but weird horizontal lines appear in the central white space.
Comment 1 Michael Chudobiak 2018-01-29 18:56:57 UTC
Created attachment 137030 [details]
correct lo-dpi screenshot
Comment 2 Michael Chudobiak 2018-01-29 18:57:15 UTC
Created attachment 137031 [details]
corrupted hi-dpi screenshot
Comment 3 Michael Chudobiak 2018-01-29 19:06:35 UTC
Using
spice-gtk3-0.34-1.fc27.x86_64
qemu-kvm-2.10.1-2.fc27.x86_64
Comment 4 Frediano Ziglio 2018-01-30 11:38:48 UTC
I assume you are using a Fedora 27 as a client too.
Which resolutions are you trying?
Which environment/window manager are you using on the client?
Seems to be some issue with Gtk rendering.
Comment 5 Michael Chudobiak 2018-01-30 13:14:18 UTC
Yes, the lodpi client, hidpi client, and server are all Fedora 27 with stock gnome-shell/wayland. (The hidpi client used to have a lodpi monitor, and it worked fine.) 

All reasonable resolutions seem to exhibit the problem. The screenshots are for the 1440x900 Windows guest resolution. The hidpi client is at 3840x2160 (4k).
Comment 6 Frediano Ziglio 2018-01-30 16:24:05 UTC
Easy reproduction steps:
- launch a Windows machine (tried with XP and 7);
- set "export GDK_SCALE=2";
- launch remote-viewer;
- drag a window.
Note that forcing client redraw fix the issue, so it seems that when we redraw an area of the screen the border are not redrawn.
Note that the setting cause the remote machine to have half the size in pixel.
Comment 7 Michael Chudobiak 2018-04-03 17:56:00 UTC
Any chance of having this looked at? It is crippling on a hi-dpi monitor.
Comment 8 Frediano Ziglio 2018-04-04 10:38:18 UTC
This patch works:


diff --git a/src/spice-widget.c b/src/spice-widget.c
index 1e7add4..820509c 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -2598,10 +2598,10 @@ static void invalidate(SpiceChannel *channel,
     int x1, y1, x2, y2;
     double s;
     GdkRectangle rect = {
-        .x = x,
-        .y = y,
-        .width = w,
-        .height = h
+        .x = x - 1,
+        .y = y - 1,
+        .width = w + 2,
+        .height = h + 2
     };

 #if HAVE_EGL


seems a Gdk bug to me.
Comment 9 GitLab Migration User 2018-06-03 10:20:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/spice/spice-gtk/issues/19.


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.