Tweak wxGTK keyboard handling to allow accelerators to work again.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Mar 2013 22:36:57 +0000 (22:36 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Mar 2013 22:36:57 +0000 (22:36 +0000)
commit819638a71fd3a0eb1e8d04d81d5df1a3de1c108c
tree010e6c07bc35842fe63c2f0f85c3e308e9d8414b
parent98eb2e84e883b50168b678693704613fe29d89d9
Tweak wxGTK keyboard handling to allow accelerators to work again.

Accelerators were broken by the changes of r72640 which were done to ensure
that the focused window gets the keyboard event first, before its top level
parent. Fix them now by still passing the events to the focused window first
but also passing them to the parent top level if it hasn't been handled by the
focused child.

Unfortunately this is still not fully compatible with wxMSW because in wxGTK
wxEVT_CHAR handler must skip the event in order to allow the accelerator using
the same key to work, while in wxMSW the accelerator can only be suppressed by
overriding wxWindow::MSWShouldPreProcessMessage(). We will need to make the
two ports behave in the same way when the event is not skipped in the future.

But for now, at least make them both behave correctly when the handler does
skip the event.

Closes #14553.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
samples/keyboard/keyboard.cpp
src/gtk/toplevel.cpp