From 6a759b714129468cd1cd7b081cd795697c7a16e8 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 18 Oct 2017 04:24:29 -0400 Subject: MqApplication, MqWindow: Focus on OK button of quit/close warning dialogs --- (limited to 'src') diff --git a/src/application.c b/src/application.c index 13fba19..c11d52c 100644 --- a/src/application.c +++ b/src/application.c @@ -164,6 +164,8 @@ mq_application_quit(MqApplication *application, GtkWindow *parent) hbox); g_signal_connect(dialog, "response", G_CALLBACK(quit_confirm_response_cb), NULL); + gtk_widget_grab_focus(gtk_dialog_get_widget_for_response( + GTK_DIALOG(dialog), GTK_RESPONSE_OK)); gtk_widget_show_all(dialog); return; diff --git a/src/window.c b/src/window.c index 8456c9f..b1fc251 100644 --- a/src/window.c +++ b/src/window.c @@ -136,6 +136,8 @@ delete_event_cb(GtkWindow *widget, GdkEvent G_GNUC_UNUSED *event, hbox); g_signal_connect(dialog, "response", G_CALLBACK(close_confirm_response_cb), window); + gtk_widget_grab_focus(gtk_dialog_get_widget_for_response( + GTK_DIALOG(dialog), GTK_RESPONSE_OK)); gtk_widget_show_all(dialog); return TRUE; -- cgit v0.9.1