src/macosx/classes/com/apple/laf/ScreenMenu.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 30,39 **** --- 30,40 ---- import java.awt.peer.MenuComponentPeer; import java.util.Hashtable; import javax.swing.*; + import sun.awt.SunToolkit; import sun.lwawt.LWToolkit; import sun.lwawt.macosx.*; class ScreenMenu extends Menu implements ContainerListener, ComponentListener, ScreenMenuPropertyHandler { static {
*** 142,152 **** invoker.setSelected(true); invoker.validate(); updateItems(); fItemBounds = new Rectangle[invoker.getMenuComponentCount()]; } ! }, null); } catch (final Exception e) { System.err.println(e); e.printStackTrace(); } } --- 143,153 ---- invoker.setSelected(true); invoker.validate(); updateItems(); fItemBounds = new Rectangle[invoker.getMenuComponentCount()]; } ! }, invoker); } catch (final Exception e) { System.err.println(e); e.printStackTrace(); } }
*** 170,180 **** } } fItemBounds = null; } ! }, null); } catch (final Exception e) { e.printStackTrace(); } } --- 171,181 ---- } } fItemBounds = null; } ! }, invoker); } catch (final Exception e) { e.printStackTrace(); } }
*** 198,208 **** */ public void handleMouseEvent(final int kind, final int x, final int y, final int modifiers, final long when) { if (kind == 0) return; if (fItemBounds == null) return; ! SwingUtilities.invokeLater(new Runnable() { @Override public void run() { Component target = null; Rectangle targetRect = null; for (int i = 0; i < fItemBounds.length; i++) { --- 199,209 ---- */ public void handleMouseEvent(final int kind, final int x, final int y, final int modifiers, final long when) { if (kind == 0) return; if (fItemBounds == null) return; ! SunToolkit.executeOnEventHandlerThread(fInvoker, new Runnable() { @Override public void run() { Component target = null; Rectangle targetRect = null; for (int i = 0; i < fItemBounds.length; i++) {