diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-05-08 10:24:18 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-05-16 15:40:11 +0200 |
commit | f9905401d8cf2d73576231ebd84cfa5f4f73bcac (patch) | |
tree | c4151d098222cac20c53f6651595e5cb6ca410d0 /vcl | |
parent | 1489aa7467a2131e48d2995107d1415d9e59ea9e (diff) |
tdf#125170 Deliver mouse events also when clicking into document content
Event listeners are added once VCLXWindow::SetWindow is called.
This never happened for the document content window.
So we need to call Window::GetComponentInterface which will create an XWindowPeer
and then call UnoWrapper::SetWindowInterface which calls VCLXWindow::SetWindow.
After that, event listeners are registered so that we can deliver events.
Change-Id: I2ed01f1ab20d87fedc4803bdbd96f5ef14d40043
Reviewed-on: https://gerrit.libreoffice.org/71948
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/event.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index 399dddd3abaa..b786552a6789 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/awt/MouseEvent.hpp> #include <com/sun/star/awt/KeyModifier.hpp> #include <com/sun/star/awt/MouseButton.hpp> +#include <com/sun/star/awt/XWindow.hpp> #include <comphelper/scopeguard.hxx> namespace vcl { @@ -214,6 +215,11 @@ void Window::CallEventListeners( VclEventId nEvent, void* pData ) if ( xWindow->IsDisposed() ) return; + // If maEventListeners is empty, the XVCLWindow has not yet been initialized. + // Calling GetComponentInterface will do that. + if (mpWindowImpl->maEventListeners.empty()) + xWindow->GetComponentInterface(); + if (!mpWindowImpl->maEventListeners.empty()) { // Copy the list, because this can be destroyed when calling a Link... |