diff options
author | Jim Raykowski <raykowj@gmail.com> | 2023-11-08 12:25:47 -0900 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-02-01 12:04:16 +0100 |
commit | 2212b3d09bbd09a7a70095c18e8f43cd4b2019d5 (patch) | |
tree | 51791cebe0976033fde44ca3811fd787b4516203 /toolkit | |
parent | b573e50839c8671abc94ac53905b1b027a3807d7 (diff) |
tdf#158101 Make non-gtk backends context popup menu item
visibility behavior like gtk
For context popup menus, gtk's native popup menu hides disabled menu
items. This patch makes this the behavior for non-gtk backends while
preserving the intent of commit
a0955317900075371d6adb7f924af24c22f02d09 to make VCL PopupMenu respect
the officecfg::Office::Common::View::Menu::DontHideDisabledEntry setting.
Change-Id: Ice59f2b5ec20dac9d1b0891ccbd83dbbcd308078
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159192
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
(cherry picked from commit 1ac7350a7032a760be22cce845eab7efe435827d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162825
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxmenu.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 37785849c551..20d3d5d2d18a 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -481,8 +481,13 @@ sal_Int16 VCLXMenu::execute( if ( !mpMenu || !IsPopupMenu() ) return 0; } + PopupMenu* pPopupMenu = static_cast<PopupMenu*>(pMenu.get()); + MenuFlags nMenuFlags = pPopupMenu->GetMenuFlags(); + // #102790# context menus shall never show disabled entries + nMenuFlags |= MenuFlags::HideDisabledEntries; + pPopupMenu->SetMenuFlags(nMenuFlags); // cannot call this with mutex locked because it will call back into us - return static_cast<PopupMenu*>(pMenu.get())->Execute( + return pPopupMenu->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ), VCLRectangle( rPos ), static_cast<PopupMenuFlags>(nFlags) | PopupMenuFlags::NoMouseUpClose ); |