[virt-tools-list] [PATCH virt-viewer 09/12] kiosk: prevent app to quit or window to hide

Daniel P. Berrange berrange at redhat.com
Thu Aug 15 14:45:37 UTC 2013


On Mon, Jul 15, 2013 at 09:36:16PM +0200, Marc-André Lureau wrote:
> ---
>  src/virt-viewer-app.c    | 5 +++++
>  src/virt-viewer-window.c | 5 +++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index ffcf451..86ebdad 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -247,6 +247,11 @@ virt_viewer_app_quit(VirtViewerApp *self)
>      g_return_if_fail(VIRT_VIEWER_IS_APP(self));
>      VirtViewerAppPrivate *priv = self->priv;
>  
> +    if (self->priv->kiosk) {
> +        g_warning("The app is in kiosk mode and can't quit");
> +        return;
> +    }
> +
>      virt_viewer_app_save_config(self);
>  
>      if (priv->session) {
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index f483027..5590443 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -1194,6 +1194,11 @@ virt_viewer_window_show(VirtViewerWindow *self)
>  void
>  virt_viewer_window_hide(VirtViewerWindow *self)
>  {
> +    if (self->priv->kiosk) {
> +        g_warning("Can't hide windows in kiosk mode");
> +        return;
> +    }
> +
>      gtk_widget_hide(self->priv->window);
>  
>      if (self->priv->display) {

Rather than logging warnings, can't we just not call these methods
when in kiosk mode ?

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