From 4e98704b7119f1bf3daf650013b74252dfa74e1a Mon Sep 17 00:00:00 2001 From: trompetin17 Date: Tue, 5 Nov 2024 13:07:41 -0500 Subject: [PATCH] fix Propagation mousewheel event in game Propagation mousewheel event was introduce to have the opportunity to parent handle this event if an only if the child doenst handle and the parent set a handler for that event. The error foundedd by elexis inside a game relay on the message waw propagated outsie IGUIObjects to CGUI.cpp that shouldnt be at the beggin. I forget to stop the propagation when all objects in the tree was validated, because of that the message was propagate to CGUI.cpp andd then hanle by camera. the fix suggest to only propagate the event in the GUI tree, not outside the GUI tree --- source/gui/ObjectBases/IGUIObject.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/gui/ObjectBases/IGUIObject.cpp b/source/gui/ObjectBases/IGUIObject.cpp index 26012a3b99..8653452d5d 100644 --- a/source/gui/ObjectBases/IGUIObject.cpp +++ b/source/gui/ObjectBases/IGUIObject.cpp @@ -415,8 +415,13 @@ InReaction IGUIObject::SendMouseEvent(EGUIMessageType type, const CStr& eventNam // inform to parents until get to the root object // for now only wheel events are inform to parents - if (GetParent() && (type == GUIM_MOUSE_WHEEL_UP || type == GUIM_MOUSE_WHEEL_DOWN || type == GUIM_MOUSE_WHEEL_LEFT || type == GUIM_MOUSE_WHEEL_RIGHT) && msg.skipped) - msg.Skip(GetParent()->SendMouseEvent(type, eventName) == IN_PASS); + if ((type == GUIM_MOUSE_WHEEL_UP || type == GUIM_MOUSE_WHEEL_DOWN || type == GUIM_MOUSE_WHEEL_LEFT || type == GUIM_MOUSE_WHEEL_RIGHT) && msg.skipped) + { + if (GetParent()) + msg.Skip(GetParent()->SendMouseEvent(type, eventName) == IN_PASS); + else + msg.Skip(false); + } return msg.skipped ? IN_PASS : IN_HANDLED; }