From 0d91d4d7ce310b7ab47c0138a569c833e4a7afdc Mon Sep 17 00:00:00 2001
From: jsalmon3 <>
Date: Wed, 5 Mar 2003 05:10:03 +0000
Subject: [PATCH] Fixed bug #697747: buttons in button panel were drawn clicked
 when clicking in the menu

---
 src/ui/menu_proc.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/ui/menu_proc.cpp b/src/ui/menu_proc.cpp
index 452f5efb5..6b941a2b5 100644
--- a/src/ui/menu_proc.cpp
+++ b/src/ui/menu_proc.cpp
@@ -2062,10 +2062,11 @@ global void EndMenu(void)
     MustRedraw = RedrawEverything;
     PopMenu();
 
-    if (!CurrentMenu && Callbacks!=&GameCallbacks) {
-	InterfaceState=IfaceStateNormal;
-	Callbacks=&GameCallbacks;
-	GamePaused=0;
+    if (!CurrentMenu && Callbacks != &GameCallbacks) {
+	InterfaceState = IfaceStateNormal;
+	Callbacks = &GameCallbacks;
+	GamePaused = 0;
+	UIHandleMouseMove(CursorX, CursorY);
     }
 }
 
@@ -2101,6 +2102,7 @@ global void ProcessMenu(const char *menu_id, int loop)
 	InterfaceState = IfaceStateMenu;
     }
 
+    ButtonUnderCursor = -1;
     VideoLockScreen();
     HideAnyCursor();
     VideoUnlockScreen();