[Scummvm-git-logs] scummvm branch-3-0 -> 6643021efc3d7339d1f5acc2b89c03b9f35d0cd9
sev-
noreply at scummvm.org
Fri Jan 2 22:28:49 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:
6643021efc GRAPHICS: MACGUI: Fix Beam cursor gets stuck after editable editable widget
Commit: 6643021efc3d7339d1f5acc2b89c03b9f35d0cd9
https://github.com/scummvm/scummvm/commit/6643021efc3d7339d1f5acc2b89c03b9f35d0cd9
Author: Armaan Singh Sandhu (sandhuc36 at gmail.com)
Date: 2026-01-02T23:28:25+01:00
Commit Message:
GRAPHICS: MACGUI: Fix Beam cursor gets stuck after editable editable widget
If the cursor is moved between the MacWindow and MacTextWindow the
cursor switches to beam and back but when you click in the MacTextWindow
the cursor gets stuck to beam no matter which window or menu you are
hovering over
Changed paths:
graphics/macgui/macwidget.cpp
graphics/macgui/macwidget.h
graphics/macgui/macwindowmanager.cpp
diff --git a/graphics/macgui/macwidget.cpp b/graphics/macgui/macwidget.cpp
index e04d8f98747..ab88ede6d0a 100644
--- a/graphics/macgui/macwidget.cpp
+++ b/graphics/macgui/macwidget.cpp
@@ -154,10 +154,23 @@ MacWidget *MacWidget::findEventHandler(Common::Event &event, int dx, int dy) {
}
Common::Point MacWidget::getAbsolutePos() {
- if (!_parent)
- return Common::Point(0, 0);
+ Common::Point absPoint = Common::Point(0, 0);
+ MacWidget *currentParent = _parent;
+ while (currentParent != nullptr) {
+ absPoint = Common::Point(currentParent->_dims.left, currentParent->_dims.top) + absPoint;
+ currentParent = currentParent->_parent;
+ }
+
+ return absPoint;
+}
+
+Common::Rect MacWidget::getAbsoluteDimensions() {
+ Common::Point absPos = getAbsolutePos();
+ Common::Rect dims = getDimensions();
+
+ dims.translate(absPos.x, absPos.y);
- return Common::Point(_parent->_dims.left, _parent->_dims.top) + _parent->getAbsolutePos();
+ return dims;
}
} // End of namespace Graphics
diff --git a/graphics/macgui/macwidget.h b/graphics/macgui/macwidget.h
index a1781f3a046..edba41dd1b3 100644
--- a/graphics/macgui/macwidget.h
+++ b/graphics/macgui/macwidget.h
@@ -81,6 +81,7 @@ public:
}
Common::Point getAbsolutePos();
+ Common::Rect getAbsoluteDimensions();
MacWidget *findEventHandler(Common::Event &event, int dx, int dy);
void removeWidget(MacWidget *child, bool del = true);
diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp
index 638b27d9fc7..72e8af5deb0 100644
--- a/graphics/macgui/macwindowmanager.cpp
+++ b/graphics/macgui/macwindowmanager.cpp
@@ -1108,7 +1108,7 @@ bool MacWindowManager::processEvent(Common::Event &event) {
if ((_windows[_activeWindow]->isEditable() && _windows[_activeWindow]->getType() == kWindowWindow &&
((MacWindow *)_windows[_activeWindow])->getInnerDimensions().contains(event.mouse.x, event.mouse.y)) ||
(_activeWidget && _activeWidget->isEditable() &&
- _activeWidget->getDimensions().contains(event.mouse.x, event.mouse.y))) {
+ _activeWidget->getAbsoluteDimensions().contains(event.mouse.x, event.mouse.y))) {
if (getCursorType() != kMacCursorBeam) {
_tempType = getCursorType();
_inEditableArea = true;
More information about the Scummvm-git-logs
mailing list