[mutter/wip/carlosg/no-toggle-panel-across-focus: 7/7] wayland: Only enable OSK if receiving .enable when already active
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/no-toggle-panel-across-focus: 7/7] wayland: Only enable OSK if receiving .enable when already active
- Date: Sat, 9 Feb 2019 18:51:47 +0000 (UTC)
commit b4a4143fc7321bb89de577ed5c0b4f7eeaada92b
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Feb 8 22:51:28 2019 +0100
wayland: Only enable OSK if receiving .enable when already active
Enable the OSK if receiving .enable consecutively (i.e. the
ClutterInputFocus was already focused). We specifically want to avoid
enabling the panel just because of focus changes within a surface (where
the .disable request across focus change would previously unfocus the
ClutterInputFocus). Prior state should be preserved if possible in that
situation.
src/wayland/meta-wayland-text-input.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c
index f121bb069..c9599f14f 100644
--- a/src/wayland/meta-wayland-text-input.c
+++ b/src/wayland/meta-wayland-text-input.c
@@ -470,7 +470,7 @@ text_input_commit_state (struct wl_client *client,
{
MetaWaylandTextInput *text_input = wl_resource_get_user_data (resource);
ClutterInputFocus *focus = text_input->input_focus;
- gboolean toggle_panel = FALSE;
+ gboolean enable_panel = FALSE;
increment_serial (text_input, resource);
@@ -494,9 +494,12 @@ text_input_commit_state (struct wl_client *client,
else
return;
}
+ else
+ {
+ enable_panel = TRUE;
+ }
clutter_input_focus_set_can_show_preedit (focus, TRUE);
- toggle_panel = TRUE;
}
else if (clutter_input_focus_is_focused (focus))
{
@@ -546,8 +549,8 @@ text_input_commit_state (struct wl_client *client,
text_input->pending_state = META_WAYLAND_PENDING_STATE_NONE;
- if (toggle_panel)
- clutter_input_focus_set_input_panel_state (focus, CLUTTER_INPUT_PANEL_STATE_TOGGLE);
+ if (enable_panel)
+ clutter_input_focus_set_input_panel_state (focus, CLUTTER_INPUT_PANEL_STATE_ON);
}
static struct zwp_text_input_v3_interface meta_text_input_interface = {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]