diff options
author | Thomas Viehmann <tv@beamnet.de> | 2020-11-23 21:03:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-11-25 14:56:33 +0100 |
commit | 5270d6901ba69f411b595fa9e2d123169905ab72 (patch) | |
tree | 391440c69169fc464898283d3e0eef0f303095d2 /vcl/unx | |
parent | f9ba4668d857e8d3576d11c2d64317a4e42081d4 (diff) |
tdf#138425 vcl/gtk activate main menu in UpdateFull
VCL GTK (in contrast to X11 and apparently Windows) pre-activates popup
menus in GtkSalMenu::UpdateFull by calling GtkSalMenu::ActivateAllSubmenus.
Before this patch, this, called on the main menu, would not activate
the main menu itself (which does get activated in X11 eventually).
This patch changes the logic to also activate the main menu.
This patch deals only with gtk3. A followup patch would do the analogous
change in the VCL Qt5 plugin in Qt5Menu::DoFullMenuUpdate.
I haven't discovered yet where this type of functionality is currently
tested, so sadly I don't have an idea how to test this and so didn't include
a test case.
Change-Id: I6cd9929acfd3b3af731bbc62d649d643044ca692
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106454
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit cbc18cc904c652a936c4b68fba4d975bd89b5abd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106583
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtksalmenu.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/vcl/unx/gtk3/gtk3gtksalmenu.cxx b/vcl/unx/gtk3/gtk3gtksalmenu.cxx index 195e8ce071d2..72ad6e40d6bd 100644 --- a/vcl/unx/gtk3/gtk3gtksalmenu.cxx +++ b/vcl/unx/gtk3/gtk3gtksalmenu.cxx @@ -1205,23 +1205,23 @@ void GtkSalMenu::DispatchCommand(const gchar *pCommand) void GtkSalMenu::ActivateAllSubmenus(Menu* pMenuBar) { - for (GtkSalMenuItem* pSalItem : maItems) + // We can re-enter this method via the new event loop that gets created + // in GtkClipboardTransferable::getTransferDataFlavorsAsVector, so use the InActivateCallback + // flag to detect that and skip some startup work. + if (!mbInActivateCallback) { - if ( pSalItem->mpSubMenu != nullptr ) + mbInActivateCallback = true; + pMenuBar->HandleMenuActivateEvent(GetMenu()); + mbInActivateCallback = false; + for (GtkSalMenuItem* pSalItem : maItems) { - // We can re-enter this method via the new event loop that gets created - // in GtkClipboardTransferable::getTransferDataFlavorsAsVector, so use the InActivateCallback - // flag to detect that and skip some startup work. - if (!pSalItem->mpSubMenu->mbInActivateCallback) + if ( pSalItem->mpSubMenu != nullptr ) { - pSalItem->mpSubMenu->mbInActivateCallback = true; - pMenuBar->HandleMenuActivateEvent(pSalItem->mpSubMenu->GetMenu()); - pSalItem->mpSubMenu->mbInActivateCallback = false; pSalItem->mpSubMenu->ActivateAllSubmenus(pMenuBar); - pSalItem->mpSubMenu->Update(); - pMenuBar->HandleMenuDeActivateEvent(pSalItem->mpSubMenu->GetMenu()); } } + Update(); + pMenuBar->HandleMenuDeActivateEvent(GetMenu()); } } |