[Scummvm-git-logs] scummvm master -> 7e8f697d189eb76a7a94460f205b2f7e389f50d0

dreammaster noreply at scummvm.org
Mon Feb 2 10:06:55 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
7e8f697d18 BAGEL: MFC: Fix Enter/Escape behaviour in dialogs with no default buttons


Commit: 7e8f697d189eb76a7a94460f205b2f7e389f50d0
    https://github.com/scummvm/scummvm/commit/7e8f697d189eb76a7a94460f205b2f7e389f50d0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-02-02T21:06:36+11:00

Commit Message:
BAGEL: MFC: Fix Enter/Escape behaviour in dialogs with no default buttons

Changed paths:
    NEWS.md
    engines/bagel/mfc/dialog.cpp


diff --git a/NEWS.md b/NEWS.md
index 32d84604aae..148d9ea80ec 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -12,6 +12,9 @@ For a more comprehensive changelog of the latest experimental code, see:
    - Fixed numerous bugs in Ripley
    - Fixed some bugs in Orion Burger
 
+ Bagel:
+   - Fix Enter/Escape keys in The Guessing Game guess dialog
+
  MM:
    - Fixed M&M1 memory corruption on exit.
    - Fixed M&M1 display issues/corruption getting items from treasure chests.
diff --git a/engines/bagel/mfc/dialog.cpp b/engines/bagel/mfc/dialog.cpp
index 8969309c5d9..1dd115b8a9f 100644
--- a/engines/bagel/mfc/dialog.cpp
+++ b/engines/bagel/mfc/dialog.cpp
@@ -385,8 +385,11 @@ bool CDialog::handleEnterKey(LPMSG lpMsg) {
 
 	// Find default push button
 	CButton *pDefault = GetDefaultPushButton();
-	if (!pDefault)
-		return false;
+	if (!pDefault) {
+		// No default button, so go ahead and close dialog
+		OnOK();
+		return true;
+	}
 
 	if (!pDefault->IsWindowEnabled())
 		// consume Enter, do nothing
@@ -398,8 +401,15 @@ bool CDialog::handleEnterKey(LPMSG lpMsg) {
 }
 
 bool CDialog::handleEscapeKey(LPMSG lpMsg) {
+	// Get the default Cancel button
 	CButton *pCancel = dynamic_cast<CButton *>(GetDlgItem(IDCANCEL));
-	if (!pCancel || !pCancel->IsWindowEnabled())
+	if (!pCancel) {
+		// No button, so close directly
+		OnCancel();
+		return true;
+	}
+
+	if (!pCancel->IsWindowEnabled())
 		return true;
 
 	sendButtonClicked(pCancel);




More information about the Scummvm-git-logs mailing list