Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In wxGTK, wxTextEntry autocomplete interferes with the wxTE_PROCESS_ENTER style for comboboxes #24394

Closed
Carnildo opened this issue Mar 10, 2024 · 1 comment
Labels

Comments

@Carnildo
Copy link

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 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:

  1. Run the sample program.
  2. Type the letter "a" in the combo box.
  3. Hit "Enter".

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

    • GTK version: 3.24.39
    • Which GDK backend is used: X11
    • Desktop environment: XFCE
@vadz vadz added the GTK label Apr 18, 2024
vadz added a commit to vadz/wxWidgets that referenced this issue Apr 18, 2024
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.

Closes wxWidgets#24394.
@vadz
Copy link
Contributor

vadz commented Apr 18, 2024

Thanks for reporting, should be fixed by the linked PR, please let me know if you see any problems with it.

@vadz vadz closed this as completed in 4b39d15 Apr 24, 2024
vadz added a commit that referenced this issue Apr 24, 2024
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)
vadz added a commit that referenced this issue Apr 24, 2024
Don't initialize member variables in their declarations.

See #24489, #24394.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants