Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#17848 closed defect (fixed)

wxStyledTextCtrl on Wayland ignores keypresses after a backspace

Reported by: dghart Owned by: Vadim Zeitlin <vadim@…>
Priority: normal Milestone: 3.0.3
Component: wxStyledText Version: dev-latest
Keywords: wayland wxStyledTextCtrl keypress Cc:
Blocked By: Blocking:
Patch: yes


By default, fedora 25 uses Wayland and gtk+3. This combination causes CodeLite to lose most keypresses once the backspace key is has been pressed. Pressing CapsLock twice somehow makes them work again. AFAICT it happens only in wxStyledTextCtrls, and can easily be demonstrated in the stc sample.

Fortunately lehin in thread has found the cause and a fix. The problem is in src/gtk/window.cpp wxTranslateGTKKeyEventToWx, which leaves keycode zero when !GDK_IS_X11_DISPLAY. I don't know why it doesn't affect other controls, or gtk+2.

The attached patch sets it to keysym, which works and has no apparent side-effects. Presumably it would be better somehow to replicate the X11 calls but I don't know how, or indeed if it's necessary or possible in Wayland. Even if it were to break some keyboard combinations, that is less bad than the current freeze.

The bug affects both wx3.0 and wx3.1. The patch applies and works both for wx3.1 git and wx3.0 branch. I hope it's not too late for wx3.0.3...

Attachments (1)

gtkwindow.patch download (448 bytes) - added by dghart 4 years ago.

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by dghart

comment:1 Changed 4 years ago by vadz

Ironically enough, it looks like compilation fixes for Wayland broke the run-time functionality. I'll apply a slightly modified version of your patch in a moment, thanks!

comment:2 Changed 4 years ago by Vadim Zeitlin <vadim@…>

  • Owner set to Vadim Zeitlin <vadim@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 7542632302b0723c3ed7018dc843764ea62582b4/git-wxWidgets:

Fix keyboard event key codes when using Wayland

Correct the confusion between compile- and run-time checks for X11.

Closes #17848.

comment:3 Changed 4 years ago by Vadim Zeitlin <vadim@…>

In ef30edf5e0319b16e5384d031802e1669014b7f8/git-wxWidgets:

Fix keyboard event key codes when using Wayland

Correct the confusion between compile- and run-time checks for X11.

See #17848.

(cherry picked from commit 7542632302b0723c3ed7018dc843764ea62582b4)

Note: See TracTickets for help on using tickets.