Skip to content

[macOS] Top menu items disappear when child Shell opened or when contributed #3540

Open

Description

@Phillipus
  • SWT in Eclipse 4.40 and 4.41 (and earlier versions of SWT)
  • macOS 27.0.1 (26A434) Golden Gate
  • Java 21 Temurin 21.0.11 (also tested with 25.0.4)
  1. In Eclipse open any child Shell - any dialog or popup.
  2. While the child Shell has the focus the top menu bars are not visible, only the main "Eclipse" system menu. This is as expected.
  3. Close the child Shell
  4. The top menu items continue to remain non-visible (they should re-appear)
  5. To show the main menu items hover your mouse over the menu bar area or right-click somewhere to open a context menu

Also, when launching a child Eclipse or RCP app the top menu items are not visible until the mouse hovers over them.

Also, when contributed top menu items are removed and re-added depending on context they are not visible (the "Source" and "Refactor" menu items for example).

Note this is working on macOS 15 (Sequoia) and macOS 26 (Tahoe).

Activity

  1. changed the title [-][macOS] Modeless Shell erases main menu items[/-] [+][macOS] Top menu items disappear when child Shell opened[/+] on Aug 26, 2026
  2. Phillipus commented on Aug 26, 2026

    @Phillipus
    ContributorAuthor

    I've edited the original title and post because the problem occurs when opening any child Shell including all dialogs.

    1. Run the Snippet
    2. Click on the window to open the dialog
    3. Menu items are not visible (expected behaviour)
    4. Close the dialog
    5. Menu items are not visible until mouse hovers over them or right-click somewhere to open a context menu
    import org.eclipse.jface.dialogs.Dialog;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Menu;
    import org.eclipse.swt.widgets.MenuItem;
    import org.eclipse.swt.widgets.Shell;
    
    public class MacMenuTest {
    
        public static void main(String[] args) {
            final Display display = new Display();
            final Shell shell = new Shell(display);
            shell.setSize(500, 500);
            shell.setText("Mac Menu Test");
    
            Menu appMenuBar = new Menu(shell, SWT.BAR);
            shell.setMenuBar(appMenuBar);
    
            MenuItem file = new MenuItem(appMenuBar, SWT.CASCADE);
            file.setText("File");
            
            MenuItem editItem = new MenuItem(appMenuBar, SWT.CASCADE);
            editItem.setText("Edit");
            
            MenuItem source = new MenuItem(appMenuBar, SWT.CASCADE);
            source.setText("Source");
    
            shell.open();
            
            shell.addListener(SWT.MouseUp, e -> {
                Dialog dialog = new Dialog(shell) {};
                dialog.open();
            });
    
            while(!shell.isDisposed()) {
                if(!display.readAndDispatch()) {
                    display.sleep();
                }
            }
            
            display.dispose();
        }
    }
  3. Phillipus commented on Aug 26, 2026

    @Phillipus
    ContributorAuthor

    In the following screen recording I do this:

    1. Launch child Eclipse - top menu items are not visible
    2. Move mouse over menu bar so menu items are visible
    3. Open a dialog
    4. Close the dialog - top menu items are not visible
    5. Move mouse over menu bar so menu items are visible

    The screen recording show the problem on a child Eclipse (or RCP app) when starting but this problem occurs on the main instance of Eclipse or RCP app. Simply put - main menu items are not visible after opening and closing a child Shell.

    capture.mov
  4. changed the title [-][macOS] Top menu items disappear when child Shell opened[/-] [+][macOS] Top menu items disappear when child Shell opened or when contributed[/+] on Aug 26, 2026
  5. Phillipus commented on Aug 26, 2026

    @Phillipus
    ContributorAuthor

    The following snippet demonstrates that the main menu bar is not updated with a contributed MenuItem until the mouse hovers over it.

    1. Run snippet
    2. Click on the window
    3. Menu Item "Addition x" should be added to main menu bar but it's not visible
    4. Hover mouse over menu bar and it appears
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Menu;
    import org.eclipse.swt.widgets.MenuItem;
    import org.eclipse.swt.widgets.Shell;
    
    public class MacMenuTest {
        
        static int count = 1;
    
        public static void main(String[] args) {
            final Display display = new Display();
            final Shell shell = new Shell(display);
            shell.setSize(500, 500);
            shell.setText("Mac Menu Test");
    
            Menu appMenuBar = new Menu(shell, SWT.BAR);
            shell.setMenuBar(appMenuBar);
    
            shell.open();
            
            shell.addListener(SWT.MouseUp, e -> {
                MenuItem addition = new MenuItem(appMenuBar, SWT.CASCADE);
                addition.setText("Addition " + count++);
            });
            
            while(!shell.isDisposed()) {
                if(!display.readAndDispatch()) {
                    display.sleep();
                }
            }
            
            display.dispose();
        }
    }
  6. Phillipus commented on Aug 31, 2026

    @Phillipus
    ContributorAuthor

    This problem is still present in macOS 27.0.1.

    If anyone has any advice on how this might be solved or where to look to find the cause I'm happy to try and test.

  7. HeikoKlare commented on Sep 11, 2026

    @HeikoKlare
    Contributor

    @soethoff @BeckerWdf may this is of interest for you?

  8. thomasa299792 commented on Oct 13, 2026

    @thomasa299792

    We also observed this both in Eclipse itself and RCP applications, on macOS 27.0.1 in Eclipse 4.39.0.

    Have not observed this issue in macOS 26 or earlier.

    Show any dialog -- e.g., Eclipse>Settings... -- and menu bar items disappear, other than the apple and "Eclipse" menu. Dismiss that dialog -- and the menu bar items don't reappear automatically.

    This can be confusing. A user looking for a menu won't see it, and may not know to move the mouse to the invisible menu item.

  9. thomasa299792 commented on Oct 13, 2026

    @thomasa299792

    It would be really helpful if a fix for this was included in release 2026-12.

  10. Phillipus commented on Oct 15, 2026

    @Phillipus
    ContributorAuthor

    It would be really helpful if a fix for this was included in release 2026-12.

    @thomasa299792 Will you be able to help with a fix?

    For my own part I have spent some time experimenting with refreshing the SWT Menu and MenuItem here and in other places. Unfortunately my approach has been based on trial and error and I'm not able to even pinpoint where the problem is.

  11. thomasa299792 commented on Oct 20, 2026

    @thomasa299792

    @Phillipus - OS X programming is not my area of skill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions