Disabling draw call of inactive layer

I am developing a general plugin and want to disable the outline drawing in inactive layers, and found
needsExtraMainOutlineDrawingForInactiveLayer_(layer) but I can’t get it to work. I have this method in the class:

def needsExtraMainOutlineDrawingForInactiveLayer_(self, layer):
    return True

And calling from inactive layer method, but it doesn’t change the behaviour. What am I doing wrong?

You don’t need to call this. Glyphs will call it. And you need to return False.

The Core documentation says I need to return YES (presumably True).

But true or false, calling or not calling, I tried all combinations but none worked: If I don’t call explicitly, it never gets called. Even if I call, either boolean value doesn’t make a difference. Is it because I’m making a general plugin?

Can you try to add an callback for DRAWINACTIVE?

It then gets called, but still the return value doesn’t do anything.

Then I need to fix it. I’ll have a look later. Can you send me your plugin?