[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Mar 15 08:54:38 UTC 2019


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

New commits:
commit ef025d623a90484674f1fe0fdf2dabce36d2aa8d
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu Mar 14 14:58:15 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Mar 15 09:53:52 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/69269
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 4dbc5220ccea..85834534316c 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -241,6 +241,7 @@ namespace
 {
     struct LOKAsyncEventData
     {
+        int mnView; // Window is not enough.
         VclPtr<vcl::Window> mpWindow;
         VclEventId mnEvent;
         MouseEvent maMouseEvent;
@@ -253,6 +254,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:
@@ -299,6 +307,7 @@ namespace
             return;
         }
 
+        pEvent->mnView = SfxLokHelper::getView(nullptr);
         Application::PostUserEvent(Link<void*, void>(pEvent, LOKPostAsyncEvent));
     }
 }


More information about the Libreoffice-commits mailing list