summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx5
-rw-r--r--sd/source/ui/view/drviews1.cxx19
2 files changed, 18 insertions, 6 deletions
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index c56a0f33e604..e75570a79638 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -414,6 +414,11 @@ protected:
void GetMenuStateSel(SfxItemSet& rSet);
private:
+ /** Prevents grabbing focus while loading - see tdf#83773 that intruduced
+ the grabbing, and tdf#150773 that needs grabbing disabled on loading
+ */
+ bool mbFirstTimeActivation = true;
+
/** This flag controls whether the layer mode is active, i.e. the layer
dialog is visible.
*/
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 9f372f67e320..64440617e611 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -79,13 +79,20 @@ void DrawViewShell::Activate(bool bIsMDIActivate)
{
ViewShell::Activate(bIsMDIActivate);
- // When the mode is switched to normal the main view shell grabs focus.
- // This is done for getting cut/copy/paste commands on slides in the left
- // pane (slide sorter view shell) to work properly.
- SfxShell* pTopViewShell = this->GetViewShellBase().GetViewShellManager()->GetTopViewShell();
- if (pTopViewShell && pTopViewShell == this)
+ // tdf#150773: do not grab focus on loading
+ if (mbFirstTimeActivation)
+ mbFirstTimeActivation = false;
+ else
{
- this->GetActiveWindow()->GrabFocus();
+
+ // When the mode is switched to normal the main view shell grabs focus.
+ // This is done for getting cut/copy/paste commands on slides in the left
+ // pane (slide sorter view shell) to work properly.
+ SfxShell* pTopViewShell = GetViewShellBase().GetViewShellManager()->GetTopViewShell();
+ if (pTopViewShell == this)
+ {
+ GetActiveWindow()->GrabFocus();
+ }
}
}