Board index FlightGear Development Aircraft

macOS menubar problematic

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

macOS menubar problematic

Postby Octal450 » Sat Sep 23, 2017 10:31 pm

Hello
Not sure if anyone found this before, but on the Mac version of FGFS, my Tools menu is missing, but on Windows/Linux, it appears. Anyone know why?

Image

Code: Select all
                                <menu n="100">
                                        <label>Airbus A3XX</label>
                                        <enabled type="bool">true</enabled>
                                        <item>
                                                <label>Aircraft Config</label>
                                                <binding>
                                                        <command>nasal</command>
                                                        <script>
                                                        acconfig.main_dlg.open();
                                                        </script>
                                                </binding>
                                        </item>
                                        <item>
                                                <label>About This Aircraft</label>
                                                <binding>
                                                        <command>nasal</command>
                                                        <script>
                                                        acconfig.about_dlg.open();
                                                        </script>
                                                </binding>
                                        </item>
                                </menu>
                                <menu n="101"> <!-- This one is missing on Macs -->
                                        <label>Tools</label>
                                        <enabled type="bool">true</enabled>
                                        <item>
                                                <label>Select Livery</label>
                                                <binding>
                                                        <command>nasal</command>
                                                        <script>
                                                        aircraft.livery.dialog.toggle();
                                                        </script>
                                                </binding>
                                        </item>
                                        <item>
                                                <label>Announcements</label>
                                                <binding>
                                                        <command>nasal</command>
                                                        <script>
                                                        var announce_dlg = gui.Dialog.new("sim/gui/dialogs/announce/dialog", "Aircraft/IDG-A32X/AircraftConfig/announce.xml");
                                                        announce_dlg.open();
                                                        </script>
                                                </binding>
                                        </item>
                                        <item>
                                                <label>Pushback</label>
                                                <binding>
                                                        <command>dialog-show</command>
                                                        <dialog-name>pushback</dialog-name>
                                                </binding>
                                        </item>
                                        <item>
                                                <label>Failures</label>
                                                <binding>
                                                        <command>nasal</command>
                                                        <script>
                                                        acconfig.fail_dlg.open();
                                                        </script>
                                                </binding>
                                        </item>
                                        <item>
                                                <label>Reset FMGC</label>
                                                <binding>
                                                        <command>nasal</command>
                                                        <script>
                                                        fmgc.reset_FMGC();
                                                        </script>
                                                </binding>
                                        </item>
                                        <item>
                                                <label>Skip ADIRS</label>
                                                <binding>
                                                        <command>property-assign</command>
                                                        <property>/controls/adirs/skip</property>
                                                        <value>1</value>
                                                </binding>
                                        </item>
                                        <item>
                                                <label>Show Captain's ND</label>
                                                <binding>
                                                        <command>nasal</command>
                                                        <script>
                                                        canvas_nd.showNd();
                                                        </script>
                                                </binding>
                                        </item>
                                        <item>
                                                <label>Show First Officer's ND</label>
                                                <binding>
                                                        <command>nasal</command>
                                                        <script>
                                                        canvas_nd.showNd('right');
                                                        </script>
                                                </binding>
                                        </item>
                                        <item>
                                                <label>Show Upper ECAM</label>
                                                <binding>
                                                        <command>nasal</command>
                                                        <script>
                                                        canvas_ecam.showUpperECAM();
                                                        </script>
                                                </binding>
                                        </item>
                                        <item>
                                                <label>Show Lower ECAM</label>
                                                <binding>
                                                        <command>nasal</command>
                                                        <script>
                                                        canvas_ecam.showLowerECAM();
                                                        </script>
                                                </binding>
                                        </item>
                                </menu>


Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: macOS menubar problematic

Postby Hooray » Sat Sep 23, 2017 10:50 pm

probably best to post this to the devel list and/or issue tracker - seems that someone introduced platform specific UI replacements without taking into account all existing use-cases and without having a good way to do automated testing - which wouldn't be a first, the addition of the Qt launcher has also been crippling the experience for people not using a Qt5-enabled build (e.g. the original Canvas based aircraft center is not functional at all, which means that the UI item is there but won't do anything, despite the dialog still being there).

We've seen the same problem with platform-specific native file open/save dialogs, too: FG 3.4 Windows: File Selection Box


A few years ago, back in the days of the Qt5 debate I was actually pointing out that this divergence of functionality could sooner or later become an actual problem, especially in the light of providing more and more platform specific "options" that don't receive as much testing/feedback:

FlightGear GUI hell: PUI, Canvas GUI, Mongoose, Qt5 ??
Hooray wrote:At some point, our UIs will undoubtedly start to diverge rather significantly: Canvas is already much powerful than PUI - however, it isn't yet as feature-rich from a widget standpoint, so we still need to port roughly 15-20 widgets before we can phase out PUI. Equally, the mongoose GUI Torsten is working on can trivially be more powerful than anything we could come up with in FlightGear - simply because, in FlightGear, we tend to re-invent the wheel - while the mongoose UI can simply use existing libraries/UI toolkits (think a tree view for a property browser), whereas we would have to code a tree view in Nasal/Canvas first (which isn't rocket science, but will undoubtedly take way longer than Torsten taking an existing widget and exposing a few more properties/fgcommands).

