summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2018-08-26 23:54:13 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2018-08-31 00:09:20 +0200
commit4b8ef8bd6acfa9c062146bff2168fb0450e9542e (patch)
treecb722bc05431c0273a202b106f461931960f1724 /framework
parente2ecce7e01038baac502f4b69c7ad47e82cd1ab4 (diff)
tdf#119390 Don't focus the toolbar when closing a floating window
Toolbar popup windows have the toolbar as their direct parent. This causes problems when such window is teared-off and later closed, as Window::dispose will attempt to move the focus to its parent which is the toolbar, instead of what users expect to have the focus back in the document area, or in whatever was the last focused control. As a solution reparent the window before dispose, similar to what happens with floating toolbars. Also return the focus to the main window when popup mode ends, so we can keep track of the last focused control. This is also a good thing by itself, as WB_OWNERDRAWDECORATION windows don't get the focus by default, which results in neither the floating window nor the document have focus after tear-off. Change-Id: I060b8c45a64db9c612da58b7c35478bab41a4558 Reviewed-on: https://gerrit.libreoffice.org/59811 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/toolbarmanager.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index b6fe68308b9b..5ca1bb8daa69 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -234,8 +234,9 @@ void ToolBarManager::Destroy()
// Hide toolbar as lazy delete can destroy the toolbar much later.
m_pToolBar->Hide();
- /* #i99167# removed change for i93173 since there is some weird crash */
- // #i93173# delete toolbar lazily as we can still be in one of its handlers
+ // #i93173# delete toolbar lazily as we can still be in one of its handlers
+ // tdf#119390 this will reparent the toolbar, so focus is restored from a
+ // floating toolbar to the last focused control of the application window.
m_pToolBar->doLazyDelete();
m_pToolBar->SetSelectHdl( Link<ToolBox *, void>() );