From 96fa2f494560bcc90584a458438db688b7f0aa88 Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Wed, 23 Sep 2020 10:59:44 -0400 Subject: [PATCH] lok: sidebar: avoid deactivation when the sidebar is painting When two views (SfxViewFrame) get activated and deactivated frequently when one view grab the focus and lose focus (respectively), in multiple user this is not true, both users have the view active at the same time. The patch removes the overhead when painting a sidebar window to avoid unnecessary deactivation. Change-Id: Ica5837c9f2eda5db1bee69ec2297e54c4845d467 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103263 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro (cherry picked from commit 0a8be32f6130a4b84cd3f9ca70f6109dd78bf434) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103441 Tested-by: Jenkins --- sfx2/source/appl/app.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index fbd45b3e49b3..16592e536f27 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -254,7 +255,9 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame ) { if ( bTaskActivate ) NotifyEvent( SfxViewEventHint( SfxEventHintId::DeactivateDoc, GlobalEventConfig::GetEventName(GlobalEventId::DEACTIVATEDOC), pOldFrame->GetObjectShell(), pOldFrame->GetFrame().GetController() ) ); - pOldFrame->DoDeactivate( bTaskActivate, pFrame ); + + if ( !comphelper::LibreOfficeKit::isDialogPainting() ) + pOldFrame->DoDeactivate( bTaskActivate, pFrame ); if( pOldFrame->GetProgress() ) pOldFrame->GetProgress()->Suspend(); -- 2.11.4.GIT