Kaydet (Commit) 8d53d01f authored tarafından Katarina Behrens's avatar Katarina Behrens

tdf#96739: Send Ctrl-Left/RightShift events to correct window

Another regression from commit 74407aef. SystemWindow should
consume only Alt pressed/released events and let key input window
handle the rest of modkey events

Change-Id: I304701fe63ee86bad534ba003ea05991d06f433d
Reviewed-on: https://gerrit.libreoffice.org/21854Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst a6238f82
......@@ -2098,9 +2098,15 @@ static void ImplHandleSalKeyMod( vcl::Window* pWindow, SalKeyModEvent* pEvent )
}
// #105224# send commandevent to allow special treatment of Ctrl-LeftShift/Ctrl-RightShift etc.
// + auto-accelerator feature, tdf#92630
vcl::Window *pChild = nullptr;
// Alt pressed or released => give SystemWindow a chance to handle auto-accelerator
if ( pEvent->mnCode == KEY_MOD2 || (pEvent->mnModKeyCode & MODKEY_MOD2) != 0 )
{
// find window - first look to see if the system window is available
vcl::Window* pChild = pWindow->ImplGetWindowImpl()->mpFirstChild;
pChild = pWindow->ImplGetWindowImpl()->mpFirstChild;
while ( pChild )
{
......@@ -2108,10 +2114,14 @@ static void ImplHandleSalKeyMod( vcl::Window* pWindow, SalKeyModEvent* pEvent )
break;
pChild = pChild->ImplGetWindowImpl()->mpNext;
}
}
//...if not, try to find a key input window...
if (!pChild) ImplGetKeyInputWindow( pWindow );
if (!pChild)
pChild = ImplGetKeyInputWindow( pWindow );
//...otherwise fail safe...
if (!pChild) pChild = pWindow;
if (!pChild)
pChild = pWindow;
CommandModKeyData data( pEvent->mnModKeyCode );
ImplCallCommand( pChild, CommandEventId::ModKeyChange, &data );
......
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