[virt-tools-list] [PATCH virt-viewer 16/19] Wait until idle handler has run to mark dirty = FALSE

Christophe Fergeau cfergeau at redhat.com
Tue Jul 17 13:01:26 UTC 2012


On Mon, Jul 16, 2012 at 06:57:51PM +0200, Marc-André Lureau wrote:
> This can avoid having multiple idler added
> ---
>  src/virt-viewer-display.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c
> index 18fed19..004f027 100644
> --- a/src/virt-viewer-display.c
> +++ b/src/virt-viewer-display.c
> @@ -326,6 +326,7 @@ virt_viewer_display_idle(gpointer opaque)
>      VirtViewerDisplayPrivate *priv = display->priv;
>      if (!priv->dirty)
>          gtk_widget_queue_resize_no_redraw(GTK_WIDGET(display));
> +    priv->dirty = FALSE;

priv->dirty is only set to FALSE in the place you changed, this means that
after your change the
if (!priv->dirty)
    gtk_widget_queue_resize_no_redraw(GTK_WIDGET(display));
just above will never run.
I think the intent of this code is this:
'queue an idle to do the resize, but use dirty to know about size changes
happening between the time the idle was queued and the time the idle runs'

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20120717/8d542ddc/attachment.sig>


More information about the virt-tools-list mailing list