summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-03-14 14:58:15 +0100
committerMichael Meeks <michael.meeks@collabora.com>2019-03-15 17:09:15 +0100
commit645a33037116164eec7d2840a837d51f1f6abc5b (patch)
tree59d998cb70312dd13d57e88955d0a58d1cffc4eb /sfx2
parentece27693ba52417bc4b68045f5544a5cc43299dc (diff)
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.meeks@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/lokhelper.cxx9
1 files changed, 9 insertions, 0 deletions
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));
}
}