WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
311917
[WPE][Qt6] WPEQtView emits a premature focus change that crashes input method plugins on mouse click
https://bugs.webkit.org/show_bug.cgi?id=311917
Summary
[WPE][Qt6] WPEQtView emits a premature focus change that crashes input method...
aiswarya.kandoth
Reported
2026-04-10 01:38:25 PDT
Created
attachment 478992
[details]
Complete backtrace while using a virtual keyboard with the Qt6 API. WPEQtView::mousePressEvent() calls forceActiveFocus() unconditionally before checking whether m_webView is initialized. This causes Qt to emit a focusObjectChanged signal with the not yet ready web view as the new focus object. Input method plugin that receive this signal via QInputMethod::setFocusObject() may then attempt to inspect or cast the focus object and crash because of the uninitialized state. Steps to reproduce: 1. Run the example minibrowser with the Qt6 API. 2. Add a Qt input method plugin (eg: virtual keyboard) with appropriate changes in QML (addition of InputPanel component in QML will be necessary). 3. Click on the view using a mouse before the web view is fully initialized. 4. Application crashes with a segmentation fault. Relevant backtrace: #8 WPEQtView::mousePressEvent(QMouseEvent*) () from .../qt6/qml/org/wpewebkit/qtwpe/libqtwpe.so #7 QQuickItem::forceActiveFocus(Qt::FocusReason) () #6 QQuickItem::setFocus(bool, Qt::FocusReason) () #5 QQuickDeliveryAgentPrivate::setFocusInScope(...) #4 QWindow::focusObjectChanged(QObject*) ← focus change emitted for uninitialized view → input method plugin crashes here The complete backtrace produced when using a fork of cutekeyboard (
https://github.com/amarula/cutekeyboard/tree/main
) with an application using the Qt6 API is attached. Note that the crash can be prevented inside an input method plugin itself using appropriate cast that tolerates unexpected object types, with qobject_cast in the case of cutekeyboard for example. However, the correct fix is not to emit the focus change prematurely.
Attachments
Complete backtrace while using a virtual keyboard with the Qt6 API.
(1.67 KB, text/plain)
2026-04-10 01:38 PDT
,
aiswarya.kandoth
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
aiswarya.kandoth
Comment 1
2026-04-10 01:51:44 PDT
Proposed fix :
https://github.com/WebKit/WebKit/pull/62429
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug