From c6f429627cc2c25362fd52f723ccb3aedcb50a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Fri, 19 Feb 2021 13:59:20 +0000 Subject: [PATCH] src: remove SIGINT handler after first firing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you press Ctrl-C while the auth dialog is active it gets ignored because calling g_application_quit() won't break out of the model g_dialog_run() call. By removing the SIGINT handler after first firing, we can at least let the user press Ctrl-C a second time to force quit. Signed-off-by: Daniel P. Berrangé --- src/virt-viewer-app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c index b20d11a..8f2d03b 100644 --- a/src/virt-viewer-app.c +++ b/src/virt-viewer-app.c @@ -308,10 +308,10 @@ virt_viewer_app_quit(VirtViewerApp *self) VIRT_VIEWER_SESSION_VM_ACTION_QUIT); } + priv->quitting = TRUE; if (priv->session) { virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session)); if (priv->connected) { - priv->quitting = TRUE; return; } } @@ -2125,7 +2125,7 @@ sigint_cb(gpointer data) else exit(EXIT_SUCCESS); - return G_SOURCE_CONTINUE; + return priv->quitting ? G_SOURCE_REMOVE : G_SOURCE_CONTINUE; } #endif