summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2018-02-27 14:03:34 +0530
committerJan Holesovsky <kendy@collabora.com>2018-02-27 12:13:09 +0100
commit94cb2b0d0c85b8d0aa29d3a02d1d19cb9426d831 (patch)
tree4b6e857834eec26cee5901d4e2e59e6eec86059b
parent9ee412c85066ccb48face646c80f4b6e2e34902d (diff)
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 <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--vcl/inc/window.h1
-rw-r--r--vcl/source/window/mouse.cxx9
-rw-r--r--vcl/source/window/window.cxx3
3 files changed, 12 insertions, 1 deletions
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;
}