summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2016-02-07 17:53:40 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2016-02-15 12:08:07 +0000
commit2abdcfd641883f246fe78f2fbe38499c9382c059 (patch)
treeafbe57205258c7371f732389deb33c33cd49d639 /framework
parent7347248254595c082682180f7a1cfe768f5509a6 (diff)
tdf#97665 Let's hope that over activation isn't really needed
- MenuBarManager::Activate has a check for duplicate activation, which makes the second activation attempt fail. Removing this check or deactivating after each activation will likely affect performance even more, but on the other hand should solve lp#1296715, which was the main reason of the over activation in the first place. So let's activate only one menu at a time, and do full activation only on the initial update. - Unfortunately the HUD activation callback doesn't work, so we still have to keep active status listener for all menu items. (Which is BTW against the recommendation in XPopupMenuController::updatePopupMenu IDL doc. Fortunately the performance problem hardly noticeable on modern hw.) Change-Id: I96affa72412f3f38160fdca4b6efd20ca68d059f Reviewed-on: https://gerrit.libreoffice.org/22369 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/menubarmanager.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 871881728f53..d5ae1d6ea4bd 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -385,10 +385,6 @@ throw ( RuntimeException, std::exception )
OUString aFeatureURL = Event.FeatureURL.Complete;
SolarMutexGuard aSolarGuard;
- if ( m_bHasMenuBar )
- {
- vcl::MenuInvalidator::Invalidated();
- }
{
if ( m_bDisposed )
return;
@@ -487,6 +483,8 @@ throw ( RuntimeException, std::exception )
pMenuItemHandler->xMenuItemDispatch.clear();
}
}
+ if ( m_bHasMenuBar && !m_bActive )
+ m_pVCLMenu->UpdateNativeMenu();
}
}
@@ -893,9 +891,8 @@ IMPL_LINK_TYPED( MenuBarManager, Activate, Menu *, pMenu, bool )
if ( !bPopupMenu )
{
xMenuItemDispatch->addStatusListener( static_cast< XStatusListener* >( this ), aTargetURL );
- xMenuItemDispatch->removeStatusListener( static_cast< XStatusListener* >( this ), aTargetURL );
- if ( m_bHasMenuBar )
- xMenuItemDispatch->addStatusListener( static_cast< XStatusListener* >( this ), aTargetURL );
+ if ( !m_bHasMenuBar )
+ xMenuItemDispatch->removeStatusListener( static_cast< XStatusListener* >( this ), aTargetURL );
}
}
else if ( !bPopupMenu )