framework/source/uielement/menubarmanager.cxx | 4 ++-- vcl/osx/salnsmenu.mm | 1 + vcl/unx/gtk/gtksalmenu.cxx | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-)
New commits: commit ab67543e09568368b41faf3510841a1dd48b993f Author: Maxim Monastirsky <momonas...@gmail.com> Date: Mon Aug 29 13:29:28 2016 +0300 Toolbar popups need explicit deactivation ... if based on MenuBarManager, because unlike context menus, we reuse the same menu instead of creating from scratch each time, so that it suffers from the same "double activation" problem as in tdf#97665. Note that for GtkSalMenu the problem is only for the top level popup menu, as the Deactivate callback is properly called when sub menus are closed. The non-native case also had this problem, but only when closing the menu by selecting one of its items, and was fixed already in b41deb2ef057c3bd43fa61448bb4d7299138c8d4. Change-Id: Iee037f7baba0f80c32fb3a45f16511f8585c203e diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 560db80..6379451 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -1026,8 +1026,8 @@ IMPL_LINK_TYPED( MenuBarManager, Select, Menu *, pMenu, bool ) } if ( !m_bHasMenuBar ) - // Standalone popup menu doesn't fire deactivate event in this case, - // so we have to reset the active flag here. + // Standalone (non-native) popup menu doesn't fire deactivate event + // in this case, so we have to reset the active flag here. m_bActive = false; return true; diff --git a/vcl/osx/salnsmenu.mm b/vcl/osx/salnsmenu.mm index cd22b78..be772f9 100644 --- a/vcl/osx/salnsmenu.mm +++ b/vcl/osx/salnsmenu.mm @@ -58,6 +58,7 @@ else if( mpMenu->mpVCLMenu ) { mpMenu->mpVCLMenu->Activate(); + mpMenu->mpVCLMenu->Deactivate(); // Hide disabled items NSArray* elements = [pMenu itemArray]; diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx index 75c19c3..8856410 100644 --- a/vcl/unx/gtk/gtksalmenu.cxx +++ b/vcl/unx/gtk/gtksalmenu.cxx @@ -399,6 +399,8 @@ bool GtkSalMenu::ShowNativePopupMenu(FloatingWindow* pWin, const Rectangle& rRec } g_main_loop_unref(pLoop); + mpVCLMenu->Deactivate(); + gtk_widget_insert_action_group(mpFrame->getMouseEventWidget(), "win", nullptr); gtk_widget_destroy(pWidget); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits