This reverts the previous attempt of commit
250ad9311a ("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 27473d1c0f
("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 dd46727b99 ("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>
This is nominally a regression from commit
43bc303148 (unify color selectors,
2016-10-28), but that just changed the Writer color picker to behave the
same way as the Impress one.
The Impress one started to emit these events with
daeed90f45 (re-base on ALv2 code.
Includes:, 2012-11-15), to fix i#118707, improving accessibility.
That means either the focus changes and then accessibility is happy or
the focus does not change and then the UNO API client only gets events
when the user actually switches to an other window.
Fix the problem with suppressing UNO-level notifications for the
problematic events, by moving the existing VclListenerLock to a public
header and using it at two more places in svtools.
This should address not just color selectors, but in general other
toolbar menus / popup windows.
Change-Id: If427708c5b9fe4fa49cb8f00ec04b32cb28eb391
Reviewed-on: https://gerrit.libreoffice.org/48570
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files
Change-Id: Ide9e7c53b554f0a36e2078a8823f5ef6fb5cc8fa
In this first commit, I use the plugin to verify the consistency of our
SAL_CALL annotations.
The point being to make the next commit more mechanical in nature,
purely using the rewriter.
There are various chunks of unix-only code that have never had to be
compiled by MSVC, hence the inconsistencies.
In bridges, I had to inline some typedefs to make the verification code
happy, since it cannot see into typedefs.
Change-Id: Iec6e274bed857febf7295cfcf5e9f21fe4a34da0
Reviewed-on: https://gerrit.libreoffice.org/45502
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Insert constructor everywhere, except a couple places that apparently
want to compare GetMapUnit().
Change-Id: I1910deb60562e5e949203435e827057f70a3f988
As any .ui based docking window gets it unconditionally,
see extractDeferredBits function in builder.cxx.
Change-Id: I339a72989ad09d8ea7106f5690fc950ee7ba35da
and implement a check in the plugin to prevent us modifying the
same patch of source code twice. This logic should probably be moved
into plugin.cxx at some point.
Change-Id: I7ebff6424cc8733bb2c8f7dba75eaaec68649290
Reviewed-on: https://gerrit.libreoffice.org/42660
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
- Base SvxCurrencyToolBoxControl on PopupWindowController,
so we still allow tearoff, but without marking the window
as self-decorated (unless actually teared-off).
- Add support for toggle state to PopupWindowController.
Change-Id: I60e004e6ada3efe092352cb93be5aae346073f83
Reviewed-on: https://gerrit.libreoffice.org/40557
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
had to change the structure of the plugin considerably, was too messy to
structure it to do the calculations on a per-function basis
Change-Id: I4edee7735f726101105c607368124a08dba21086
Reviewed-on: https://gerrit.libreoffice.org/40516
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
I'm fairly sure there are more simplifications that could be make here.
It seems like we have both an ID and a string name for all of these
events, and we could probably get by with just one of those, or
alternately, centralise the name<->id mapping somewhere
Change-Id: I978073822ddbebce94ac5b560fea675bea905a35
Reviewed-on: https://gerrit.libreoffice.org/40392
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Use m_xUrlTransformer, and drop the now unneeded m_xContext.is()
check.
Here is the history of this:
- commit ef8f9cfb26 (CWS docking1) introduced this code in
ToolboxController::execute.
- commit a2bbbc5130 (CWS docking3) copy-pasted this into
GenericToolbarController::execute.
- commit 0fc90c8a06 (CWS insight02) changed the original
code, but not the copy-pasted one.
- commit d7afd8e128 (CWS toolbars2) That CWS didn't have
the above change yet, and copy-pasted the old code to yet
another place (GenericToolboxController::execute).
Change-Id: I7f4e8dfb52b96ea5285ea7b2bb3083847dd84932
Mostly generated using
make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle"
Except some modules have their own foo::tools namespace, so there have
to use ::tools::Rectangle. This commit just moves the class from the
global namespace, it does not update pre/postwin.h yet.
Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2
Reviewed-on: https://gerrit.libreoffice.org/35923
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>