You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In wxGTK, wxTextEntry autocomplete interferes with the wxTE_PROCESS_ENTER style for comboboxes. If autocomplete is active for a combo box, then the wxTE_PROCESS_ENTER style will be cleared the first time the autocomplete dropdown is shown.
Note that this does not happen with wxTextCtrl.
The issue appears to be that wxTextAutoCompleteData::ToggleProcessEnter() cannot be safely called twice in a row with toggleOff set to true. The second time it's called, m_hadProcessEnterFlag will be unconditionally set to "false" regardless of what it was originally.
In my testing, wxTextAutoCompleteData::ToggleProcessEnter() is called twice in a row with toggleOff set to true when showing the autocomplete dropdown for a combobox, and twice with it set to false when hiding it. For a text control, it's called once with it set to true, and once with it set to false.
Expected vs observed behaviour:
Run the sample program.
Type the letter "a" in the combo box.
Hit "Enter".
Expected result: a dialog box pops up.
Actual result: nothing happens.
Patch or snippet allowing to reproduce the problem:
This style was reset and never re-enabled because the comboboxes get
multiple grab-notify notifications, unlike text controls, which only get
one.
Fix this by adding a counter of the number of times grab-notify was
called indicating that the popup was shown or hidden and only update the
style when its status actually effectively changes.
Also use a more clear name for the function called when the popup is
shown as having a Toggle(bool toggle) function was a bit confusing.
CloseswxWidgets#24394.
This style was reset and never re-enabled because the comboboxes get
multiple grab-notify notifications, unlike text controls, which only get
one.
Fix this by adding a counter of the number of times grab-notify was
called indicating that the popup was shown or hidden and only update the
style when its status actually effectively changes.
Also use a more clear name for the function called when the popup is
shown as having a Toggle(bool toggle) function was a bit confusing.
See #24489, #24394.
(cherry picked from commit 4b39d15)
Description
In wxGTK, wxTextEntry autocomplete interferes with the wxTE_PROCESS_ENTER style for comboboxes. If autocomplete is active for a combo box, then the wxTE_PROCESS_ENTER style will be cleared the first time the autocomplete dropdown is shown.
Note that this does not happen with wxTextCtrl.
The issue appears to be that
wxTextAutoCompleteData::ToggleProcessEnter()
cannot be safely called twice in a row withtoggleOff
set to true. The second time it's called,m_hadProcessEnterFlag
will be unconditionally set to "false" regardless of what it was originally.In my testing,
wxTextAutoCompleteData::ToggleProcessEnter()
is called twice in a row withtoggleOff
set to true when showing the autocomplete dropdown for a combobox, and twice with it set to false when hiding it. For a text control, it's called once with it set to true, and once with it set to false.Expected vs observed behaviour:
Expected result: a dialog box pops up.
Actual result: nothing happens.
Patch or snippet allowing to reproduce the problem:
combotest.cpp.gz
Platform and version information
wxWidgets version you use: Git head ( @66ea0b2 )
wxWidgets port you use: wxGTK
OS and its version: Gentoo Linux
The text was updated successfully, but these errors were encountered: