summaryrefslogtreecommitdiffstats
path: root/examples/widgets/mainwindows/application
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-06-16 15:37:05 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-08-17 14:39:44 +0200
commit14e25d505d88cb11745a93b96c23e320e6cd2cc2 (patch)
tree288c360d20c10666a470aba223e1bd6527c3ffc3 /examples/widgets/mainwindows/application
parent2df1aa22e9617f68e0d88a29c8c4f473bb77b445 (diff)
macOS: Resend event if the first input method event changes focus
QAbstractItemView opens the editor and changes focus in response to the first QEvent::InputMethod event. Changing focus however cancels the current composition, so the key press is lost and needs to be repeated by the user. What QAbstractItemView does is probably not that unique, so fixing this there - if possible at all - is not a general solution. In the platform specific input method handling code, we can generally discover that the focus object changed in response to the InputMethod event that gets sent to the focus object. On macOS, we can then pass the key event to the input method once more, which works fine. On Windows and X11, the situation is more complicated. That the focus changed is easily discovered, but re-sending the key press in such a way that the input method responds doesn't seem possible. On Windows, using SendInput simply delivers the exact key to the focus object, without starting the expected composition. On X11 with IBus, it should be possible to call ProcessKeyEvent again on the IBus input context when we discover in filterEventFinished that the focus object changed while delivering the event. However, any attempt to do so has no effect. So, for now only fixing this for macOS. Task-number: QTBUG-54848 Change-Id: I0f7b786cfa57430e6a1e7d605415265cf53eb675 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 0c2ca26cd9583092f3ade7b18bc2423336a6202b) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'examples/widgets/mainwindows/application')
0 files changed, 0 insertions, 0 deletions