Bug 391868 - Incorrect Libre Office first topmenu item when office file launched directly
Summary: Incorrect Libre Office first topmenu item when office file launched directly
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: gmenu-dbusmenu-proxy (show other bugs)
Version: 5.12.3
Platform: Manjaro Linux
: NOR normal
Target Milestone: 1.0
Assignee: Kai Uwe Broulik
URL:
Keywords:
: 395364 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-03-14 21:42 UTC by Michał Dybczak
Modified: 2021-01-21 16:02 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Libreoffice - global menu issue, screenshot (14.47 KB, image/jpeg)
2018-03-14 21:42 UTC, Michał Dybczak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Dybczak 2018-03-14 21:42:29 UTC
Created attachment 111404 [details]
Libreoffice - global menu issue, screenshot

Not sure if that was reported but at the moment when launching office files (libreoffice-fresh, 6.0.2-1) directly there are two possible incorrect outputs in LO:

1) First topmenu item (in global menu) - File, is not clickable.

2) Or before correct menu items, there are some sub-menus as main ones. It's temporal and disappears when changing window focus resulting in correct, fully working global menu (first item is clickable).
When trying to click those incorrect menus latte with AWC (Active Window Control) crashes and upon restore clean menu items are restored.
Because of that behavior it's very hard to make screens but I manged and I'm attaching it here.

You can see on the screenshot bogus menu items in that order (in Polish language): New, (empty space) Help, LO -info, close LO and then goes my dummy menu item LO and finally the correct menus.

When LO files are opened through LO launcher, the issue is not happening.

Temporal workaround for it is to create some dummy, first menu item so the "Files" becomes second and always accessible.

The same situation happens for others as described in this thread:

https://forum.manjaro.org/t/gtk-global-menu-is-coming-to-plasma-5-13/42112/20
Comment 1 Kai Uwe Broulik 2018-03-15 07:50:21 UTC
That's LibreOffice 6's own gmenu implementation being completely broken. Can you try with appmenu-gtk-module instead? I have seen this bug myself but haven't found a proper solution yet as LibreOffice hardly signals any menu and layout changes for its own menu making it rather difficult to get a correct menu.
Comment 2 Michał Dybczak 2018-03-15 09:38:14 UTC
So how do I set LO global menu to use appmenu-gtk-module? I have it installed along with gmenu-dbusmenu-proxy and did export SAL_USE_VCLPLUGIN=gtk3 to ~/.xprofile
Comment 3 Kai Uwe Broulik 2018-03-15 09:39:08 UTC
You also need GTK_MODULES=appmenu-gtk-module 
Perhaps you need to force the GTK2 plugin instead, not sure
Comment 4 Michał Dybczak 2018-03-15 09:52:02 UTC
I'm not sure if I did it correctly. I changed ~/.xprofile

export SAL_USE_VCLPLUGIN=gtk
export GTK_MODULES=appmenu-gtk-module

Result is, I see situation 2) for a split of second and it automatically switches to situation 1) unclicable first menu

So it's a bit better but still broken.
Comment 5 Kai Uwe Broulik 2018-03-15 10:05:54 UTC
I can reproduce when I launch soffice --writer directly with LO 6. I sometimes get a broken app menu entangled into it, e.g. "New, Help, About, Quit, File, Edit, ..." or I get a non-responsive "File" entry
Comment 6 Michał Dybczak 2018-03-15 12:20:51 UTC
Is there a chance to cooperate this with libreoffice developers? Or maybe with someone from Munich KDE team?

I'm not a software developer or any IT specialist so I can only report what's on my machine and system. Bug is reproducible so it should be possible to test it somehow, I hope ;).

P.S. By the way, thanks Kai for the gmenu-dbusmenu-proxy! Aside this LO issue, all seems to work great for me. I love global menus and I'm happy that Plasma have it finally the way it was supposed to be. Now it's only a matter of polishing (LO issue) and in the future extending it to FF and Thunderbird :D.
Comment 7 Kai Uwe Broulik 2018-03-15 15:03:07 UTC
I found a way to fix the menu getting entangled and sometimes crashing but haven't yet found why the "File" menu stops working. 

Glad you like it :)

[1] https://phabricator.kde.org/D11350
Comment 8 Michał Dybczak 2018-03-15 20:14:26 UTC
Great! That's one thing to go.
Once git is updated I can test it myself.
Comment 9 Kai Uwe Broulik 2018-03-20 14:24:37 UTC
Git commit c9ba8e0cf7e518de95952762dc56d930df98339f by Kai Uwe Broulik.
Committed on 20/03/2018 at 14:23.
Pushed by broulik into branch 'master'.

[AppMenuModel] Don't store actions ourselves

Always redirect to the ones in m_menu in case they get deleted or otherwise altered.
Also emit dataChanged when an action changes and reset the model when it gets deleted.
This fixes the menu getting confused in LibreOffice 6 with gmenu-dbusmenu-proxy.

Differential Revision: https://phabricator.kde.org/D11350

M  +44   -25   applets/appmenu/plugin/appmenumodel.cpp
M  +2    -3    applets/appmenu/plugin/appmenumodel.h

https://commits.kde.org/plasma-workspace/c9ba8e0cf7e518de95952762dc56d930df98339f
Comment 10 Michał Dybczak 2018-05-04 08:19:20 UTC
I updated git version recently and I still have the issue with additional, crashy menu.
Is the fix not in git version yet?
Comment 11 Andrew Crouthamel 2018-10-18 19:18:46 UTC
Just chiming in here that I have the same issue with the File menu not responding. It seems somewhat random, as I can get it to work when opening a file directly from Dolphin sometimes, other times it doesn't work.

LibreOffice 6.1.2.1 10(Build:1)
KDE Plasma Version: 5.14.0
Qt Version: 5.11.2
KDE Frameworks Version: 5.50.0
Comment 12 Andrew Crouthamel 2018-10-18 19:20:08 UTC
*** Bug 395364 has been marked as a duplicate of this bug. ***
Comment 13 Michał Dybczak 2018-10-18 21:56:20 UTC
At the moment, when we open a document from a file directly we most likely get a scrambled menu (sometimes it fixes itself in a split of second, sometimes it stays).

When we focus to another app which has global menus and return to the libre document, the menu is corrected and the first item also works. If we focus to an app without global menus, the first item in the menu won't work.
If the menu fixes itself, then usually it works well.

A bit similar issue happens on Firefox outside Ubuntu systems when it's compiled with Unity patch and the global menu is from AWC, but instead first inactive menu item, all menu items are not working unless you try to activate them with mouse and then re-focus to another app with global menu and the return to the Firefox. In Libre the issue is much smaller in scope and don't require clicking on the menu, only re-focusing window.

From what I heard the issue with the Libre global menu should be fixed in LO version 6.2. We'll see.
Comment 14 Floreal 2018-10-18 21:59:49 UTC
I confirm the behaviour reported by Michał Dybczak in its last comment. I have the same issues...
Comment 15 Floreal 2018-10-18 22:00:27 UTC
I am on plasma 5.14.1, I forget to say that
Comment 16 Michał Dybczak 2018-10-18 22:08:59 UTC
I'm on Plasma 5.14.1 too, but the issue is rather with Libre (with how they implement menu) so at the moment we can only wait for LO 6.2 and see if it is really fixed or not.
Comment 17 Michał Dybczak 2021-01-21 16:02:00 UTC
This has been fixed a long time ago. LO global menus work great now.