[virt-tools-list] [PATCH virt-viewer 10/12] kiosk: don't open extra monitors

Daniel P. Berrange berrange at redhat.com
Thu Aug 15 14:48:16 UTC 2013


On Mon, Jul 15, 2013 at 09:36:17PM +0200, Marc-André Lureau wrote:
> In kiosk mode, we don't want new monitors windows that wouldn't fit on
> the client monitors to come up. # Please enter the commit message for
> your changes. Lines starting # with '#' will be ignored, and an empty
> message aborts the commit. # On branch kiosk # Changes to be committed:
> src/virt-viewer-app.c # # Changes not staged for commit: # (use "git add
> <file>..." to update what will be committed) # (use "git checkout --
> <file>..." to discard changes in working directory) # # modified:
> src/virt-viewer-app.c # modified: src/virt-viewer-display-spice.c #
> modified: src/virt-viewer-window.c # # Untracked files: # (use "git add
> <file>..." to include in what will be committed) # # AUTHORS

Scrambled commit message.

> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index 86ebdad..9692f2c 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -721,8 +721,15 @@ virt_viewer_app_display_added(VirtViewerSession *session G_GNUC_UNUSED,
>      if (nth == 0) {
>          window = priv->main_window;
>      } else {
> -        g_return_if_fail(virt_viewer_app_get_nth_window(self, nth) == NULL);
> -        window = virt_viewer_app_window_new(self, nth);
> +        window = virt_viewer_app_get_nth_window(self, nth);
> +        if (window == NULL) {
> +            if (priv->kiosk) {
> +                /* don't show extra monitors that don't fit on client */
> +                g_object_unref(display);
> +                return;
> +            } else
> +                window = virt_viewer_app_window_new(self, nth);

If one 1/2 of an if/else uses  {}, then is is preferrable to use
them for both 1/2s

> +        }
>      }

What happens from the guests' POV with this. It seems like if the guest
configured a 3rd monitor and we don't display the window, then the guest
will be left with an invisible monitor. Should we not tell the guest
agent to disable the monitor we're not wanting to show, so the guest
does not end up with an invisible monitor.


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