summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-05-21 11:43:31 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-05-21 17:28:13 +0200
commit9e0e97b716ab074d4558c76a62a66bf597f332a5 (patch)
tree15d25f25a2c9d10bb095bc2cf2422f623ee37ba8 /toolkit
parentaeb2014ba401707dece5d0cf3cb213ce307a5330 (diff)
Related tdf#122920 Treat UNO key events the same as mouse events
by sending the notifications to the parent windows as well Change-Id: Ibb33f608d7b9c3871aadd0c13db32effd99fe698 Reviewed-on: https://gerrit.libreoffice.org/72675 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxwindow.cxx33
1 files changed, 18 insertions, 15 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index bacb184fded0..27d06f564c34 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -653,24 +653,27 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
}
break;
case VclEventId::WindowKeyInput:
- {
- if ( mpImpl->getKeyListeners().getLength() )
- {
- css::awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent(
- *static_cast<KeyEvent*>(rVclWindowEvent.GetData()), *this
- ) );
- mpImpl->getKeyListeners().keyPressed( aEvent );
- }
- }
- break;
case VclEventId::WindowKeyUp:
{
- if ( mpImpl->getKeyListeners().getLength() )
+ VclPtr<vcl::Window> pWin = GetWindow();
+ while (pWin)
{
- css::awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent(
- *static_cast<KeyEvent*>(rVclWindowEvent.GetData()), *this
- ) );
- mpImpl->getKeyListeners().keyReleased( aEvent );
+ VCLXWindow* pXWindow = pWin->GetWindowPeer();
+ if (!pXWindow || pXWindow->mpImpl->getKeyListeners().getLength() == 0)
+ {
+ pWin = pWin->GetWindow(GetWindowType::RealParent);
+ continue;
+ }
+
+ awt::KeyEvent aEvent(VCLUnoHelper::createKeyEvent(
+ *static_cast<KeyEvent*>(rVclWindowEvent.GetData()), *this));
+ if (rVclWindowEvent.GetId() == VclEventId::WindowKeyInput)
+ pXWindow->mpImpl->getKeyListeners().keyPressed(aEvent);
+ else
+ pXWindow->mpImpl->getKeyListeners().keyReleased(aEvent);
+
+ // Next window (parent)
+ pWin = pWin->GetWindow(GetWindowType::RealParent);
}
}
break;