Opened 2 years ago

Last modified 3 weeks ago

#15777 confirmed defect (port to stable)

Validator disables the mnemonic letter of dialog buttons in wxGTK

Reported by: jbbbms Owned by:
Priority: normal Milestone:
Component: wxGTK Version: 3.0.0
Keywords: wxTextValidator Cc:
Blocked By: Blocking:
Patch: no

Description

For example, the affirmative button with label "&Ok" can not be clicked via Alt-O, if the keyboard focus is currently on a control of which a text validator not allowing letter 'O' being input by the user. The attached file demos this problem. Also, it doesn't have this problem in wxMSW.

Attachments (1)

buggy.cpp download (522 bytes) - added by jbbbms 2 years ago.

Download all attachments as: .zip

Change History (8)

Changed 2 years ago by jbbbms

comment:1 follow-up: Changed 2 years ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [75453]) Don't intercept accelerators in wxTextValidator in wxGTK.

Key events with modifiers shouldn't be filtered by the validator as they are
used as accelerators and not for the text entry at all.

Closes #15777.

comment:2 Changed 2 years ago by vadz

  • Milestone set to 3.0.1
  • Resolution changed from fixed to port to stable
  • Status changed from closed to portneeded

r75451, r75452 and r75453 could be backported to 3.0 if no problems are found.

comment:3 in reply to: ↑ 1 Changed 2 years ago by neis

  • Status changed from portneeded to new

Replying to VZ:

Key events with modifiers shouldn't be filtered by the validator as they are
used as accelerators and not for the text entry at all.

Unfortunately, that might not really be true. E.g. on german keyboard, the right "Alt-Key" (AltGr) is used in combination with some normal keys to produce quite a lot of symbols (²³{}[]\|~€@). Not sure, what key events GTK generates for those, though.

comment:4 Changed 2 years ago by vadz

  • Milestone 3.0.1 deleted
  • Status changed from new to confirmed

Oops, thanks for noticing this. I'll revert this commit, thanks.

comment:5 Changed 2 years ago by VZ

(In [75521]) Revert "Don't intercept accelerators in wxTextValidator in wxGTK."

Testing for absence of Alt modifier is wrong as it could be specified for the
events generated by AltGr-letter key combinations (AltGr is Alt+Ctrl), so this
commit broke the validation of any such symbols entered from non-US keyboard.

This is worse than the problem it was trying to fix, so revert this for now.
The real fix will need to ensure that the mnemonics are checked first, i.e.
before generating EVT_CHAR, in wxGTK, just as it already happens in wxMSW.

This reverts r75453.

See #15777.

comment:6 Changed 3 weeks ago by jolz

bug not solved in wx3.1.0

Reproduce:

  • run validate sample
  • in test dialog activate one of the two number validators at the buttom of the dialog.
  • press "Alt+O".

comment:7 Changed 3 weeks ago by vadz

Yes, the fix was reverted, so the bug is still there.

Note: See TracTickets for help on using tickets.