diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2019-03-14 14:58:15 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-03-15 18:19:53 +0100 |
commit | e55b17786719e6e6a6346e6e2ea0a5928b70aaf1 (patch) | |
tree | de33f2b915de82d903aca351fed0bf8c3a83d360 | |
parent | 5f55b69773e89d4013f9c1f68d6c362bfe67e911 (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.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index f18d193a5de8..9060fa05778a 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -217,6 +217,7 @@ namespace { struct LOKAsyncEventData { + int mnView; // Window is not enough. VclPtr<vcl::Window> mpWindow; sal_uLong mnEvent; MouseEvent maMouseEvent; @@ -229,6 +230,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 VCLEVENT_WINDOW_KEYINPUT: @@ -275,6 +283,7 @@ namespace return; } + pEvent->mnView = SfxLokHelper::getView(nullptr); Application::PostUserEvent(Link<void*, void>(pEvent, LOKPostAsyncEvent)); } } |