struct window *window;
char *text;
int active;
+ bool panel_visible;
uint32_t cursor;
uint32_t anchor;
struct {
text_entry_commit_and_reset(entry);
entry->active--;
- if (!entry->active)
+ if (!entry->active) {
zwp_text_input_v1_hide_input_panel(text_input);
+ entry->panel_visible = false;
+ }
widget_schedule_redraw(entry->widget);
}
entry->window = editor->window;
entry->text = strdup(text);
entry->active = 0;
+ entry->panel_visible = false;
entry->cursor = strlen(text);
entry->anchor = entry->cursor;
entry->text_input =
struct wl_surface *surface = window_get_wl_surface(entry->window);
if (entry->click_to_show && entry->active) {
- zwp_text_input_v1_show_input_panel(entry->text_input);
+ entry->panel_visible = !entry->panel_visible;
+
+ if (entry->panel_visible)
+ zwp_text_input_v1_show_input_panel(entry->text_input);
+ else
+ zwp_text_input_v1_hide_input_panel(entry->text_input);
return;
}