[Scummvm-git-logs] scummvm master -> e72c1fe4b0827534d1056dec5c84004fa6e7d593

sev- noreply at scummvm.org
Sat Sep 27 22:28:43 UTC 2025


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

Summary:
2c8615d8b7 GRAPHICS: MACGUI: Added sanity checks to getWindow()
37f0ef950d GRAPHICS: MACGUI: Invoke callback on activating/deactivating windows
723c78b0e6 DIRECTOR: Implement 'on activate/deactivateWindow' D5+ events
1bb5f3d996 GRAPHICS: MACGUI: Invoke callback for moving/resizing windows
e72c1fe4b0 DIRECTOR: Implement 'on move/resize/zoomWindow' D5+ events


Commit: 2c8615d8b7707f013f31b93755c47e465b5b3eaf
    https://github.com/scummvm/scummvm/commit/2c8615d8b7707f013f31b93755c47e465b5b3eaf
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-28T00:17:36+02:00

Commit Message:
GRAPHICS: MACGUI: Added sanity checks to getWindow()

Changed paths:
    graphics/macgui/macwindowmanager.h


diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h
index 466f966b135..783ae94877c 100644
--- a/graphics/macgui/macwindowmanager.h
+++ b/graphics/macgui/macwindowmanager.h
@@ -282,7 +282,11 @@ public:
 	 * @param id The id of the desired window.
 	 * @return Pointer to the requested window, if it exists.
 	 */
-	BaseMacWindow *getWindow(int id) { return _windows[id]; }
+	BaseMacWindow *getWindow(int id) {
+		if (id >= 0 && id < _windows.size())
+			return _windows[id];
+		return nullptr;
+	}
 
 	/**
 	 * Retrieve the patterns used to fill surfaces.


Commit: 37f0ef950d5764dc8bdbeb6c95a526e18437aec9
    https://github.com/scummvm/scummvm/commit/37f0ef950d5764dc8bdbeb6c95a526e18437aec9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-28T00:17:36+02:00

Commit Message:
GRAPHICS: MACGUI: Invoke callback on activating/deactivating windows

Changed paths:
    graphics/macgui/macwindow.cpp
    graphics/macgui/macwindow.h


diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index fc9f1a67e8f..b42d66a82b4 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -121,9 +121,18 @@ const Font *MacWindow::getTitleFont() {
 }
 
 void MacWindow::setActive(bool active) {
+	bool changed = (active != _active);
+
 	MacWidget::setActive(active);
 
 	_borderIsDirty = true;
+
+	if (changed) {
+		WindowClick click = active ? kBorderActivate : kBorderDeactivate;
+		Common::Event event;
+		if (_callback)
+			_callback(click, event, _dataPtr);
+	}
 }
 
 bool MacWindow::isActive() const { return _active; }
diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h
index 859880678b6..c0513050af0 100644
--- a/graphics/macgui/macwindow.h
+++ b/graphics/macgui/macwindow.h
@@ -57,7 +57,9 @@ enum WindowClick {
 	kBorderCloseButton,
 	kBorderInner,
 	kBorderBorder,
-	kBorderResizeButton
+	kBorderResizeButton,
+	kBorderActivate,
+	kBorderDeactivate,
 };
 
 enum {


Commit: 723c78b0e68b5b681c98d99004c9870782d667b6
    https://github.com/scummvm/scummvm/commit/723c78b0e68b5b681c98d99004c9870782d667b6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-28T00:17:36+02:00

Commit Message:
DIRECTOR: Implement 'on activate/deactivateWindow' D5+ events

Currently, because of a dirty hack with '_backgroundWindow' in
MacWindowManager, it is impossible to deactivate windows by
clicking on Stage. This will be fixed eventually

Changed paths:
    engines/director/events.cpp


diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index b4be385ec92..4b5de1284b3 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -325,8 +325,6 @@ bool Movie::processEvent(Common::Event &event) {
 }
 
 bool Window::processWMEvent(Graphics::WindowClick click, Common::Event &event) {
-	// kEventActivateWindow
-	// kEventDeactivateWindow
 	// kEventMoveWindow
 	// kEventResizeWindow
 	// kEventZoomWindow
@@ -341,6 +339,14 @@ bool Window::processWMEvent(Graphics::WindowClick click, Common::Event &event) {
 		}
 		break;
 
+	case Graphics::kBorderActivate:
+		sendWindowEvent(kEventActivateWindow);
+		return true;
+
+	case Graphics::kBorderDeactivate:
+		sendWindowEvent(kEventDeactivateWindow);
+		return true;
+
 	default:
 		break;
 	}


Commit: 1bb5f3d9968d58574be7560af01d136b442fa8b2
    https://github.com/scummvm/scummvm/commit/1bb5f3d9968d58574be7560af01d136b442fa8b2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-28T00:17:36+02:00

Commit Message:
GRAPHICS: MACGUI: Invoke callback for moving/resizing windows

Changed paths:
    graphics/macgui/macwindow.cpp
    graphics/macgui/macwindow.h


diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index b42d66a82b4..047b9a70331 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -598,6 +598,12 @@ bool MacWindow::processEvent(Common::Event &event) {
 
 		break;
 	case Common::EVENT_LBUTTONUP:
+		if (_beingDragged || _beingResized) {
+			WindowClick click1 = _beingDragged ? kBorderDragged : kBorderResized;
+			if (_callback)
+				_callback(click1, event, _dataPtr);
+		}
+
 		_beingDragged = false;
 		_beingResized = false;
 
diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h
index c0513050af0..ce366c966ec 100644
--- a/graphics/macgui/macwindow.h
+++ b/graphics/macgui/macwindow.h
@@ -60,6 +60,9 @@ enum WindowClick {
 	kBorderResizeButton,
 	kBorderActivate,
 	kBorderDeactivate,
+	kBorderDragged,
+	kBorderResized,
+	kBorderMaximizeButton,
 };
 
 enum {


Commit: e72c1fe4b0827534d1056dec5c84004fa6e7d593
    https://github.com/scummvm/scummvm/commit/e72c1fe4b0827534d1056dec5c84004fa6e7d593
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-28T00:17:36+02:00

Commit Message:
DIRECTOR: Implement 'on move/resize/zoomWindow' D5+ events

However, zoomWindow is not possible to test now due to missing
functionality in MacGui

Changed paths:
    engines/director/events.cpp


diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 4b5de1284b3..1e70fa298c7 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -325,10 +325,6 @@ bool Movie::processEvent(Common::Event &event) {
 }
 
 bool Window::processWMEvent(Graphics::WindowClick click, Common::Event &event) {
-	// kEventMoveWindow
-	// kEventResizeWindow
-	// kEventZoomWindow
-
 	switch (click) {
 	case Graphics::kBorderCloseButton:
 		if (_currentMovie && event.type == Common::EVENT_LBUTTONUP) {
@@ -347,6 +343,21 @@ bool Window::processWMEvent(Graphics::WindowClick click, Common::Event &event) {
 		sendWindowEvent(kEventDeactivateWindow);
 		return true;
 
+	case Graphics::kBorderDragged:
+		sendWindowEvent(kEventMoveWindow);
+		return true;
+
+	case Graphics::kBorderResized:
+		sendWindowEvent(kEventResizeWindow);
+		return true;
+
+	case Graphics::kBorderMaximizeButton:
+		if (event.type == Common::EVENT_LBUTTONUP) {
+			sendWindowEvent(kEventZoomWindow);
+
+			return true;
+		}
+		break;
 	default:
 		break;
 	}




More information about the Scummvm-git-logs mailing list