Insubstantial / insubstantial

Swing look-and-feel library and assorted widgets
195 stars 57 forks source link

Application lockup when using Ctrl+Space on a JInternalFrame. #98

Closed Stephane-D closed 12 years ago

Stephane-D commented 12 years ago

When you press Ctrl+Space on a JInternalFrame the whole application lockup.

I think the problem comes from the SubstanceInternalFrameTitlePane, when we press Ctrl+Space the parent method showSystemMenu() is called and die in an infinite loop because windowMenu.parent = null (and that should not be the case here).

It may be related to the way you are building the menu in the SubstanceInternalFrameTitlePane.createSystemMenuBar() method :

@Override
protected JMenuBar createSystemMenuBar() {
    this.menuBar = new SubstanceMenuBar();
    this.menuBar.setFocusable(false);
    this.menuBar.setBorderPainted(true);
    this.menuBar.add(this.createSystemMenu());
    this.menuBar.setOpaque(false);
    // support for RTL
    this.menuBar.applyComponentOrientation(this.getComponentOrientation());

    return this.menuBar;
}

I think you should not directly add the systemMenu to menuBar here as this is normally done later in the parent method assembleSystemMenu(). Because of that, windowMenu is not affected with your system menu and that may lead to the problem seen before.

I have to admit I have not dig much so my indications may be not 100% correct.

Stephane-D commented 12 years ago

Oh just disregard this bug, i think the problem comes from something we are doing in our application. Still the way you're building the menu seems a bit weird, the menuBar ends up by containing both your menu and the windowMenu build in the parent. That's not a big deal though...