void (boolean enabled) { if (ourLib == null || myIsDisposed) { return; } if (xid.get() == 0) { LOG.debug("can´t toggle global-menu of frame " + frame + " because xid == 0"); return; } if (isEnabled == enabled) { return; } isEnabled = enabled; if (enabled) { _trace("enable global-menu"); isRootsUpdated = false; ourLib.execOnMainLoop(updateAllRoots); } else { if (windowHandle != null) { _trace("disable global menu, scheduled destroying of GlobalMenuLinux for xid=0x%X", xid); ourLib.releaseWindowOnMainLoop(windowHandle, onWindowReleased); } if (UISettings.getInstance().getShowMainMenu()) { JMenuBar frameMenu = getMenuBar(frame); if (frameMenu != null) { frameMenu.setVisible(true); } } } }