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.
This commit is contained in:
Christophe Fergeau 2014-02-06 10:07:14 +01:00
parent fe167a6668
commit eb65226a9d

View File

@ -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) {