[Spice-devel] [spice-gtk] Spice-widget: Allow smaller widget with scaling enabled
Pavel Grunt
pgrunt at redhat.com
Fri Apr 22 07:19:12 UTC 2016
Hi Javier,
sorry, I must have missed the patch. Can you please explain the problem? How to
reproduce it? Is it about spicy?
About the patch - you should declare the update_size_request() function instead
of moving scaling_updated() down - it would be more clear what has changed.
Thanks,
Pavel
On Fri, 2016-04-22 at 08:06 +0200, Javier Celaya wrote:
> 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;
>
> --
>
>
> Javier Celaya Software Engineer javier.celaya at flexvdi.com
> +34 876 60 00 73 @j_celaya
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
More information about the Spice-devel
mailing list