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,20 +2098,30 @@ static void ImplHandleSalKeyMod( vcl::Window* pWindow, SalKeyModEvent* pEvent ) ...@@ -2098,20 +2098,30 @@ static void ImplHandleSalKeyMod( vcl::Window* pWindow, SalKeyModEvent* pEvent )
} }
// #105224# send commandevent to allow special treatment of Ctrl-LeftShift/Ctrl-RightShift etc. // #105224# send commandevent to allow special treatment of Ctrl-LeftShift/Ctrl-RightShift etc.
// + auto-accelerator feature, tdf#92630
// find window - first look to see if the system window is available vcl::Window *pChild = nullptr;
vcl::Window* pChild = pWindow->ImplGetWindowImpl()->mpFirstChild;
while ( pChild ) // Alt pressed or released => give SystemWindow a chance to handle auto-accelerator
if ( pEvent->mnCode == KEY_MOD2 || (pEvent->mnModKeyCode & MODKEY_MOD2) != 0 )
{ {
if ( pChild->ImplGetWindowImpl()->mbSysWin ) // find window - first look to see if the system window is available
break; pChild = pWindow->ImplGetWindowImpl()->mpFirstChild;
pChild = pChild->ImplGetWindowImpl()->mpNext;
while ( pChild )
{
if ( pChild->ImplGetWindowImpl()->mbSysWin )
break;
pChild = pChild->ImplGetWindowImpl()->mpNext;
}
} }
//...if not, try to find a key input window... //...if not, try to find a key input window...
if (!pChild) ImplGetKeyInputWindow( pWindow ); if (!pChild)
pChild = ImplGetKeyInputWindow( pWindow );
//...otherwise fail safe... //...otherwise fail safe...
if (!pChild) pChild = pWindow; if (!pChild)
pChild = pWindow;
CommandModKeyData data( pEvent->mnModKeyCode ); CommandModKeyData data( pEvent->mnModKeyCode );
ImplCallCommand( pChild, CommandEventId::ModKeyChange, &data ); 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