From 7c11c463a3e7f821ed9f3c6de59e37358441952e Mon Sep 17 00:00:00 2001 From: Access Date: Tue, 20 Feb 2024 17:53:20 +0800 Subject: text_input: Implement input-method popups Co-authored-by: tadeokondrak --- include/sway/input/text_input.h | 3 +++ include/sway/input/text_input_popup.h | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 include/sway/input/text_input_popup.h (limited to 'include/sway') diff --git a/include/sway/input/text_input.h b/include/sway/input/text_input.h index 214e61d1..1993f928 100644 --- a/include/sway/input/text_input.h +++ b/include/sway/input/text_input.h @@ -21,18 +21,21 @@ struct sway_input_method_relay { struct sway_seat *seat; struct wl_list text_inputs; // sway_text_input::link + struct wl_list input_popups; // sway_input_popup::link struct wlr_input_method_v2 *input_method; // doesn't have to be present struct wl_listener text_input_new; struct wl_listener input_method_new; struct wl_listener input_method_commit; + struct wl_listener input_method_new_popup_surface; struct wl_listener input_method_grab_keyboard; struct wl_listener input_method_destroy; struct wl_listener input_method_keyboard_grab_destroy; }; + struct sway_text_input { struct sway_input_method_relay *relay; diff --git a/include/sway/input/text_input_popup.h b/include/sway/input/text_input_popup.h new file mode 100644 index 00000000..e5f6ab8b --- /dev/null +++ b/include/sway/input/text_input_popup.h @@ -0,0 +1,20 @@ +#ifndef _SWAY_INPUT_TEXT_INPUT_POPUP_H +#define _SWAY_INPUT_TEXT_INPUT_POPUP_H + +#include "sway/tree/view.h" + +struct sway_input_popup { + struct sway_input_method_relay *relay; + + struct wlr_scene_tree *scene_tree; + struct sway_popup_desc desc; + struct wlr_input_popup_surface_v2 *popup_surface; + + struct wl_list link; + + struct wl_listener popup_destroy; + struct wl_listener popup_surface_commit; + + struct wl_listener focused_surface_unmap; +}; +#endif -- cgit v1.2.3