Global Menu problem
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- OficineRobotica
- Posts: 433
- Joined: Thu Feb 21, 2019 8:17 am
- Contact:
Global Menu problem
Hello to all. I'm new to this forum so please be kind if i'm wrong in following the forum rules.
My problem is with freecad 0.18 when using global menu on kubuntu 18.10. When using the global menu and not the native menu of the app , whenever one changes workbenches the workbench specific menus don't disapear and get replaced but they just get mooved in front of the file menu voice . this way the menu voices become so many that they go offscreen. It's a minor issue but on small screens the global menu is a real space saver.
This issue is present with the ppa dev version and it does not happen with the appimage version . The appimage version doesn't get recognised by the kde's global menu and uses it's native menu bar.
Please excuse my rusty english.
OS: Ubuntu 18.10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15860 (Git)
Build type: Release
Branch: master
Hash: 3b708c7f84b0425076b520e1d95627b20fd75fe0
Python version: 2.7.15+
Qt version: 5.11.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
My problem is with freecad 0.18 when using global menu on kubuntu 18.10. When using the global menu and not the native menu of the app , whenever one changes workbenches the workbench specific menus don't disapear and get replaced but they just get mooved in front of the file menu voice . this way the menu voices become so many that they go offscreen. It's a minor issue but on small screens the global menu is a real space saver.
This issue is present with the ppa dev version and it does not happen with the appimage version . The appimage version doesn't get recognised by the kde's global menu and uses it's native menu bar.
Please excuse my rusty english.
OS: Ubuntu 18.10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15860 (Git)
Build type: Release
Branch: master
Hash: 3b708c7f84b0425076b520e1d95627b20fd75fe0
Python version: 2.7.15+
Qt version: 5.11.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
- Attachments
-
- Screenshot_20190221_095249_0.png (53.49 KiB) Viewed 3922 times
-
- Screenshot_20190221_094800_1.png (116.9 KiB) Viewed 3922 times
-
- Screenshot_20190221_094959_2.png (59.49 KiB) Viewed 3922 times
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
Re: Global Menu problem
Hi @OficineRobotica
This could be a bug in KDE global menu implementation, or things could improve on FreeCAD side, or both. Fix used for macOS, could potentially work here too:
If you copy/paste this code snippet in FreeCAD Python console, each time before switching the workbench. Do things improve after? If yes, i guess we could enable such fix for all platforms, but the problem is it introduces a different issue as mentioned here:
https://forum.freecadweb.org/viewtopic. ... 10#p287972
P.S. AppImage would likely need to bundle some Qt/KDE specific libraries, for providing such integration support on KDE.
This could be a bug in KDE global menu implementation, or things could improve on FreeCAD side, or both. Fix used for macOS, could potentially work here too:
Code: Select all
mw = Gui.getMainWindow()
mb = mw.menuBar()
mb.clear()
https://forum.freecadweb.org/viewtopic. ... 10#p287972
P.S. AppImage would likely need to bundle some Qt/KDE specific libraries, for providing such integration support on KDE.
- OficineRobotica
- Posts: 433
- Joined: Thu Feb 21, 2019 8:17 am
- Contact:
Re: Global Menu problem
Hello @triplus.
when pasting that code snipet into the console the menu gets re arenged in the right order. Get's cleared and when a new workbench is selected get's displayed corectly. I have to say that freecad is the only app that has this strange behavior interacting with kde's global menu.
Thank you for your attention. You deserve a bear.
when pasting that code snipet into the console the menu gets re arenged in the right order. Get's cleared and when a new workbench is selected get's displayed corectly. I have to say that freecad is the only app that has this strange behavior interacting with kde's global menu.
Thank you for your attention. You deserve a bear.
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
Re: Global Menu problem
Thanks for confirming.OficineRobotica wrote: ↑Thu Feb 21, 2019 2:04 pm Hello @triplus.
when pasting that code snipet into the console the menu gets re arenged in the right order. Get's cleared and when a new workbench is selected get's displayed corectly.
Yes, FreeCAD manages menu bar dynamically, on each workbench change. And that is likely what KDE global menu implementation doesn't like. Clearing menu on Linux shouldn't be that hard to achieve, but as that currently introduces other known issues:I have to say that freecad is the only app that has this strange behavior interacting with kde's global menu.
https://forum.freecadweb.org/viewtopic. ... 30#p289330
Likely best if this gets explored again in FreeCAD 0.19 development cycle.
You're welcome.Thank you for your attention.
- OficineRobotica
- Posts: 433
- Joined: Thu Feb 21, 2019 8:17 am
- Contact:
Re: Global Menu problem
Unfortunately I'm not that good at scripting, but for me even a push button in the interface would do for refreshing the menu instead of bringing up the python console every time one changes workbench. That is until a more permanent solution is found. Is that even possible via python scripting? Like an add-on that only interested users install.Yes, FreeCAD manages menu bar dynamically, on each workbench change. And that is likely what KDE global menu implementation doesn't like. Clearing menu on Linux shouldn't be that hard to achieve, but as that currently introduces other known issues:
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
Re: Global Menu problem
You can now create a parameter under Tools -> Edit parameters ... -> BaseApp -> Preferences -> MainWindow. It should be a new Boolean item named ClearMenuBar and it should be set to true.
https://github.com/FreeCAD/FreeCAD/pull/1993
https://github.com/FreeCAD/FreeCAD/pull/1993
- OficineRobotica
- Posts: 433
- Joined: Thu Feb 21, 2019 8:17 am
- Contact:
Re: Global Menu problem
This is just awesome man. Thank you. This kind of small user base affecting bug could go ahead unresolved for years when talking about a closed source application. It just happened to me that open source user support to be better that paid application one. Thank you again.
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
Re: Global Menu problem
You're welcome.OficineRobotica wrote: ↑Fri Mar 01, 2019 6:03 am This is just awesome man. Thank you. This kind of small user base affecting bug could go ahead unresolved for years when talking about a closed source application. It just happened to me that open source user support to be better that paid application one. Thank you again.
- OficineRobotica
- Posts: 433
- Joined: Thu Feb 21, 2019 8:17 am
- Contact:
Re: Global Menu problem
@triplus
Sorry mate, but i guess i was too early to celebrate. Unfortunately the ppa build system was broken for a few days so i waited for a recent build to do some testing. I added the bolean value as instructed but the behavior still persists.
I "saved to disk" and restarted freecad. I also tried to watch for terminal or python console messages for some hint but nothing get's printed there.
I also took a look at your git comit and i was just wandering(i am most certainly wrong here)
GetBool("ClearMenuBar",false)) should be GetBool("ClearMenuBar",true)) ???
I'm not a coder so be patient with me. I also tried to set the bolean value to false to see if something changes but i get the same result.
this still works when pasted in the python console.
The last thought. Does the freecad daily ppa pulls the source from the same repository as your comit? I guess it's time to also arm my self with some patience and try to compile freecad from source .
Sorry mate, but i guess i was too early to celebrate. Unfortunately the ppa build system was broken for a few days so i waited for a recent build to do some testing. I added the bolean value as instructed but the behavior still persists.
I "saved to disk" and restarted freecad. I also tried to watch for terminal or python console messages for some hint but nothing get's printed there.
I also took a look at your git comit and i was just wandering(i am most certainly wrong here)
Code: Select all
if (App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/MainWindow")->GetBool("ClearMenuBar",false)) {
menuBar->clear();
}
GetBool("ClearMenuBar",false)) should be GetBool("ClearMenuBar",true)) ???
I'm not a coder so be patient with me. I also tried to set the bolean value to false to see if something changes but i get the same result.
Code: Select all
mw = Gui.getMainWindow()
mb = mw.menuBar()
mb.clear()
The last thought. Does the freecad daily ppa pulls the source from the same repository as your comit? I guess it's time to also arm my self with some patience and try to compile freecad from source .
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
Re: Global Menu problem
False is the default value if no parameter is set. By default we don't want to clear the global menu. In the future likely macOS workaround will need to be revised, and likely menubar on KDE will need to address this properly.OficineRobotica wrote: ↑Sun Mar 03, 2019 7:07 pm GetBool("ClearMenuBar",false)) should be GetBool("ClearMenuBar",true)) ???
The last thought. Does the freecad daily ppa pulls the source from the same repository as your comit?
Looking at the image, you have version 0.18.16033 installed. Needed changes should be made available. I tested by enabling the menubar panel on stock Kubuntu 18.10 and by using FreeCAD from the daily PPA. Without the parameter set to true, the menubar inflates when switching workbenches. With the parameter set to true, that doesn't happen anymore on my side. Note that FreeCAD restart isn't needed. Hard to guess, what is different on your side. Maybe one of the other widgets on the panel is interfering. Try creating another user/guest account and log in with that account. Just add the default menubar panel and try out the procedure again.