Fix ESC key handling in Save dialog.

Closing unsaved dive raises Save dialog with Yes/No/Cancel buttons.
Pressing ESC dismisses dialog without saving changes.

This commit adds GTK_RESPONSE_DELETE_EVENT response code check in order
to fix that behavior.

Reported-by: Jan Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Sergey Starosek 2013-03-03 11:32:56 +02:00 committed by Dirk Hohndel
parent 950436eba9
commit 0e7f0cc1ed

View file

@ -238,7 +238,7 @@ static gboolean ask_save_changes()
gint outcode = gtk_dialog_run(GTK_DIALOG(dialog));
if (outcode == GTK_RESPONSE_ACCEPT) {
file_save(NULL,NULL);
} else if (outcode == GTK_RESPONSE_CANCEL) {
} else if (outcode == GTK_RESPONSE_CANCEL || outcode == GTK_RESPONSE_DELETE_EVENT) {
quit = FALSE;
}
gtk_widget_destroy(dialog);