Keyboard input is not working for Qt wayland clients

Bug #1718632 reported by Alan Griffiths on 2017-09-21
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Alan Griffiths

Bug Description

Running a wayland client in miral-app...


QT_QPA_PLATFORM=wayland /usr/lib/x86_64-linux-gnu/qt5/examples/webkitqml/flickrview/flickrview

Entering text in the "search" field doesn't work.

Gerry confirms this is a problem with other examples.

Related branches

Gerry Boland (gerboland) on 2017-09-21
Changed in mir:
assignee: nobody → Gerry Boland (gerboland)
Gerry Boland (gerboland) wrote :

My working theory is that wl_keyboard_send_enter is not being called, to inform Qt that its surface should expect key events.

Gerry Boland (gerboland) wrote :

Yep, theory confirmed. Adding

auto* key_state = new struct wl_array;
wl_keyboard_send_enter(resource, serial, target, key_state);

to WlKeyboard::handle_event() does restore key input. That's obviously a nasty hack, need to tie keyboard focus in to the window manager.

Gerry Boland (gerboland) wrote :

Am struggling to see how best to tie this into Mir.

msh::AbstractShell::set_focus_to_locked is the place where a focus change starts. It interacts with 2 objects, a ms::Surface, and the InputTargeter.

The InputTargeter does point to the focused surface, but it doesn't do anything special on focus surface change. I could inherit it to specialise mi::SurfaceInputDispatcher::set_focus_locked, but then I question why we weren't doing that with the Mir protocol.

Otherwise I could hack MirSurface::configure, but that just notifies the client of focus change via the Mir protocol.

So replacing the InputTargeter strikes me as the least worst option.

Gerry Boland (gerboland) wrote :

Nope, ignore all the above

Alan Griffiths (alan-griffiths) wrote :

Shouldn't you be intercepting mir_event_type_window with attribute mir_window_attrib_focus?

Changed in mir:
assignee: Gerry Boland (gerboland) → Alan Griffiths (alan-griffiths)
Mir CI Bot (mir-ci-bot) wrote :

Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 1.0.0

Changed in mir:
status: Triaged → Fix Committed
Changed in mir:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers