vcl/inc/window.h | 1 + vcl/source/window/mouse.cxx | 9 ++++++++- vcl/source/window/window.cxx | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-)
New commits: commit 94cb2b0d0c85b8d0aa29d3a02d1d19cb9426d831 Author: Pranav Kant <pran...@collabora.co.uk> Date: Tue Feb 27 14:03:34 2018 +0530 lok: mouse pointer events on document windows only We only want to subscribe to the mouse pointer events of the document window, not anything else. Change-Id: Ie21db52b2dd0d4f55289896caba5174380316e65 Reviewed-on: https://gerrit.libreoffice.org/50412 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/vcl/inc/window.h b/vcl/inc/window.h index faf9e5162794..b5a6e5b49e51 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -355,6 +355,7 @@ public: const vcl::ILibreOfficeKitNotifier* mpLOKNotifier; ///< To emit the LOK callbacks eg. for dialog tunneling. vcl::LOKWindowId mnLOKWindowId; ///< ID of this specific window. + bool mbLOKParentNotifier; }; /// Sets up the buffer to have settings matching the window, and restores the original state in the dtor. diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index 2a9ec9765c29..aca2627c5f19 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -510,7 +510,14 @@ void Window::SetPointer( const Pointer& rPointer ) aPointerString = aIt->second; } - pWin->GetLOKNotifier()->libreOfficeKitViewCallback(LOK_CALLBACK_MOUSE_POINTER, aPointerString.getStr()); + // issue mouse pointer events only for document windows + // Doc windows' immediate parent SfxFrameViewWindow_Impl is the one with + // parent notifier set during initialization + if (GetParent()->ImplGetWindowImpl()->mbLOKParentNotifier && + GetParent()->ImplGetWindowImpl()->mnLOKWindowId == 0) + { + pWin->GetLOKNotifier()->libreOfficeKitViewCallback(LOK_CALLBACK_MOUSE_POINTER, aPointerString.getStr()); + } } } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 904932623a92..e665b48af9dc 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -750,6 +750,7 @@ WindowImpl::WindowImpl( WindowType nType ) mbDoubleBufferingRequested = bDoubleBuffer; // when we are not sure, assume it cannot do double-buffering via RenderContext mpLOKNotifier = nullptr; mnLOKWindowId = 0; + mbLOKParentNotifier = false; } WindowImpl::~WindowImpl() @@ -3254,6 +3255,8 @@ void Window::SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier, bool mpWindowImpl->mnLOKWindowId = sLastLOKWindowId++; GetLOKWindowsMap().insert(std::map<vcl::LOKWindowId, VclPtr<vcl::Window>>::value_type(mpWindowImpl->mnLOKWindowId, this)); } + else + mpWindowImpl->mbLOKParentNotifier = true; mpWindowImpl->mpLOKNotifier = pNotifier; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits