fontdialog: Handle Escape better
authorBenjamin Otte <otte@redhat.com>
Thu, 22 Dec 2022 21:17:45 +0000 (22:17 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 24 Dec 2022 12:56:57 +0000 (07:56 -0500)
Closing the dialog by hitting Escape should
have the same effect as clicking the cancel
button. Make it so.

gtk/gtkfontdialog.c

index fdf6b2310782354315ff7bf42a0814be38b8716f..878456d94d2eebb5438922284f078f748d68571a 100644 (file)
@@ -562,7 +562,8 @@ response_cb (GTask *task,
     }
   else if (response == GTK_RESPONSE_CLOSE)
     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");
   else
     g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED, "Unknown failure (%d)", response);