Inactive Tabs not closing when clicking on X

Hi Beni

We use the eclipse theme which shows close buttons with an X on each tab. But when we click on the X of an inactive tab, the tab focuses instead of closes. To close it, we have to click a second time. Instead, we would the inactive tab expect to close even if it’s not focused.

Thanks,
Daniela

I’ll have to check what is going on, the x should close the tab immediatelly. Could be, that the focus-manager catches the event early and the button does never recieve it afterwards.

Have you already checked that?
I can reproduce it with the application in dock/src/commonLayouts when I make the dockables closable by calling setCloseable(true) on them.

No, I did not yet find the cause of this bug. I admit, I did not yet work a lot on this.

Sorry I forgot to mention that this bug occurrs if the EclipseTheme is set. Without the EclipseTheme the close Icon would not be visible on the tabs.

The issue has been resolved and will be available on the next release (it is already in the repository). The new behavior is: clicking on any button on the tab will trigger the button. If the Dockable still is around after the mouse is released, then the focus is transfered to the button and the dockable selected.

thx a lot! :slight_smile:

When do you plan the next release?

Within this week, probably saturday.

Hi Beni

Thank you for the fix :slight_smile:

Unfortunately there is still a bug: when you open 4 dockables, select the first dockable and then try to close the fourth dockable (which is inactive), then the fourth dockable will not get closed immediately but only after you selected another tab.

This holds for the EclipseTheme and can be reproduced by adding the following lines to the Core class of the application in dock/src/commonLayouts:

control.setTheme(ThemeMap.KEY_ECLIPSE_THEME);
environment.setCloseable(true);
storage.setCloseable(true);
singleDockables.setCloseable(true);
multiDockables.setCloseable(true);

Hm, sounds like there is some “repaint” missing somewhere… thanks for the info, I’ll see what I can do.

Earlier (in all 1.0.8pr5 releases before pr5f) I also had repaint problems with the Eclipse theme: the tab of a just closed dockable was not cleared. I’ve solved it with overriding the unbind() method in my customized ArchGradientPainter, which forces the repaint of the tab pane:

  public void unbind() {
    EclipseTabPane pane = getPane(); // save the parent pane just for sure
    super.unbind();
    pane.revalidate();
    pane.repaint();
  }

I’ve not tried the original code after 1.0.8pr5d, so I don’t know whether later releases solved this problem…

I did add a “repaint” too (just at another place), now it seems to work. Strangely I could not reproduce the bug in my Ubuntu. Well, the framework with the fix is uploaded.

It works perfectly (on Windows). Thx a lot :slight_smile: