text-input: Handle text input being registered late
With gtk4 we get the focus event before the text-input is there so we don't ever invoke text_input.send_enter
thus not getting the input method activated. Handle that by keeping the focus surface around. This is equivalent to
.pending_focus_surface
for PhocInpout
but for PhocInputMethod
While at that i modernized the text-input overall a bit (using current indentation for functions I touched, not ignoring errors (some should likely turn into asserts but lets test drive that a bit, use type-checks, use Phoc*
types and phoc_*
prefixes so they get picked up by the documentation system.
Technically we need to listen for surface.destroy
for the pending surface. I'll do that as a follow up after more testing since PhocTextInput
's pending_focus_surface
needs the same fix.
Only mildly tested but putting this out so I can easily add the MR to my phoc-next branch.
Closes: squeekboard#298 (closed)