Skip to content

Commit bf42f26

Browse files
authored
Merge pull request #7935 from facchinm/fix_osx_slow_menus
Fix OSX "slow" menus
2 parents d2a251c + 2f3a561 commit bf42f26

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

app/src/processing/app/Editor.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,6 @@ public void windowActivated(WindowEvent e) {
262262
// added for 1.0.5
263263
// http://dev.processing.org/bugs/show_bug.cgi?id=1260
264264
public void windowDeactivated(WindowEvent e) {
265-
fileMenu.remove(sketchbookMenu);
266-
fileMenu.remove(examplesMenu);
267265
List<Component> toolsMenuItemsToRemove = new LinkedList<>();
268266
for (Component menuItem : toolsMenu.getMenuComponents()) {
269267
if (menuItem instanceof JComponent) {
@@ -504,11 +502,11 @@ private void buildMenuBar() {
504502
fileMenu.addMenuListener(new StubMenuListener() {
505503
@Override
506504
public void menuSelected(MenuEvent e) {
507-
List<Component> components = Arrays.asList(fileMenu.getComponents());
505+
List<Component> components = Arrays.asList(fileMenu.getMenuComponents());
508506
if (!components.contains(sketchbookMenu)) {
509507
fileMenu.insert(sketchbookMenu, 3);
510508
}
511-
if (!components.contains(sketchbookMenu)) {
509+
if (!components.contains(examplesMenu)) {
512510
fileMenu.insert(examplesMenu, 4);
513511
}
514512
fileMenu.revalidate();
@@ -537,7 +535,7 @@ public void menuSelected(MenuEvent e) {
537535
toolsMenu.addMenuListener(new StubMenuListener() {
538536
@Override
539537
public void menuSelected(MenuEvent e) {
540-
List<Component> components = Arrays.asList(toolsMenu.getComponents());
538+
List<Component> components = Arrays.asList(toolsMenu.getMenuComponents());
541539
int offset = 0;
542540
for (JMenu menu : base.getBoardsCustomMenus()) {
543541
if (!components.contains(menu)) {

0 commit comments

Comments
 (0)