Bug 96875 - Submenus of MenuBarManager based context menus don't work (OS X native menus only)
Summary: Submenus of MenuBarManager based context menus don't work (OS X native menus ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
5.2.0.0.alpha0+
Hardware: All macOS (All)
: medium major
Assignee: Maxim Monastirsky
URL:
Whiteboard: target:5.2.0
Keywords: regression
Depends on:
Blocks:
 
Reported: 2016-01-03 17:30 UTC by steve
Modified: 2016-10-25 19:11 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
menu items missing (24.71 KB, image/jpeg)
2016-01-03 17:30 UTC, steve
Details

Note You need to log in before you can comment on or make changes to this bug.
Description steve 2016-01-03 17:30:07 UTC
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:43.0) Gecko/20100101 Firefox/43.0
Build Identifier: LibreOffice 5.2.0.0.alpha0

see screenshot.

On OS X 10.11.2 the menu options for "Paste Only" are blank. There is a dropdown, but it's empty and nothing can be selected.

Reproducible: Always

Steps to Reproduce:
1. Open calc
2. right click any cell
3. select "Paste Only"
Actual Results:  
menu items missing

Expected Results:  
menu items should be appearing.

[Information automatically included from LibreOffice]
Locale: en-US
Module: SpreadsheetDocument
OS: Mac OS X 10.11.1
OS is 64bit: yes


Reset User Profile?No
Comment 1 steve 2016-01-03 17:30:30 UTC
Created attachment 121696 [details]
menu items missing
Comment 2 steve 2016-01-03 17:38:50 UTC
Works as expected in Version: 5.0.2.2 so added keyword "regression"
Comment 3 Buovjaga 2016-01-03 17:45:19 UTC
No repro.

Win 7 Pro 64-bit Version: 5.2.0.0.alpha0+
Build ID: b4082bed2de12cd576a06a9f456a71101809f3ed
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-01-02_00:47:38
Locale: fi-FI (fi_FI)
Comment 4 steve 2016-01-03 17:47:10 UTC
adding iplaw: Alex, could you test, if this is reproducible on your OS X system with the latest nightly build?
Comment 5 Julien Nabet 2016-01-03 19:10:11 UTC
Just for the record, I don't reproduce this with master sources updated today.
Comment 6 Alex Thurgood 2016-01-04 10:41:40 UTC
Version: 5.2.0.0.alpha0+
Build ID: 5ff0c0c283217fdb87f78e1f06c90db0af16b59f
CPU Threads: 2; OS Version: -; UI Render: default; 
Locale : fr-FR (fr.UTF-8)

Confirming
Comment 7 Maxim Monastirsky 2016-01-08 12:40:19 UTC
What happened recently is the switch to MenuBarManager for handling these menus. MenuBarManager sets the text/select handler when the submenu activates - in MenuBarManager::Activate, but it's never called. The solution is apparently to adapt menuNeedsUpdate delegate (vcl/osx/salnsmenu.mm#37) to call Menu::Activate, which indeed makes these menu items work when clicking them. Oddly the text is still missing - although AquaSalMenu::SetItemText seems to be called with the right strings. So need to investigate more.
Comment 8 Maxim Monastirsky 2016-01-10 06:56:51 UTC
(In reply to Maxim Monastirsky from comment #7)
> Oddly the text is still missing - although AquaSalMenu::SetItemText
> seems to be called with the right strings. So need to investigate more.
Think I found it: AquaSalMenu::ShowNativePopupMenu is creating a copy of the NSMenu, so most likely AquaSalMenu::SetItemText is modifying the wrong NSMenu instance.
Comment 9 Commit Notification 2016-01-11 23:32:27 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cbd483211e1ac9d9e724b5ba3e3e38a0c5abe55c

tdf#96875 Make OS X native context menus compatible

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Maxim Monastirsky 2016-01-11 23:38:52 UTC
Hope that's fine now.
Comment 11 steve 2016-01-13 08:53:21 UTC
Maxim, thanks a lot for your quick fix.

Verified with Version: 5.2.0.0.alpha0+
Build ID: c995196ff0e9f7041b03fc513d703d6e60b8c867
CPU Threads: 8; OS Version: -; UI Render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2016-01-12_23:55:31
Locale: de-DE (de.UTF-8)