So our UIs will increasingly start to differ a lot - even just for the simple reason that many of our contributors/aircraft developers are familiar with helping maintain the existing PUI XML GUI (think Thorsten's Advanced Weather/ALS systems), but may very well not be overly interested in manually having to maintain parity with a plethora of 3rd party UI solutions. Which is exactly the reason why manually porting UI dialogs is fragile and tedious in the long-term, which is also why we came to the conclusion NOT to do that in the context of Canvas, but instead write a parser that would map PUI widgets to Canvas widgets, so that there's no manual rewriting/maintenance involved.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: macOS menubar problematic

Postby Octal450 » Sat Sep 23, 2017 11:26 pm

Thank you Hooray
I will go ahead and do so, I think the Windows/Linux Menubar needs to come to the Mac version, at least optionally, or that needs to be fixed. the Mac default menu bar has so much other stuff in it, I vote for the FGFS PUI menubar to be added.

I think I still have some Macs lying around and could help develop/test this.

Now, I understand that Canvas will eventually replace PUI, but I don't see that happening any time within the next year, and it would be nice to get the menubar working properly on macOS by .4

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: macOS menubar problematic

Postby Hooray » Sat Sep 23, 2017 11:39 pm

It would be pretty straightforward to re-implement the PUI menubar using a simple pui2canvas-like parser, Jabberwocky was once tinkering with that: http://wiki.flightgear.org/Howto:Making ... as_Menubar

I am however not aware of any recent plans/discussions asking for Canvas to replace the PLIB PUI engine, as a matter of fact, a number of senior core developers have actively discouraged any attempts to do so.

One of the longest standing issues was actually fixing rendering artifacts on some ATI hardware, but it seems that Richard recently identified and fixed the problem by customizing a few fonts/styles.

Anyway, I am sure that people will appreciate any help with testing on Mac. However, like you say, I also don't believe that anybody is currently working towards a Canvas based replacement of either the built-in menubar or the GUI engine as a whole.

Then again, the "pui2canvas" module is a simple piece of Nasal code that can be easily added to by other fgdata developers, and it would only take 2-3 additional widgets to be able to approximate most of the missing PUI bits. So there is nothing saying that this needs to be endorsed or supported by any core developers - as a matter of fact, Torsten's recent addon work means that the pui2canvas parser could be implemented and provided as an optional "addon".

Anyway, in its current form it is not dealing with the menubar or OS specific open/save file dialogs at all. It's really just mapping existing Canvas widgets to a tiny subset of PUI/XML, using roughly 500 lines of simple Nasal code.

http://wiki.flightgear.org/Pui2canvas
Image
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: macOS menubar problematic

Postby Hooray » Sun Oct 01, 2017 9:54 pm

I think the Windows/Linux Menubar needs to come to the Mac version, at least optionally

Has this been fixed meanwhile ? Otherwise, I do think it should be possible to come up with a simple workaround to use the built-in PUI based menubar instead of the native MacOS menubar - I posted a similar workaround to re-enable the original Canvas based "Aircraft Center" in non-Qt5 builds: viewtopic.php?f=71&t=33023

Looking at the code in question, but without having access to a Mac, my suggestion would be to try the following additional startup argument:


--prop:/sim/menubar/native=0


This should normally override any native menubar implementations and fall back to the built-in PUI based on.

With Richard's latest AMD/Radeon related PUI fixes, this may hopefully prove to be useful ...

For details, see: https://sourceforge.net/p/flightgear/fl ... i.cxx#l118
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: macOS menubar problematic

Postby Octal450 » Sun Oct 01, 2017 11:09 pm

Hi
I will do some experiments, if it works. I will have to have my -set file force this until another workaround is found.

Thanks for following up.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: macOS menubar problematic

Postby Hooray » Sun Oct 01, 2017 11:14 pm

this kind of change won't work at the -set.xml level, because it has to be processed during initialization - the only thing that /might/ work is doing a reset/re-init at runtime ensuring that this property is set (which may be more difficult than it sounds, because only certain properties are retained).

Anyway, conceptually it is also flawed to override such settings at the -set.xml (aircraft) level.

My suggestion would be to edit $FG_HOME/preferences.xml or use a custom config file and load that via --config.
If you really need something in-sim that is aircraft specific you could look up README.commands and check menubar.xml to see how the UI is re-initialized using a fgcommand.
You would want to use the same fgcommand to re-init the UI after setting said property.
But like I said, I don't believe this is actually persistent - and I am in no position to tinker with that (no Mac available).
You could try the userarchive attribute ... but I don't believe that this will affect such properties at this point

Yeah, you are in uncharted waters here - sorry about that, maybe the issue will be fixed in time, so that you don't need to resort to these workarounds.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: macOS menubar problematic

Postby Octal450 » Sun Oct 01, 2017 11:20 pm

Hi Hooray
That makes sense, I guess. I will still try and find out if it helps or not.

I cannot edit a file, because this is a problem which needs to be repaired on other's computers, I personally use Windows, so this has no use for me.

I will do some more research.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: macOS menubar problematic

Postby Hooray » Sun Oct 01, 2017 11:27 pm

I guess I would change the install instructions to point out how to work around the issue, and maybe show a tooltip during startup explaining what needs to be done.
That is something that can be trivially done as part of your -set,xml file

Not sure though if there is any sane method to detect that you are indeed on a mac ... I suppose there are no properties telling us anything about the platform in use.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: macOS menubar problematic

Postby Octal450 » Mon Oct 02, 2017 12:13 am

@Hooray
That is a good idea. I recall FGFS saying the platform somewhere, I just don't remember where. I'll dig around in the property tree and see if I can find anything useful.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: macOS menubar problematic

Postby Octal450 » Mon Oct 02, 2017 7:05 pm

James seems to found the issue being my menu called "Tools", which the launcher or something already has. I will rename it to something else.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11


Return to Aircraft

Who is online

Users browsing this forum: No registered users and 13 guests