summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2016-01-27 15:46:41 +0100
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-02-04 08:20:34 +0000
commit8d53d01f38b856f177aca3ed4d3cba3db10f24a5 (patch)
treed5717876f361c2c49fe3c5253ba065530c8cc5e2
parenta6238f8222714465fe7a11477706ad19a1b3bebb (diff)
tdf#96739: Send Ctrl-Left/RightShift events to correct window
Another regression from commit 74407aef94b6d8df. 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/21854 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--vcl/source/window/winproc.cxx26
1 files changed, 18 insertions, 8 deletions
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 4fb5c9ce4645..48604b8a0e9a 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -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.
+ // + auto-accelerator feature, tdf#92630
- // find window - first look to see if the system window is available
- vcl::Window* pChild = pWindow->ImplGetWindowImpl()->mpFirstChild;
+ vcl::Window *pChild = nullptr;
- 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 )
- break;
- pChild = pChild->ImplGetWindowImpl()->mpNext;
+ // find window - first look to see if the system window is available
+ pChild = pWindow->ImplGetWindowImpl()->mpFirstChild;
+
+ while ( pChild )
+ {
+ if ( pChild->ImplGetWindowImpl()->mbSysWin )
+ 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 );