GRAPHICS: MACGUI: Process windowed widget events

This ensures the correct dimensions are passed to ensure widgets within windows
process their events properly.
This commit is contained in:
Nathanael Gentry 2020-08-12 23:57:30 -04:00
parent b632dc41e6
commit 281c89f05f

View file

@ -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;