[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] [PATCH virt-viewer] spice: only autoresize once with screen size in fullscreen



This looks good, just a question below:

On Thu, Oct 18, 2012 at 12:48:36AM +0200, Marc-André Lureau wrote:
> It's currently not possible to configure guest with higher resolution
> than native, as it will switch back to native, since the gtk widget
> allocation will always end up being the size of the screen. We
> special-case fullscreen mode, and only resize when entering
> fullscreen. Furthermore, it avoids sending extra unnecessary resize
> events to the guest whenever gtk+ call size allocate in various
> stages, with different values.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=864929
> ---
>  src/virt-viewer-app.c           |  8 ++++++++
>  src/virt-viewer-app.h           |  1 +
>  src/virt-viewer-display-spice.c | 31 +++++++++++++++++++++++++++++--
>  3 files changed, 38 insertions(+), 2 deletions(-)
> 
> diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c
> index a035517..753e369 100644
> --- a/src/virt-viewer-display-spice.c
> +++ b/src/virt-viewer-display-spice.c
> @@ -189,6 +196,12 @@ virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self,
>      if (virt_viewer_display_get_show_hint(VIRT_VIEWER_DISPLAY(self)) & VIRT_VIEWER_DISPLAY_SHOW_HINT_DISABLED)
>          return;
>  
> +    if (self->priv->auto_resize == AUTO_RESIZE_FULLSCREEN) {
> +        GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(self));
> +        dw = gdk_screen_get_width(screen);
> +        dh = gdk_screen_get_height(screen);
> +    }
> +
>      if (virt_viewer_display_get_zoom(VIRT_VIEWER_DISPLAY(self))) {
>          zoom = virt_viewer_display_get_zoom_level(VIRT_VIEWER_DISPLAY(self));

After setting dw/dh to the size of the screen, we then apply the zoom level
to it. Are we guaranteed that zoom will disabled or less than 100 at this
point, or should we ignore zoom after going fullscreen?

Christophe

Attachment: pgp69MxLn8pah.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]