codecentric / NSMenuFX

Other
128 stars 27 forks source link

Global Menu Bar not visible during all stages #22

Closed mperrone closed 7 years ago

mperrone commented 7 years ago

Hi All,

I have found a problem that's a show stopper for using this library in a project I'm developing.

I have a complex program that opens multiple stages, and for some windows/stages the global menu bar just doesn't show up. If a dialog box is opened, the global menu bar is visible while that box has focus. The menu bar shows up during the initial stage as well, which is a login window that calls Stage().showAndWait();

I have stripped down to a simple demonstration program and am attaching to this report. It's a gradle Idea project that uses gradle wraper.

Thanks,

Michael demonstration.zip

mperrone commented 7 years ago

I forgot to mention, select the "open my open/pending" and click sign-on button on the login box to bring up two demonstration windows.

0x4a616e commented 7 years ago

Thanks for the report! NSMenuFX was actually considering Panes only as eligible for having a menu bar but it should work for Groups too. I've pushed the respective changes, and tested it with your sample code. I'll however try if i can piggyback some other minor fixes to the next maven release.

mperrone commented 7 years ago

I have tried some work-around ideas. I called MenuBarUtils.setMenuBar(stage, bar) when showing a new stage, and was surprised that didn't work. I refactored the demonstration code to use primaryStage for first 'ticket' window as well as the login window, but that only got the menu bar for that window only, opening up new stages/windows still did not have the menu bar.

0x4a616e commented 7 years ago

So you've tried the latest sources from master with the sample from above and it didn't work? At least for me, this was working well. If you're using a different sample, what class are you using as a scene? With my latest commit Pane and Group should be supported.

On 16 Mar 2017, at 20:13, Michael Perrone notifications@github.com wrote:

I have tried some work-around ideas. I called MenuBarUtils.setMenuBar(stage, bar) when showing a new stage, and was surprised that didn't work. I refactored the demonstration code to use primaryStage for first 'ticket' window as well as the login window, but that only got the menu bar for that window only, opening up new stages/windows still did not have the menu bar.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

mperrone commented 7 years ago

So you've tried the latest sources from master with the sample from above and it didn't work?

Oops! Sorry, but I drafted that comment before I got your update, I haven't tried the new code yet. I expect your changes will work fine if they worked in the demo program. I'll let you know otherwise.

mperrone commented 7 years ago

Confirmed: The new sources from master fixes the issue in my projects. Thanks for the quick response on this report!

0x4a616e commented 7 years ago

Nice, thanks for the info 🤘

On 16 Mar 2017, at 20:36, Michael Perrone notifications@github.com wrote:

Confirmed: The new sources from master fixes the issue in my projects.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

0x4a616e commented 7 years ago

Pushed an update to maven central