text_input: Implement input-method popups

origin one is the pr by tadeokondrak in pr 5890

Co-authored-by: tadeokondrak <me@tadeo.ca>
This commit is contained in:
ShootingStarDragons 2023-05-03 14:21:27 +08:00 committed by Access
parent d19810eba8
commit d3cd3f0169
2 changed files with 233 additions and 1 deletions

View file

@ -21,18 +21,37 @@ 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_input_popup {
struct sway_input_method_relay *relay;
struct wlr_scene_tree *scene_tree;
struct wlr_input_popup_surface_v2 *popup_surface;
int x, y;
bool visible;
struct wl_list link;
struct wl_listener popup_destroy;
struct wl_listener popup_surface_commit;
struct wl_listener focused_surface_unmap;
};
struct sway_text_input {
struct sway_input_method_relay *relay;