[Spice-devel] [PATCH spice-html5] If an agent is attached, enable dynamic resizing of the guest screen.

Jeremy White jwhite at codeweavers.com
Fri Sep 5 13:59:10 PDT 2014


On 09/05/2014 02:00 PM, Gianni Pirozzi wrote:
> Hello,
> I tried this patch and observed a great improvement in cursor positioning, thanks!
> But I'm confused about dynamic resizing of the guest screen, it seems too tied to the presentation.
> I'm using spice-html5 in a web application which has it's own layout replacing spice.html and spice.css, but I'm trying to keep my code apart and leave the distribution without changes.

Ah, great, thanks for doing this test.  I'm guilty of only testing this 
for my use case, and not examining any others.

> Ideally I would like to be able to set a size of my choice at instantiation, and control how subsequent resizing are triggered and to what amount (only if the agent is available of course).
> I see I can resize the guest screen using the resize_window method and it works, but I can't prevent automatic resizing.
> Also I can't understand why the height for automatic resizing is calculated that way (in function resize_helper), but I can see it depends on layout specific sizes like the message element height and position, and the window height.
> Wouldn't it be better to move the resize_helper to a layout specific file, e.g. in spice.html?

Yes, you are probably correct.  The issue is that there appears to be no 
way to have a vertical html element dynamically resize itself; all of my 
Google Fu pointed at a need to use Javascript to compute that.

I will explore moving that logic into spice.html from where it is; if 
that ends up feeling more logical, I'll respin the patch in that direction.

> In my tests with unmodified spice.html (Firefox 31, Windows 7 guests) I ended up many times with the canvas overflowing widely from the screen element. Requesting a resolution that is not among the choices in the Windows guest, sometimes has unpredictable results.

Note that it is quite likely a Windows guest is not going to play all 
that nicely with spice-html5; I'd keep an eye on the console to see if 
there are error messages there.  We're likely dropping a whole set of 
agent messages, some of which may be helpful.



More information about the Spice-devel mailing list