summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2018-01-28 00:54:23 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-02-08 09:22:42 +0100
commit3ecf542af410536d64d217c71002799bbe48b9c3 (patch)
treed7d6546295310410647f42a861137ab739d61dc8 /svtools
parent303f8e5160ddb39914ba7f669698d5dbe958878a (diff)
Different approach for tdf#115227
This reverts the previous attempt of commit 250ad9311a613d9b4e1cf5cf5fdaf33d9b326220 ("tdf#115227 svtools: suppress UNO notifications for color selectors"), in favor of a different fix. The advantage of this new approach is that is doesn't affect events other than activate/deativate, and that it covers more cases: Toolbar popups even if not based on svtools::ToolbarPopup, or if closed by clicking outside them, font name/size and paragraph style toolbar controls, notebookbar, context and main menus (for the non gtk3 native case, the gtk3 native menus left for a future investigation). For now, keep this logic inside toolkit, but ideally it should be in vcl (after reviewing vcl internal listeners). One side effect that I noticed after this change, is that there is a deactivation/activation pair which suppressed when e.g. opening a new document from the start center. But I'm not sure if that's a problem, given that the focus state of the top window as a whole wasn't changed, only its contents, and there are other APIs to track activation of document components. This happens because the source and the target windows of those events are the same, and we need to suppress this case to fix the font name/size style controls, and also the color picker after 27473d1c0f8ba3006262001cbefff33f639a19ac ("tdf#114935 Move the focus back to the document"). Otherwise we'll need to find another way to move the focus to the document w/o triggering listeners. Another case that will see a change in behavior, is document event listeners in dbaccess, as the Focus/UnFocus events there are based on top window activation/deactivation. However, I think it's a good change, as currently just opening of a toolbar popup or main/context menus there triggers those document events, making them useless. I would like to also mention here, that in fact those top window activation events never really worked as tdf#115227 expects them, as the superfluous events for at least the font name/size, style and color toolbar buttons existed already in OOo. The behavior of the color buttons changed in LO for a few years, but regressed again in the work on a real focus grabbing for floating windows starting with commit dd46727b99d4bb5135451aa7e5e1bdb197373843 ("Resolves; tdf#87120 no keyboard navigation inside floating windows"). That work also introduced superfluous events when using menus. And a note about the change in menubarwindow.cxx: When a menubar popup is closed it's deleted using the lazydelete mechanism, which reparents the popup window, so it doesn't appear anymore in the hierarchy of the document window. Moreover, I suspect that at some point the lazydelete thing will be replaced by a VclPtr mechanism, which might break this even further, so the event won't appear as coming from the popup window (which might be already disposed at this stage). So instead, temporarily set the menubar window as the current focus window, so the activation will appear as if it was coming from the menu bar window itself. Change-Id: I292232adfcbd1a31d66ce394cd2f1bf42a013ecb Reviewed-on: https://gerrit.libreoffice.org/48746 Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/toolbarmenu.cxx2
-rw-r--r--svtools/source/uno/popupwindowcontroller.cxx3
2 files changed, 0 insertions, 5 deletions
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index d4b69b1a747b..eb0c3dcc9b03 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -35,7 +35,6 @@
#include <svtools/framestatuslistener.hxx>
#include <svtools/valueset.hxx>
#include <svtools/toolbarmenu.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
#include "toolbarmenuimp.hxx"
using namespace ::com::sun::star::uno;
@@ -1487,7 +1486,6 @@ bool ToolbarPopup::IsInPopupMode()
void ToolbarPopup::EndPopupMode()
{
- VclListenerLock aLock(this, /*bSystemWindow=*/true);
GetDockingManager()->EndPopupMode(this);
}
diff --git a/svtools/source/uno/popupwindowcontroller.cxx b/svtools/source/uno/popupwindowcontroller.cxx
index 19276a45854f..51f2b6e10f42 100644
--- a/svtools/source/uno/popupwindowcontroller.cxx
+++ b/svtools/source/uno/popupwindowcontroller.cxx
@@ -19,7 +19,6 @@
#include <cppuhelper/supportsservice.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/svapp.hxx>
@@ -214,8 +213,6 @@ Reference< awt::XWindow > SAL_CALL PopupWindowController::createPopupWindow()
pWin->EnableDocking();
mxImpl->SetPopupWindow(pWin,pToolBox);
-
- VclListenerLock aLock(pWin, /*bSystemWindow=*/true);
vcl::Window::GetDockingManager()->StartPopupMode( pToolBox, pWin, eFloatFlags );
}
}