<div dir="ltr"><div><span style="line-height:1.5">On Wed, Jun 8, 2016 at 5:40 PM Arnaud Vrac <<a href="mailto:avrac@freebox.fr">avrac@freebox.fr</a>> wrote:</span><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Without this the input method state will not stay in sync with the<br>
client state.<br>
---<br>
src/text-backend.c | 18 ++++++++++++++----<br>
1 file changed, 14 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/text-backend.c b/src/text-backend.c<br>
index 0c000ba..c32ec04 100644<br>
--- a/src/text-backend.c<br>
+++ b/src/text-backend.c<br>
@@ -121,6 +121,16 @@ static void<br>
input_method_init_seat(struct weston_seat *seat);<br>
<br>
static void<br>
+text_input_set_input_panel_visible(struct text_input *text_input, bool visible)<br>
+{<br>
+ if (text_input->input_panel_visible == visible)<br>
+ return;<br>
+<br>
+ text_input->input_panel_visible = visible;<br>
+ zwp_text_input_v1_send_input_panel_state(text_input->resource, visible);<br>
+}<br>
+<br>
+static void<br>
deactivate_input_method(struct input_method *input_method)<br>
{<br>
struct text_input *text_input = input_method->input;<br>
@@ -140,7 +150,7 @@ deactivate_input_method(struct input_method *input_method)<br>
if (wl_list_empty(&text_input->input_methods) &&<br>
text_input->input_panel_visible) {<br>
wl_signal_emit(&ec->hide_input_panel_signal, ec);<br>
- text_input->input_panel_visible = false;<br>
+ text_input_set_input_panel_visible(text_input, false);<br>
text_input->manager->current_panel = NULL;<br>
}<br>
zwp_text_input_v1_send_leave(text_input->resource);<br>
@@ -207,7 +217,7 @@ text_input_activate(struct wl_client *client,<br>
current = text_input->manager->current_panel;<br>
<br>
if (current && current != text_input) {<br>
- current->input_panel_visible = false;<br>
+ text_input_set_input_panel_visible(current, false);<br>
wl_signal_emit(&ec->hide_input_panel_signal, ec);<br>
text_input->manager->current_panel = NULL;<br>
}<br>
@@ -331,7 +341,7 @@ text_input_show_input_panel(struct wl_client *client,<br>
struct text_input *text_input = wl_resource_get_user_data(resource);<br>
struct weston_compositor *ec = text_input->ec;<br>
<br>
- text_input->input_panel_visible = true;<br>
+ text_input_set_input_panel_visible(text_input, true);<br>
<br>
if (!wl_list_empty(&text_input->input_methods)) {<br>
wl_signal_emit(&ec->show_input_panel_signal,<br>
@@ -348,7 +358,7 @@ text_input_hide_input_panel(struct wl_client *client,<br>
struct text_input *text_input = wl_resource_get_user_data(resource);<br>
struct weston_compositor *ec = text_input->ec;<br>
<br>
- text_input->input_panel_visible = false;<br>
+ text_input_set_input_panel_visible(text_input, false);<br>
<br>
if (!wl_list_empty(&text_input->input_methods) &&<br>
text_input == text_input->manager->current_panel) {<br>
--<br>
2.7.4<br>
<br></blockquote><div><br></div><div><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif">Yes that is definitely correct like this.</font></div><span style="font-size:13px;color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><div><br></div>Reviewed-by:<span class="inbox-inbox-inbox-inbox-Apple-converted-space"> Jan Arne Petersen <<a href="mailto:janarne@gmail.com">janarne@gmail.com</a>></span></span><br><br><div class="gmail_quote"><br class="inbox-inbox-Apple-interchange-newline"></div><div> </div></div></div>