From: Matthias Clasen Date: Thu, 24 Nov 2022 15:29:43 +0000 (-0500) Subject: file dialog: Handle Escape better X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~9^2~75^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e73f0f69748b94a23102472b69e0ca194923a24d;p=gtk4.git file dialog: Handle Escape better Closing the dialog by hitting Escape should have the same effect as clicking the cancel button. Make it so. --- 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);