imwayland: Avoid TOGGLE_INPUT_PANEL requests if there's no focus
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 20 Mar 2018 14:17:31 +0000 (15:17 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 20 Mar 2018 14:56:53 +0000 (15:56 +0100)
commit4f78abddfc8a815a7e02f5347d5326412190f66f
treea1cfdcd5a5486feb4ac4ac91021216f09802ef6f
parent6e2d14037cea356638a9bea7b611cbe23bc90b47
imwayland: Avoid TOGGLE_INPUT_PANEL requests if there's no focus

Fixes two things: 1) As GTK+ can be coerced into using the wayland IM
module despite the compositor not implementing the interface, all paths
not checking for global state before sending requests are prone to
crashes, this one fell hit this pitfall.

And 2) ensures the tap gesture only triggers TOGGLE_INPUT_PANEL if the
widget IM is focused. This is a possibility on eg. WebKit pages, where
its IM is only focused as long as a form element in the page is focused.
Tapping elsewhere shouldn't toggle the OSK.

https://gitlab.gnome.org/GNOME/gtk/issues/114

Closes: #114
modules/input/imwayland.c