color dialog: Handle Escape better

Closing the dialog by hitting Escape should
have the same effect as clicking the cancel
button. Make it so.
This commit is contained in:
Matthias Clasen 2022-11-24 10:29:03 -05:00
parent 4fa53bd041
commit ff14c51950

View File

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