Duplicate events when using addMouseListener(this)

Thank you for the replies :slight_smile:

I’d say yes, that would work ok on a 1 level system.

So if I have let’s say a 10-level child nesting, with each level item having 3 or 4 components let’s say, I’d have to have 1-level-down non-recursive mouse listeners for each child of each item, and manually call a custom function (for each mouse event type) ?
So if I’d have to add a mouse listener to each children, which in turn would also have mouse listener to all of them ?

The data flow is already bubbling up the component hierarchy in JUCE, and what I’m trying to do is optimize both the code by not duplicating functions that are already there by avoid having to manually track down all component changes with manual listeners on all of them, and performance as this would induce double processing (JUCE internal + custom).

I understand that in a minimal example or in a project like a VST, this does not make so much sense as the hierarchy would not be so complex most of the time.
if you’re interested, this is one of the projects that i’m working on and finding this issue : Chataigne | Chataigne

You will see that we’re talking about a potential 10,15 hierarchy level, hundreds / thousands of dynamically generated nested components (like keys in a timeline).

The mod that I’ve done on JUCE right now allows me to only add one line of code to have the expected behaviour, without any custom listeners / parent reaching, and without risking performance cost, as it’s only using juce’s data flow.

It may seem that I asked for help and don’t want to listen to insight, but I’m honestly happy to read about other point of views and be able to discuss pros and cons !