Kaydet (Commit) 645a3303 authored tarafından Michael Meeks's avatar Michael Meeks

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: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst ece27693
...@@ -243,6 +243,7 @@ namespace ...@@ -243,6 +243,7 @@ namespace
{ {
struct LOKAsyncEventData struct LOKAsyncEventData
{ {
int mnView; // Window is not enough.
VclPtr<vcl::Window> mpWindow; VclPtr<vcl::Window> mpWindow;
VclEventId mnEvent; VclEventId mnEvent;
MouseEvent maMouseEvent; MouseEvent maMouseEvent;
...@@ -255,6 +256,13 @@ namespace ...@@ -255,6 +256,13 @@ namespace
if (pLOKEv->mpWindow->IsDisposed()) if (pLOKEv->mpWindow->IsDisposed())
return; 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) switch (pLOKEv->mnEvent)
{ {
case VclEventId::WindowKeyInput: case VclEventId::WindowKeyInput:
...@@ -301,6 +309,7 @@ namespace ...@@ -301,6 +309,7 @@ namespace
return; return;
} }
pEvent->mnView = SfxLokHelper::getView(nullptr);
Application::PostUserEvent(Link<void*, void>(pEvent, LOKPostAsyncEvent)); Application::PostUserEvent(Link<void*, void>(pEvent, LOKPostAsyncEvent));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment