[virt-tools-list] [PATCH virt-viewer] display: Set value of desktop width and height property directly

Pavel Grunt pgrunt at redhat.com
Tue Feb 2 12:59:25 UTC 2016


Hi,

On Tue, 2016-02-02 at 09:47 -0200, Eduardo Lima (Etrunko) wrote:
> On 01/27/2016 03:33 PM, Pavel Grunt wrote:
> > Avoid calling gtk_widget_queue_resize() and emitting
> > the "display-desktop-resize" signal.
> 
> Just curious about why this change is necessary? I mean, isn't this
> signal necessary somewhere else? I see it is handled in
> VirtViewerWindow.
> 
these properties are only used
by virt_viewer_display_spice_set_desktop() which will emit the signal
and call the function. I want to prevent multiple calls
to virt_viewer_display_queue_resize() when changing both properties.

> If so, please provide some more details in the commit message.

what about:

    display: Set value of desktop width and height property directly

    Avoid calling gtk_widget_queue_resize() and emiting
    the "display-desktop-resize" signal.
    The only user of the properties is
virt_viewer_display_spice_set_desktop()
    which will call the function and emit the signal after setting both
    "desktop-width" and "desktop-height" properties.

Pavel

> 
> > ---
> >  src/virt-viewer-display.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> > 
> > diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c
> > index d1b088e..af1fe01 100644
> > --- a/src/virt-viewer-display.c
> > +++ b/src/virt-viewer-display.c
> > @@ -301,14 +301,10 @@ virt_viewer_display_set_property(GObject
> > *object,
> >  
> >      switch (prop_id) {
> >      case PROP_DESKTOP_WIDTH:
> > -        virt_viewer_display_set_desktop_size(display,
> > -                                             g_value_get_int(value
> > ),
> > -                                             priv->desktopHeight);
> > +        priv->desktopWidth = g_value_get_int(value);
> >          break;
> >      case PROP_DESKTOP_HEIGHT:
> > -        virt_viewer_display_set_desktop_size(display,
> > -                                             priv->desktopWidth,
> > -                                             g_value_get_int(value
> > ));
> > +        priv->desktopHeight = g_value_get_int(value);
> >          break;
> >      case PROP_NTH_DISPLAY:
> >          priv->nth_display = g_value_get_int(value);
> > 
> 
> 




More information about the virt-tools-list mailing list