[Scummvm-git-logs] scummvm master -> 281c89f05f88c98080626ece1be2e4a0e0572f5a

npjg nathanael.gentrydb8 at gmail.com
Thu Aug 13 04:05:48 UTC 2020


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

Summary:
281c89f05f GRAPHICS: MACGUI: Process windowed widget events


Commit: 281c89f05f88c98080626ece1be2e4a0e0572f5a
    https://github.com/scummvm/scummvm/commit/281c89f05f88c98080626ece1be2e4a0e0572f5a
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-13T00:05:32-04:00

Commit Message:
GRAPHICS: MACGUI: Process windowed widget events

This ensures the correct dimensions are passed to ensure widgets within windows
process their events properly.

Changed paths:
    graphics/macgui/macwindow.cpp


diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index 922a9452e9..b9dc94bff3 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -564,7 +564,7 @@ bool MacWindow::processEvent(Common::Event &event) {
 
 	switch (event.type) {
 	case Common::EVENT_MOUSEMOVE:
-		if (_wm->_mouseDown && _wm->_hoveredWidget && !_wm->_hoveredWidget->_dims.contains(event.mouse.x, event.mouse.y)) {
+		if (_wm->_mouseDown && _wm->_hoveredWidget && !_wm->_hoveredWidget->_dims.contains(_dims.left - event.mouse.x, _dims.top - event.mouse.y)) {
 			_wm->_hoveredWidget->setActive(false);
 			_wm->_hoveredWidget = nullptr;
 		}
@@ -634,7 +634,10 @@ bool MacWindow::processEvent(Common::Event &event) {
 		return false;
 	}
 
-	MacWidget *w = findEventHandler(event, _dims.left, _dims.top);
+	event.mouse.x -= _dims.left;
+	event.mouse.y -= _dims.top;
+
+	MacWidget *w = findEventHandler(event, -_dims.left + _innerDims.left, -_dims.top + _innerDims.top);
 	if (w && w != this) {
 		_wm->_hoveredWidget = w;
 




More information about the Scummvm-git-logs mailing list