diff options
| author | Christophe Fergeau <cfergeau@redhat.com> | 2014-02-06 10:07:14 +0100 |
|---|---|---|
| committer | Christophe Fergeau <cfergeau@redhat.com> | 2014-03-14 09:01:31 +0100 |
| commit | eb65226a9db87ee3afa1cd6b6b24057bca6ee2ba (patch) | |
| tree | 8e64b8a20bf53f12816ed023b2b01884b3d0789a /src | |
| parent | fe167a6668a131c6182f749c826e52046607cb6f (diff) | |
| download | virt-viewer-eb65226a9db87ee3afa1cd6b6b24057bca6ee2ba.tar.gz virt-viewer-eb65226a9db87ee3afa1cd6b6b24057bca6ee2ba.tar.xz virt-viewer-eb65226a9db87ee3afa1cd6b6b24057bca6ee2ba.zip | |
Don't show 'do you want to quit' dialog in kiosk mode
In some situation, (for example, guest without vdagent running), it's
possible to pass key combinations to virt-viewer. When using alt+f4,
this can cause the 'do you want to quit?' dialog to show while it's
non-functional.
This commit moves the check for kiosk mode to before we show this dialog.
Diffstat (limited to 'src')
| -rw-r--r-- | src/virt-viewer-app.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c index 9b3bacc..718c124 100644 --- a/src/virt-viewer-app.c +++ b/src/virt-viewer-app.c @@ -252,13 +252,9 @@ static void virt_viewer_app_quit(VirtViewerApp *self) { g_return_if_fail(VIRT_VIEWER_IS_APP(self)); + g_return_if_fail(!self->priv->kiosk); 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) { @@ -367,6 +363,11 @@ virt_viewer_app_maybe_quit(VirtViewerApp *self, VirtViewerWindow *window) { GError *error = NULL; + if (self->priv->kiosk) { + g_warning("The app is in kiosk mode and can't quit"); + return; + } + gboolean ask = g_key_file_get_boolean(self->priv->config, "virt-viewer", "ask-quit", &error); if (error) { |
