[Scummvm-git-logs] scummvm master -> 06230993017990f8681cf9a09ccde6d9c10c41b5

sev- noreply at scummvm.org
Wed Jul 15 20:54:25 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:
0623099301 DIRECTOR: Fix mouseUp dispatching to wrong sprite in D4


Commit: 06230993017990f8681cf9a09ccde6d9c10c41b5
    https://github.com/scummvm/scummvm/commit/06230993017990f8681cf9a09ccde6d9c10c41b5
Author: ramyak-sharma (ramyaksharma1 at gmail.com)
Date: 2026-07-15T22:54:20+02:00

Commit Message:
DIRECTOR: Fix mouseUp dispatching to wrong sprite in D4

In D4, mouseUp was dispatched to the sprite from the original mouseDown
event instead of the sprite under the mouse at release. The version gate
that already did the right thing for D5+ now applies from D4 on; only D3
and earlier keep dispatching to the mouseDown sprite.

Also update the clickOn to reflect the sprite that received mouseUp, so
drop-target scripts can correctly identify the release channel.

Verified against original Director: the T_EVNT21 regression movie in
director-tests (D4-unit) presses mouseDown on one sprite, releases over
another, and asserts mouseUp fires on the release sprite. On master that
test fails; with this change it passes. The clickOn was already correct
on master, only the mouseUp dispatch needed fixing.

Fixes drag-and-drop in the Gus Goes to Cyberopolis post office minigame.

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 52ffb5e3cbc..14666676001 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -241,14 +241,20 @@ void Movie::resolveScriptEvent(LingoEvent &event) {
 			CastMemberID scriptId;
 			bool immediate = false;
 			Common::String initializerParams;
-			// mouseUp events seem to check the frame script ID from the original mouseDown event
-			// In Director 5 and above, we always generate event for the actual sprite under the mouse
-			if (((event.event == kEventMouseUp) || (event.event == kEventRightMouseUp)) && _vm->getVersion() < 500) {
+			// Before D4, mouseUp goes to the mouseDown sprite; from D4 on it goes
+			// to the sprite under the mouse at release (see T_EVNT21 in D4-unit).
+			if (((event.event == kEventMouseUp) || (event.event == kEventRightMouseUp)) && _vm->getVersion() < 400) {
 				scriptId = _currentMouseDownSpriteScriptID;
 				immediate = _currentMouseDownSpriteImmediate;
 			} else {
 				if (!event.channelId)
 					return;
+
+				// clickOn must reflect the release sprite so drop-target scripts
+				// can identify the channel
+				if ((event.event == kEventMouseUp || event.event == kEventRightMouseUp) && event.channelId)
+					_lastClickedSpriteId = event.channelId;
+
 				Frame *currentFrame = _score->_currentFrame;
 				assert(currentFrame != nullptr);
 				Sprite *sprite = _score->getSpriteById(event.channelId);




More information about the Scummvm-git-logs mailing list