Closed antonpat closed 3 years ago
I'm confused as to what you mean - if you kill the menubar, there is going to be a menu on the desktop instead of the global menu (it's the filer menubar). That's expected. How do you know there's one 'underneath'?
Ah I see what you mean - global menus not working for filer in general.
@probonopd it's filer starting before the menu...
If I kill filer and start it again after the menu has loaded, all works fine
There was no filer menu bar visible in previous versions (I know it for sure - I've killed the menu bar process many times).
I know, it's new 😀
We added menus for the desktop window for filer, but in this case it's starting before the menubar has a chance to grab it
Oh, I see now. Yes, it is visible for a split second before the normal menu bar appears during the startup.
We do start the Menu before we start Filer, but possibly there is a race condition.
So we need to think about a way to start Filer only once we know that the Menu has published the D-Bus service.
Any ideas?
In the script can you wait for the service using dbus-send
?
I'm not at my machine to check at the moment, but that might be a simple solution.
OK, I tried this and it looks like it could work:
HelloChris% dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep AppMenu
string "com.canonical.AppMenu.Registrar"
Yes, something like this is probably the way to go @moochris, but need to wrap it in a for
loop and combine it with sleep
, right?
Yes, I am not a shell script expert and I have been trying to work this out...
I thought this might work:
while [ $(dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep AppMenu) ]
do
sleep 1
done
However, that command substitution doesn't return empty if it isn't found (so the while loop never runs) - it seems to return a blank line. So I'm a bit stuck now :disappointed:
This is not tested yet, but maybe something along those lines might do?
while true; do
RESULT=$(dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep AppMenu)
if [ "${RESULT}" != "" ] ; then
break
fi
done
Turns out that we need the bash wait code anyway so that Autostart works correctly with applications that put icons into the upper-right hand corner of the menu.
Hence, added in https://github.com/helloSystem/ISO/commit/02cccbf60c500bb79b22db72c32580c6878be190.
0E186-12.2 There are 2 menu bars - one on the top of another. The topmost one is a normal menubar, that displays menu properly for most apps except of Filer. If I kill the process, I can see another transparent menu bar that displays static Filer menus that arealo present in the Filer windows.