From ff14c5195058e6b165f70a91f8e43a60e6646174 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 24 Nov 2022 10:29:03 -0500 Subject: [PATCH] color dialog: Handle Escape better Closing the dialog by hitting Escape should have the same effect as clicking the cancel button. Make it so. --- gtk/gtkcolordialog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtkcolordialog.c b/gtk/gtkcolordialog.c index 8c09570df9..05b2f64a71 100644 --- a/gtk/gtkcolordialog.c +++ b/gtk/gtkcolordialog.c @@ -388,7 +388,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