max-mapper / menubar

➖ high level way to create menubar desktop applications with electron
BSD 2-Clause "Simplified" License
6.64k stars 363 forks source link

Fix for Broken Native Menubar Example #471

Closed BennoCrafter closed 3 months ago

BennoCrafter commented 3 months ago

Hey Guys!

I've addressed the issue where the native menubar example was acting up. The problem was that clicking the icon in the menubar was opening both the native menu and the browser window, which wasn't the expected behavior. This seems to only happen on MacOS.

mb.on('ready', () => {
    console.log('Menubar app is ready.');
    // Your app code here
    tray.removeAllListeners(); // Removed unnecessary event listeners
});

Additional Notes:

I want to give credit where it's due: @Jip-Hop initially identified the issue and provided a workaround. Thanks to them for pointing it out! I've just created a pull request.