BUG: Component::isShowing() not properly updated when changing tabs in a TabbedComponent

Didn’t notice it until I added some dropShadows to some components, did some digging and when changing tabs, dropShadow checks DropShadower::updateShadows() and reaches owner->isShowing() and fails, regardless of swapping tabs a bunch of times, making it impossible to re-create the shadow since it thinks it isn’t showing the whole time.

Hi @Stiltzkin,
thank you for reporting this. There is a fix for this now out on develop at 175de90.

1 Like

Just a follow up here, while this is technically fixed, for this use case, it’s possible for this to still not update properly on MacOS.

If you have a tab with two components, and the one that is not visible upon construction has shadows, the shadows will not appear on MacOS until resized is called (or isShowing() is updated). It appears the TabButtonBar just isn’t properly updating child components when tabs are changing with isShowing() when it comes to dropShadows.

Can you elaborate on the buggy use case?

I’m sharing a PIP where I tried to recreate the problem.
DropShadowRepro.h (2.8 KB)

  • It has two tabs, both with two buttons.
  • Both buttons have shadows, but one of them
    is initially not visible.
  • Pressing the visible button will make all buttons visible, both on the currently active and the hidden tab.

I couldn’t recreate a situation where a button was visible but had no shadows, so I’m guessing this isn’t covering the exact use case you had in mind.

MainComponent.h (2.3 KB)
Here’s an example showing the issue.
It also shows that when changing a tab, the shadows from all sub items are also removed. This is tested on MacOS, the shadows appear after only by resizing, which forces it to update isShowing() and thus the dropShadower

1 Like

Thank you, the example made it clear.

A fix is now out on develop

1 Like

Thanks, just tested and this has fixed the issue for me on all platforms :slight_smile: