diff options
author | xdavidwu <xdavidwuph@gmail.com> | 2020-01-12 10:20:32 +0800 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-04-04 11:42:04 +0200 |
commit | 1241b42c88f0ee2f9dfabb91e41196224699be01 (patch) | |
tree | 1058510309e8b1495a6b7c17f8d53bc4ac8bdb93 | |
parent | Port input method and text input from rootston (diff) | |
download | sway-1241b42c88f0ee2f9dfabb91e41196224699be01.tar.gz sway-1241b42c88f0ee2f9dfabb91e41196224699be01.tar.zst sway-1241b42c88f0ee2f9dfabb91e41196224699be01.zip |
input-method: remove surface listener before set
This make sure pending focused surface listener is not reachable from
old surface.
-rw-r--r-- | sway/input/text_input.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sway/input/text_input.c b/sway/input/text_input.c index 3e446cb9..f3fca68e 100644 --- a/sway/input/text_input.c +++ b/sway/input/text_input.c | |||
@@ -57,6 +57,7 @@ static void handle_im_commit(struct wl_listener *listener, void *data) { | |||
57 | 57 | ||
58 | static void text_input_set_pending_focused_surface( | 58 | static void text_input_set_pending_focused_surface( |
59 | struct sway_text_input *text_input, struct wlr_surface *surface) { | 59 | struct sway_text_input *text_input, struct wlr_surface *surface) { |
60 | wl_list_remove(&text_input->pending_focused_surface_destroy.link); | ||
60 | text_input->pending_focused_surface = surface; | 61 | text_input->pending_focused_surface = surface; |
61 | wl_signal_add(&surface->events.destroy, | 62 | wl_signal_add(&surface->events.destroy, |
62 | &text_input->pending_focused_surface_destroy); | 63 | &text_input->pending_focused_surface_destroy); |