From e73f0f69748b94a23102472b69e0ca194923a24d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 24 Nov 2022 10:29:43 -0500 Subject: [PATCH] file dialog: Handle Escape better Closing the dialog by hitting Escape should have the same effect as clicking the cancel button. Make it so. --- gtk/gtkfiledialog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtkfiledialog.c b/gtk/gtkfiledialog.c index a1ad1c9731..410da0b099 100644 --- a/gtk/gtkfiledialog.c +++ b/gtk/gtkfiledialog.c @@ -628,7 +628,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS } else if (response == GTK_RESPONSE_CLOSE) g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED, "Aborted by application"); - else if (response == GTK_RESPONSE_CANCEL) + else if (response == GTK_RESPONSE_CANCEL || + response == GTK_RESPONSE_DELETE_EVENT) g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED, "Cancelled by user"); else g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED, "Unknown failure (%d)", response); -- 2.30.2