[virt-tools-list] [PATCH virt-viewer 1/3] Adjust zoom level when window is resized and guest cannot be resized

Pavel Grunt pgrunt at redhat.com
Fri May 22 07:45:28 UTC 2015


Hi Jonathon,

> Hi Pavel,
> 
> I must apologize. It seems that my cursory analysis of the situation
> while reviewing your last patch series was based on an incorrect
> assumption. I had assumed that it was caused by not tracking the zoom
> level properly. But it appears this is not really the cause. Sorry 
> about that.

No problem, I also found that - I tried to explain it in PATCH 3/3.

> 
> This patch series seems a bit too complex to me, so I spent a little
> time debugging some things, and I *think* I understand the root of 
> the
> problem now. 
I thought it would be easy to fix but then I needed all this to solve
it. I filed a bug [0] for "not tracking zoom level" and I will solve
it separately.

> 
> In virt_viewer_window_resize(), we initially get the "desktop size" 
> of
> the display, and we scale that by the zoom level to determine how big
> the display can be. The implication is that this "desktop size" is 
> equal
> to the current resolution of the guest. (These "desktop size" 
> variables
> are also used in virt_viewer_display_get_preferred_size() to 
> calculate
> what the size request of the widget should be). In other words, the
> desktop size should only be changed when we get a notification from 
> the
> guest informing us that its resolution has changed. However, later 
> on in
> virt_viewer_window_resize(), we call
> virt_viewer_display_set_desktop_size() and change the size of the
> desktop to the size that we calculated for the display. This seems 
> like
> a bug to me. We should not be setting the desktop size without a
> notification from the guest.
> 
> In my case, while testing a VNC guest with a resolution of 1283x962, 
> the
> virt_viewer_window_resize() changed the desktop size to 700x525. Then
> when resetting the zoom level to 100%, it used 700x525 as the desktop
> size to calculate size request for the display widget. Since the 
> guest
> resolution was actually 1283x962, we ended up scaling a 1283x962 
> display
> into a 700x525 widget, resulting in a tiny zoomed-out display. 
PATCH 3/3 solves this - it changes the zoom instead of desktop
dimensions
> 
> When I removed the call to virt_viewer_display_set_desktop_size() in
> virt_viewer_window_resize(), things seemed to work properly. But I
> didn't test thoroughly so I don't know if it might introduce other
> regressions. 
> 
> Thoughts?
> 
> Jonathon
> 
It would be possible to resize spice guest to be bigger than the
client's monitor. This is not allowed now - currently when you try to
resize the window to exceed size of the monitor (e.g. to expand the
window to fit in more monitors) it will be resized to fit within just
one monitor (I thought it was intentional because of the comment above
'virt_viewer_window_resize').

Thanks,
Pavel

[0] https://bugs.freedesktop.org/show_bug.cgi?id=90582




More information about the virt-tools-list mailing list