[Spice-devel] [spice-gtk v2] Spice-widget: Allow smaller widget with scaling enabled

Pavel Grunt pgrunt at redhat.com
Fri Apr 22 11:24:30 UTC 2016


Hi Javier,

Acked-by: Pavel Grunt <pgrunt at redhat.com>

On Fri, 2016-04-22 at 10:08 +0200, Javier Celaya wrote:
> When resize-guest-to-match-window-size is disabled, the size request
> (minimum size) of the spice widget is set to the current guest
> resolution. The client window cannot be made smaller, even with
> scale-display enabled.
> 
> This patch sets a size request of 640x480 when either
> resize-guest-to-match-window-size OR scale-display are enabled, making
> it posible to shrink the window and scale down the display.
> ---
>  src/spice-widget.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index 6f638fb..a7f31c4 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -169,6 +169,8 @@ static void spice_display_get_property(GObject    *object,
>      }
>  }
>  
> +static void update_size_request(SpiceDisplay *display);
> +
I will move the declaration up so it is groupped with other declaration and push
the patch.

Thanks,
Pavel


>  static void scaling_updated(SpiceDisplay *display)
>  {
>      SpiceDisplayPrivate *d = display->priv;
> @@ -178,6 +180,7 @@ static void scaling_updated(SpiceDisplay *display)
>      if (d->ximage && window) { /* if not yet shown */
>          gtk_widget_queue_draw(GTK_WIDGET(display));
>      }
> +    update_size_request(display);
>  }
>  
>  static void update_size_request(SpiceDisplay *display)
> @@ -185,7 +188,7 @@ static void update_size_request(SpiceDisplay *display)
>      SpiceDisplayPrivate *d = display->priv;
>      gint reqwidth, reqheight;
>  
> -    if (d->resize_guest_enable) {
> +    if (d->resize_guest_enable || d->allow_scaling) {
>          reqwidth = 640;
>          reqheight = 480;
>      } else {


More information about the Spice-devel mailing list