summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-03-14 14:58:15 +0100
committerJan Holesovsky <kendy@collabora.com>2019-03-15 09:53:52 +0100
commitef025d623a90484674f1fe0fdf2dabce36d2aa8d (patch)
tree379303dfc30e3da3dc4137b02afb001d7c691e27
parent41b22ebcb480e1e4a78e83b7bc211f73ad62ab31 (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/69269 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
-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 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));
}
}