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

Javier Celaya javier.celaya at flexvdi.com
Fri Apr 22 06:06:45 UTC 2016


Can someone review this patch, please?
Thank you

El 13/04/16 a las 13:42, Javier Celaya escribió:
> With scaling enabled, the size request of the widget must be 640x480
> (the same as with resize_guest_enable) so that the widget can be
> actually scalled down.
> ---
>   src/spice-widget.c | 25 +++++++++++++------------
>   1 file changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index 6f638fb..f445f3f 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -169,23 +169,12 @@ static void spice_display_get_property(GObject    *object,
>       }
>   }
>   
> -static void scaling_updated(SpiceDisplay *display)
> -{
> -    SpiceDisplayPrivate *d = display->priv;
> -    GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(display));
> -
> -    recalc_geometry(GTK_WIDGET(display));
> -    if (d->ximage && window) { /* if not yet shown */
> -        gtk_widget_queue_draw(GTK_WIDGET(display));
> -    }
> -}
> -
>   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 {
> @@ -197,6 +186,18 @@ static void update_size_request(SpiceDisplay *display)
>       recalc_geometry(GTK_WIDGET(display));
>   }
>   
> +static void scaling_updated(SpiceDisplay *display)
> +{
> +    SpiceDisplayPrivate *d = display->priv;
> +    GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(display));
> +
> +    recalc_geometry(GTK_WIDGET(display));
> +    if (d->ximage && window) { /* if not yet shown */
> +        gtk_widget_queue_draw(GTK_WIDGET(display));
> +    }
> +    update_size_request(display);
> +}
> +
>   static void update_keyboard_focus(SpiceDisplay *display, gboolean state)
>   {
>       SpiceDisplayPrivate *d = display->priv;

-- 



<http://flexvdi.com><http://flexvdi.com>

Javier Celaya

Software Engineer

	

j <mailto:javier.celaya at flexvdi.com>avier.celaya at flexvdi.com

+34 876 60 00 73

@j_celaya

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160422/a86e5426/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo.flexvdi.png
Type: image/png
Size: 17075 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160422/a86e5426/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mail.png
Type: image/png
Size: 9350 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160422/a86e5426/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phone.png
Type: image/png
Size: 15099 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160422/a86e5426/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: skype.png
Type: image/png
Size: 14444 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160422/a86e5426/attachment-0007.png>


More information about the Spice-devel mailing list