sfx2/source/view/lokhelper.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 645a33037116164eec7d2840a837d51f1f6abc5b
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Thu Mar 14 14:58:15 2019 +0100
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Fri Mar 15 17:09:15 2019 +0100

    LOK: switch view before event emission if necessary.
    
    Unfortunately we still have large amounts of global state, and key
    event handling in some corners requires this in addition to the window.
    
    Change-Id: Id817030536f9cb45dbc39551dfb5332fc6998c62
    Reviewed-on: https://gerrit.libreoffice.org/69266
    Tested-by: Jenkins
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 016ca841a263..768cedd9da44 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -243,6 +243,7 @@ namespace
 {
     struct LOKAsyncEventData
     {
+        int mnView; // Window is not enough.
         VclPtr<vcl::Window> mpWindow;
         VclEventId mnEvent;
         MouseEvent maMouseEvent;
@@ -255,6 +256,13 @@ namespace
         if (pLOKEv->mpWindow->IsDisposed())
             return;
 
+        int nView = SfxLokHelper::getView(nullptr);
+        if (nView != pLOKEv->mnView)
+        {
+            SAL_INFO("sfx.view", "LOK - view mismatch " << nView << " vs. " << 
pLOKEv->mnView);
+            SfxLokHelper::setView(pLOKEv->mnView);
+        }
+
         switch (pLOKEv->mnEvent)
         {
         case VclEventId::WindowKeyInput:
@@ -301,6 +309,7 @@ namespace
             return;
         }
 
+        pEvent->mnView = SfxLokHelper::getView(nullptr);
         Application::PostUserEvent(Link<void*, void>(pEvent, 
LOKPostAsyncEvent));
     }
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to