Don't reuse the same event object for multiple events in wxGTK.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 18 Jul 2010 11:53:04 +0000 (11:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 18 Jul 2010 11:53:04 +0000 (11:53 +0000)
commit2933f70a8bc80a12097fac5ae9e63e4a34005121
treeac69f9e7037c440b5043eae96753fbedec592cda
parent1cf9a80cc155489b6158376d7a517021d68a84e9
Don't reuse the same event object for multiple events in wxGTK.

The old code simply called SetEventType() to change the type of the event and
called HandleWindowEvent() again with it. This was incorrect as the event was
modified after being processed the first time, notably its WasProcessed() flag
was set and so wxApp::FilterEvent() wasn't called when it was being processed
the second time. In practice this meant that FilterEvent() was never called
for wxEVT_CHAR events -- for which it's nevertheless very useful to have as it
allows to implement application-wide keyboard processing.

Also refactor the code to avoid duplication, exactly the same event sending
code was used in gtk_window_key_press_callback() and gtk_wxwindow_commit_cb().
Extract it now in a private SendCharHookAndCharEvents() function.

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