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

Pavel Grunt pgrunt at redhat.com
Wed Feb 3 11:47:09 UTC 2016


On Wed, 2016-02-03 at 08:48 -0200, Eduardo Lima (Etrunko) wrote:
> On 02/03/2016 06:11 AM, Pavel Grunt wrote:
> > 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.
> 
> It just occurred to me if this will have any impact with VNC display.

vnc is calling another function - virt_viewer_display_set_desktop_size,
which also calls gtk_widget_queue_resize() and emits the signal.

> Have you tested this path?

Yes, I tested it, works. 

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 4bfa29b..654cada 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);
> > 
> 
> Acked-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
> 




More information about the virt-tools-list mailing list