Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2012 Openismus GmbH |
Jan Arne Petersen | 4c26518 | 2012-09-09 23:08:30 +0200 | [diff] [blame^] | 3 | * Copyright © 2012 Intel Corporation |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 4 | * |
| 5 | * Permission to use, copy, modify, distribute, and sell this software and |
| 6 | * its documentation for any purpose is hereby granted without fee, provided |
| 7 | * that the above copyright notice appear in all copies and that both that |
| 8 | * copyright notice and this permission notice appear in supporting |
| 9 | * documentation, and that the name of the copyright holders not be used in |
| 10 | * advertising or publicity pertaining to distribution of the software |
| 11 | * without specific, written prior permission. The copyright holders make |
| 12 | * no representations about the suitability of this software for any |
| 13 | * purpose. It is provided "as is" without express or implied warranty. |
| 14 | * |
| 15 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS |
| 16 | * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 17 | * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 18 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER |
| 19 | * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF |
| 20 | * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
| 21 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 22 | */ |
| 23 | |
| 24 | #include <stdlib.h> |
| 25 | |
| 26 | #include "compositor.h" |
| 27 | #include "text-server-protocol.h" |
| 28 | |
| 29 | struct input_method; |
| 30 | |
| 31 | struct text_model { |
| 32 | struct wl_resource resource; |
| 33 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 34 | struct weston_compositor *ec; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 35 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 36 | struct wl_list input_methods; |
Jan Arne Petersen | cd8cdcc | 2012-08-10 16:47:23 +0200 | [diff] [blame] | 37 | |
| 38 | struct wl_surface *surface; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | struct input_method { |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 42 | struct wl_resource *input_method_binding; |
| 43 | struct wl_global *input_method_global; |
Jan Arne Petersen | 5196374 | 2012-08-10 16:47:20 +0200 | [diff] [blame] | 44 | struct wl_global *text_model_factory_global; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 45 | struct wl_listener destroy_listener; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 46 | |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 47 | struct weston_compositor *ec; |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 48 | struct text_model *model; |
| 49 | |
| 50 | struct wl_list link; |
Jan Arne Petersen | cd8cdcc | 2012-08-10 16:47:23 +0200 | [diff] [blame] | 51 | |
| 52 | struct wl_listener keyboard_focus_listener; |
| 53 | |
| 54 | int focus_listener_initialized; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 55 | }; |
| 56 | |
Jan Arne Petersen | cd8cdcc | 2012-08-10 16:47:23 +0200 | [diff] [blame] | 57 | static void input_method_init_seat(struct weston_seat *seat); |
| 58 | |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 59 | static void |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 60 | deactivate_text_model(struct text_model *text_model, |
| 61 | struct input_method *input_method) |
Philipp Brüschweiler | 1746781 | 2012-07-11 22:25:30 +0200 | [diff] [blame] | 62 | { |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 63 | struct weston_compositor *ec = text_model->ec; |
Philipp Brüschweiler | 1746781 | 2012-07-11 22:25:30 +0200 | [diff] [blame] | 64 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 65 | if (input_method->model == text_model) { |
| 66 | wl_list_remove(&input_method->link); |
| 67 | input_method->model = NULL; |
Kristian Høgsberg | f97f379 | 2012-07-22 11:51:42 -0400 | [diff] [blame] | 68 | wl_signal_emit(&ec->hide_input_panel_signal, ec); |
Jan Arne Petersen | de3b6a1 | 2012-08-10 16:47:21 +0200 | [diff] [blame] | 69 | text_model_send_deactivated(&text_model->resource); |
Philipp Brüschweiler | 1746781 | 2012-07-11 22:25:30 +0200 | [diff] [blame] | 70 | } |
| 71 | } |
| 72 | |
| 73 | static void |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 74 | destroy_text_model(struct wl_resource *resource) |
| 75 | { |
Kristian Høgsberg | f97f379 | 2012-07-22 11:51:42 -0400 | [diff] [blame] | 76 | struct text_model *text_model = |
| 77 | container_of(resource, struct text_model, resource); |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 78 | struct input_method *input_method, *next; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 79 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 80 | wl_list_for_each_safe(input_method, next, &text_model->input_methods, link) |
| 81 | deactivate_text_model(text_model, input_method); |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 82 | |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 83 | free(text_model); |
| 84 | } |
| 85 | |
| 86 | static void |
| 87 | text_model_set_surrounding_text(struct wl_client *client, |
| 88 | struct wl_resource *resource, |
| 89 | const char *text) |
| 90 | { |
| 91 | } |
| 92 | |
| 93 | static void |
| 94 | text_model_set_cursor_index(struct wl_client *client, |
| 95 | struct wl_resource *resource, |
| 96 | uint32_t index) |
| 97 | { |
| 98 | } |
| 99 | |
| 100 | static void |
| 101 | text_model_activate(struct wl_client *client, |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 102 | struct wl_resource *resource, |
| 103 | struct wl_resource *seat, |
| 104 | struct wl_resource *surface) |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 105 | { |
| 106 | struct text_model *text_model = resource->data; |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 107 | struct weston_seat *weston_seat = seat->data; |
| 108 | struct text_model *old = weston_seat->input_method->model; |
| 109 | struct weston_compositor *ec = text_model->ec; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 110 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 111 | if (old == text_model) |
| 112 | return; |
Jan Arne Petersen | de3b6a1 | 2012-08-10 16:47:21 +0200 | [diff] [blame] | 113 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 114 | if (old) { |
| 115 | deactivate_text_model(old, |
| 116 | weston_seat->input_method); |
Jan Arne Petersen | de3b6a1 | 2012-08-10 16:47:21 +0200 | [diff] [blame] | 117 | } |
| 118 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 119 | weston_seat->input_method->model = text_model; |
| 120 | wl_list_insert(&text_model->input_methods, &weston_seat->input_method->link); |
Jan Arne Petersen | cd8cdcc | 2012-08-10 16:47:23 +0200 | [diff] [blame] | 121 | input_method_init_seat(weston_seat); |
| 122 | |
| 123 | text_model->surface = surface->data; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 124 | |
Kristian Høgsberg | f97f379 | 2012-07-22 11:51:42 -0400 | [diff] [blame] | 125 | wl_signal_emit(&ec->show_input_panel_signal, ec); |
Jan Arne Petersen | de3b6a1 | 2012-08-10 16:47:21 +0200 | [diff] [blame] | 126 | |
| 127 | text_model_send_activated(&text_model->resource); |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | static void |
| 131 | text_model_deactivate(struct wl_client *client, |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 132 | struct wl_resource *resource, |
| 133 | struct wl_resource *seat) |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 134 | { |
| 135 | struct text_model *text_model = resource->data; |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 136 | struct weston_seat *weston_seat = seat->data; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 137 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 138 | deactivate_text_model(text_model, |
| 139 | weston_seat->input_method); |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | static void |
| 143 | text_model_set_selected_text(struct wl_client *client, |
| 144 | struct wl_resource *resource, |
| 145 | const char *text, |
| 146 | int32_t index) |
| 147 | { |
| 148 | } |
| 149 | |
| 150 | static void |
| 151 | text_model_set_micro_focus(struct wl_client *client, |
| 152 | struct wl_resource *resource, |
| 153 | int32_t x, |
| 154 | int32_t y, |
| 155 | int32_t width, |
| 156 | int32_t height) |
| 157 | { |
| 158 | } |
| 159 | |
| 160 | static void |
| 161 | text_model_set_preedit(struct wl_client *client, |
| 162 | struct wl_resource *resource) |
| 163 | { |
| 164 | } |
| 165 | |
| 166 | static void |
| 167 | text_model_set_content_type(struct wl_client *client, |
| 168 | struct wl_resource *resource) |
| 169 | { |
| 170 | } |
| 171 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 172 | static const struct text_model_interface text_model_implementation = { |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 173 | text_model_set_surrounding_text, |
| 174 | text_model_set_cursor_index, |
| 175 | text_model_activate, |
| 176 | text_model_deactivate, |
| 177 | text_model_set_selected_text, |
| 178 | text_model_set_micro_focus, |
| 179 | text_model_set_preedit, |
| 180 | text_model_set_content_type |
| 181 | }; |
| 182 | |
Jan Arne Petersen | 5196374 | 2012-08-10 16:47:20 +0200 | [diff] [blame] | 183 | static void text_model_factory_create_text_model(struct wl_client *client, |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 184 | struct wl_resource *resource, |
Jan Arne Petersen | 4c26518 | 2012-09-09 23:08:30 +0200 | [diff] [blame^] | 185 | uint32_t id) |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 186 | { |
| 187 | struct input_method *input_method = resource->data; |
| 188 | struct text_model *text_model; |
| 189 | |
Philipp Brüschweiler | 1746781 | 2012-07-11 22:25:30 +0200 | [diff] [blame] | 190 | text_model = calloc(1, sizeof *text_model); |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 191 | |
| 192 | text_model->resource.destroy = destroy_text_model; |
Philipp Brüschweiler | 1746781 | 2012-07-11 22:25:30 +0200 | [diff] [blame] | 193 | |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 194 | text_model->resource.object.id = id; |
| 195 | text_model->resource.object.interface = &text_model_interface; |
Philipp Brüschweiler | 1746781 | 2012-07-11 22:25:30 +0200 | [diff] [blame] | 196 | text_model->resource.object.implementation = |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 197 | (void (**)(void)) &text_model_implementation; |
| 198 | text_model->resource.data = text_model; |
| 199 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 200 | text_model->ec = input_method->ec; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 201 | |
| 202 | wl_client_add_resource(client, &text_model->resource); |
| 203 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 204 | wl_list_init(&text_model->input_methods); |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 205 | }; |
| 206 | |
Jan Arne Petersen | 5196374 | 2012-08-10 16:47:20 +0200 | [diff] [blame] | 207 | static const struct text_model_factory_interface text_model_factory_implementation = { |
| 208 | text_model_factory_create_text_model |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 209 | }; |
| 210 | |
| 211 | static void |
Jan Arne Petersen | 5196374 | 2012-08-10 16:47:20 +0200 | [diff] [blame] | 212 | bind_text_model_factory(struct wl_client *client, |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 213 | void *data, |
| 214 | uint32_t version, |
| 215 | uint32_t id) |
| 216 | { |
| 217 | struct input_method *input_method = data; |
| 218 | |
| 219 | /* No checking for duplicate binding necessary. |
| 220 | * No events have to be sent, so we don't need the return value. */ |
Jan Arne Petersen | 5196374 | 2012-08-10 16:47:20 +0200 | [diff] [blame] | 221 | wl_client_add_object(client, &text_model_factory_interface, |
| 222 | &text_model_factory_implementation, |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 223 | id, input_method); |
| 224 | } |
| 225 | |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 226 | static void |
| 227 | input_method_commit_string(struct wl_client *client, |
| 228 | struct wl_resource *resource, |
| 229 | const char *text, |
| 230 | uint32_t index) |
| 231 | { |
| 232 | struct input_method *input_method = resource->data; |
| 233 | |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 234 | if (input_method->model) { |
| 235 | text_model_send_commit_string(&input_method->model->resource, text, index); |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 236 | } |
| 237 | } |
| 238 | |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 239 | static const struct input_method_interface input_method_implementation = { |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 240 | input_method_commit_string |
| 241 | }; |
| 242 | |
| 243 | static void |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 244 | unbind_input_method(struct wl_resource *resource) |
| 245 | { |
| 246 | struct input_method *input_method = resource->data; |
| 247 | |
| 248 | input_method->input_method_binding = NULL; |
| 249 | free(resource); |
| 250 | } |
| 251 | |
| 252 | static void |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 253 | bind_input_method(struct wl_client *client, |
| 254 | void *data, |
| 255 | uint32_t version, |
| 256 | uint32_t id) |
| 257 | { |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 258 | struct input_method *input_method = data; |
| 259 | struct wl_resource *resource; |
| 260 | |
| 261 | resource = wl_client_add_object(client, &input_method_interface, |
| 262 | &input_method_implementation, |
| 263 | id, input_method); |
| 264 | |
| 265 | if (input_method->input_method_binding == NULL) { |
| 266 | resource->destroy = unbind_input_method; |
| 267 | input_method->input_method_binding = resource; |
| 268 | return; |
| 269 | } |
| 270 | |
| 271 | wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, |
| 272 | "interface object already bound"); |
| 273 | wl_resource_destroy(resource); |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 274 | } |
| 275 | |
| 276 | static void |
| 277 | input_method_notifier_destroy(struct wl_listener *listener, void *data) |
| 278 | { |
Kristian Høgsberg | f97f379 | 2012-07-22 11:51:42 -0400 | [diff] [blame] | 279 | struct input_method *input_method = |
| 280 | container_of(listener, struct input_method, destroy_listener); |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 281 | |
Kristian Høgsberg | f97f379 | 2012-07-22 11:51:42 -0400 | [diff] [blame] | 282 | wl_display_remove_global(input_method->ec->wl_display, |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 283 | input_method->input_method_global); |
| 284 | wl_display_remove_global(input_method->ec->wl_display, |
Jan Arne Petersen | 5196374 | 2012-08-10 16:47:20 +0200 | [diff] [blame] | 285 | input_method->text_model_factory_global); |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 286 | free(input_method); |
| 287 | } |
| 288 | |
Jan Arne Petersen | cd8cdcc | 2012-08-10 16:47:23 +0200 | [diff] [blame] | 289 | static void |
| 290 | handle_keyboard_focus(struct wl_listener *listener, void *data) |
| 291 | { |
| 292 | struct wl_keyboard *keyboard = data; |
| 293 | struct input_method *input_method = |
| 294 | container_of(listener, struct input_method, keyboard_focus_listener); |
| 295 | struct wl_surface *surface = keyboard->focus; |
| 296 | |
| 297 | if (!input_method->model) |
| 298 | return; |
| 299 | |
| 300 | if (!surface || input_method->model->surface != surface) |
| 301 | deactivate_text_model(input_method->model, |
| 302 | input_method); |
| 303 | } |
| 304 | |
| 305 | static void |
| 306 | input_method_init_seat(struct weston_seat *seat) |
| 307 | { |
| 308 | if (seat->input_method->focus_listener_initialized) |
| 309 | return; |
| 310 | |
| 311 | if (seat->has_keyboard) { |
| 312 | seat->input_method->keyboard_focus_listener.notify = handle_keyboard_focus; |
| 313 | wl_signal_add(&seat->seat.keyboard->focus_signal, &seat->input_method->keyboard_focus_listener); |
| 314 | } |
| 315 | |
| 316 | seat->input_method->focus_listener_initialized = 1; |
| 317 | } |
| 318 | |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 319 | void |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 320 | input_method_create(struct weston_compositor *ec, |
| 321 | struct weston_seat *seat) |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 322 | { |
| 323 | struct input_method *input_method; |
| 324 | |
Philipp Brüschweiler | 1746781 | 2012-07-11 22:25:30 +0200 | [diff] [blame] | 325 | input_method = calloc(1, sizeof *input_method); |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 326 | |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 327 | input_method->ec = ec; |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 328 | input_method->model = NULL; |
Jan Arne Petersen | cd8cdcc | 2012-08-10 16:47:23 +0200 | [diff] [blame] | 329 | input_method->focus_listener_initialized = 0; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 330 | |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 331 | input_method->input_method_global = |
| 332 | wl_display_add_global(ec->wl_display, |
| 333 | &input_method_interface, |
| 334 | input_method, bind_input_method); |
| 335 | |
Jan Arne Petersen | 5196374 | 2012-08-10 16:47:20 +0200 | [diff] [blame] | 336 | input_method->text_model_factory_global = |
Philipp Brüschweiler | f25602b | 2012-07-11 22:25:31 +0200 | [diff] [blame] | 337 | wl_display_add_global(ec->wl_display, |
Jan Arne Petersen | 5196374 | 2012-08-10 16:47:20 +0200 | [diff] [blame] | 338 | &text_model_factory_interface, |
| 339 | input_method, bind_text_model_factory); |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 340 | |
| 341 | input_method->destroy_listener.notify = input_method_notifier_destroy; |
Philipp Brüschweiler | 1746781 | 2012-07-11 22:25:30 +0200 | [diff] [blame] | 342 | wl_signal_add(&ec->destroy_signal, &input_method->destroy_listener); |
Jan Arne Petersen | e829adc | 2012-08-10 16:47:22 +0200 | [diff] [blame] | 343 | |
| 344 | seat->input_method = input_method; |
Jan Arne Petersen | 1f17be4 | 2012-06-21 21:52:18 +0200 | [diff] [blame] | 345 | } |
Jan Arne Petersen | cd8cdcc | 2012-08-10 16:47:23 +0200 | [diff] [blame] | 346 | |