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 54a8c0e115b24d42f4b4ec6b8194f5b62e08201b
Author: Pranav Kant <pran...@collabora.co.uk>
Date:   Tue Feb 27 14:03:34 2018 +0530

    lok: mouse pointer events on document windows only
    
    Change-Id: Ie21db52b2dd0d4f55289896caba5174380316e65

diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index a0f158f8d559..648143e96545 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -384,6 +384,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 f073c9739a65..2804bc1ceb54 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -496,7 +496,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 5571e74a4cea..a7c50c793969 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -741,6 +741,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()
@@ -3221,6 +3222,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

Reply via email to