aboutsummaryrefslogtreecommitdiff
path: root/src/macosx/classes/com/apple/eawt
diff options
context:
space:
mode:
authorleonidr <none@none>2013-07-26 16:22:29 +0400
committerleonidr <none@none>2013-07-26 16:22:29 +0400
commit681181fadc16971220ba469c0792f4d7a0df141a (patch)
tree79557b052efd7a29684395b271e4da9abe6e28d1 /src/macosx/classes/com/apple/eawt
parent7476e6ee2b1f473eb3f5d7b5b8aabf5dea266512 (diff)
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
Reviewed-by: anthony, serb
Diffstat (limited to 'src/macosx/classes/com/apple/eawt')
-rw-r--r--src/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java b/src/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java
index f432bd803..270c5fc4c 100644
--- a/src/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java
+++ b/src/macosx/classes/com/apple/eawt/_AppMenuBarHandler.java
@@ -31,6 +31,7 @@ import java.awt.peer.MenuComponentPeer;
import javax.swing.*;
import javax.swing.plaf.MenuBarUI;
+import com.apple.laf.ScreenMenuBar;
import sun.lwawt.macosx.CMenuBar;
import com.apple.laf.AquaMenuBarUI;
@@ -72,12 +73,15 @@ class _AppMenuBarHandler {
// scan the current frames, and see if any are foreground
final Frame[] frames = Frame.getFrames();
for (final Frame frame : frames) {
- if (frame.isVisible() && !isFrameMinimized(frame)) return;
+ if (frame.isVisible() && !isFrameMinimized(frame)) {
+ return;
+ }
}
// if we have no foreground frames, then we have to "kick" the menubar
final JFrame pingFrame = new JFrame();
pingFrame.getRootPane().putClientProperty("Window.alpha", new Float(0.0f));
+ pingFrame.setUndecorated(true);
pingFrame.setVisible(true);
pingFrame.toFront();
pingFrame.setVisible(false);
@@ -101,7 +105,6 @@ class _AppMenuBarHandler {
// Aqua was not installed
throw new IllegalStateException("Application.setDefaultMenuBar() only works with the Aqua Look and Feel");
}
-/* TODO: disabled until ScreenMenuBar is working
final AquaMenuBarUI aquaUI = (AquaMenuBarUI)ui;
final ScreenMenuBar screenMenuBar = aquaUI.getScreenMenuBar();
@@ -118,8 +121,7 @@ class _AppMenuBarHandler {
}
// grab the pointer to the CMenuBar, and retain it in native
- nativeSetDefaultMenuBar(((CMenuBar)peer).getNativeMenuBarPeer());
-*/
+ nativeSetDefaultMenuBar(((CMenuBar)peer).getModel());
}
void setAboutMenuItemVisible(final boolean present) {