[virt-tools-list] [PATCH virt-viewer 2/2] Don't try to re-configure displays when there are none

Christophe Fergeau cfergeau at redhat.com
Wed Oct 8 16:41:22 UTC 2014


Hey,

On Tue, Oct 07, 2014 at 01:30:04PM -0500, Jonathon Jongsma wrote:
> virt_viewer_session_on_monitor_geometry_changed() gets called
> immediately upon agent connection, but sometimes this is before any
> displays have been received. Simply return early when this is the case.

ACK (the iteration over self->priv->displays could probably be avoided
by checking whether it's NULL instead of testing nmonitors, but it's
probably more readable your way.)

Christophe

> ---
>  src/virt-viewer-session.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c
> index 4262eda..46ea34c 100644
> --- a/src/virt-viewer-session.c
> +++ b/src/virt-viewer-session.c
> @@ -362,6 +362,9 @@ virt_viewer_session_on_monitor_geometry_changed(VirtViewerSession* self,
>          nmonitors = MAX(nth + 1, nmonitors);
>      }
>  
> +    if (nmonitors == 0)
> +        return;
> +
>      monitors = g_new0(GdkRectangle, nmonitors);
>      for (l = self->priv->displays; l; l = l->next) {
>          VirtViewerDisplay *d = VIRT_VIEWER_DISPLAY(l->data);
> -- 
> 1.9.3
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20141008/842c21ba/attachment.sig>


More information about the virt-tools-list mailing list