fontdialog: 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:
Benjamin Otte 2022-12-22 22:17:45 +01:00 committed by Matthias Clasen
parent 381bb84f3d
commit 8d8e83afa2

View File

@ -562,7 +562,8 @@ response_cb (GTask *task,
} }
else if (response == GTK_RESPONSE_CLOSE) else if (response == GTK_RESPONSE_CLOSE)
g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED, "Cancelled by application"); g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED, "Cancelled 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_DISMISSED, "Dismissed by user"); g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED, "Dismissed by user");
else else
g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED, "Unknown failure (%d)", response); g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED, "Unknown failure (%d)", response);