[virt-tools-list] [PATCH 4/4] virt-viewer-window: Don't try to resize non visible windows

Daniel P. Berrange berrange at redhat.com
Wed Mar 7 10:25:46 UTC 2012


On Mon, Mar 05, 2012 at 04:22:10PM +0100, Hans de Goede wrote:
> Trying to resize not visible windows leads to the following being printed
> to the console:
> Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)'
> 
> This gets triggered by the gdk_screen_get_monitor_geometry() call in
> virt_viewer_window_resize()
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  src/virt-viewer-window.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index d80d760..70f88a6 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -106,6 +106,7 @@ struct _VirtViewerWindowPrivate {
>      gboolean grabbed;
>      gboolean before_saved;
>      GdkRectangle before_fullscreen;
> +    gboolean desktop_resize_pending;
>  
>      gint zoomlevel;
>      gboolean auto_resize;
> @@ -323,6 +324,10 @@ static void
>  virt_viewer_window_desktop_resize(VirtViewerDisplay *display G_GNUC_UNUSED,
>                                    VirtViewerWindow *self)
>  {
> +    if (!gtk_widget_get_visible(self->priv->window)) {
> +        self->priv->desktop_resize_pending = TRUE;
> +        return;
> +    }
>      virt_viewer_window_resize(self);
>  }
>  
> @@ -960,6 +965,11 @@ void
>  virt_viewer_window_show(VirtViewerWindow *self)
>  {
>      gtk_widget_show(self->priv->window);
> +
> +    if (self->priv->desktop_resize_pending) {
> +        virt_viewer_window_resize(self);
> +        self->priv->desktop_resize_pending = FALSE;
> +    }
>  }
>  
>  void

ACK

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the virt-tools-list mailing list