blob: 8f8781fc199b684828e4fd7943e32053185f118c [file] [log] [blame]
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -08001/*
2 * Copyright © 2012 Intel Corporation
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation for any purpose is hereby granted without fee, provided
6 * that the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of the copyright holders not be used in
9 * advertising or publicity pertaining to distribution of the software
10 * without specific, written prior permission. The copyright holders make
11 * no representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
13 *
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 */
22
Neil Roberts40c0c3f2013-10-29 20:13:45 +000023#include "config.h"
24
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080025#include <stdlib.h>
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080026#include <assert.h>
27#include <signal.h>
28#include <unistd.h>
Marek Chalupac8daf772015-03-30 06:37:55 -040029#include <string.h>
Bryce Harringtona7680262014-11-19 17:18:34 -080030
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080031#include "../src/compositor.h"
Derek Foremanf6a65922015-02-24 09:32:14 -060032#include "weston-test-server-protocol.h"
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080033
Neil Roberts40c0c3f2013-10-29 20:13:45 +000034#ifdef ENABLE_EGL
35#include <EGL/egl.h>
36#include <EGL/eglext.h>
Daniel Stonee7897712015-02-11 18:15:17 +000037#include "../src/weston-egl-ext.h"
Neil Roberts40c0c3f2013-10-29 20:13:45 +000038#endif /* ENABLE_EGL */
39
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080040struct weston_test {
41 struct weston_compositor *compositor;
42 struct weston_layer layer;
43 struct weston_process process;
Marek Chalupac3c3fc42015-03-30 09:17:40 -040044 struct weston_seat seat;
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080045};
46
47struct weston_test_surface {
48 struct weston_surface *surface;
Jason Ekstranda7af7042013-10-12 22:38:11 -050049 struct weston_view *view;
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080050 int32_t x, y;
51 struct weston_test *test;
52};
53
54static void
55test_client_sigchld(struct weston_process *process, int status)
56{
57 struct weston_test *test =
58 container_of(process, struct weston_test, process);
59
Emilio Pozuelo Monfortdae8a4b2014-02-07 09:34:48 +010060 /* Chain up from weston-test-runner's exit code so that automake
61 * knows the exit status and can report e.g. skipped tests. */
62 if (WIFEXITED(status) && WEXITSTATUS(status) != 0)
63 exit(WEXITSTATUS(status));
64
65 /* In case the child aborted or segfaulted... */
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080066 assert(status == 0);
67
68 wl_display_terminate(test->compositor->wl_display);
69}
70
71static struct weston_seat *
72get_seat(struct weston_test *test)
73{
Marek Chalupac3c3fc42015-03-30 09:17:40 -040074 return &test->seat;
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080075}
76
77static void
78notify_pointer_position(struct weston_test *test, struct wl_resource *resource)
79{
80 struct weston_seat *seat = get_seat(test);
Kristian Høgsberge3148752013-05-06 23:19:49 -040081 struct weston_pointer *pointer = seat->pointer;
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080082
Derek Foremanf6a65922015-02-24 09:32:14 -060083 weston_test_send_pointer_position(resource, pointer->x, pointer->y);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080084}
85
86static void
Jason Ekstrand918f2dd2013-12-02 21:01:53 -060087test_surface_configure(struct weston_surface *surface, int32_t sx, int32_t sy)
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080088{
Giulio Camuffo7fe01b12013-03-28 18:02:42 +010089 struct weston_test_surface *test_surface = surface->configure_private;
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080090 struct weston_test *test = test_surface->test;
91
Giulio Camuffo412e6a52014-07-09 22:12:56 +030092 if (wl_list_empty(&test_surface->view->layer_link.link))
93 weston_layer_entry_insert(&test->layer.view_list,
94 &test_surface->view->layer_link);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080095
Jason Ekstrand918f2dd2013-12-02 21:01:53 -060096 weston_view_set_position(test_surface->view,
97 test_surface->x, test_surface->y);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -080098
Kristian Høgsbergace0a392013-11-13 21:55:57 -080099 weston_view_update_transform(test_surface->view);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800100}
101
102static void
103move_surface(struct wl_client *client, struct wl_resource *resource,
104 struct wl_resource *surface_resource,
105 int32_t x, int32_t y)
106{
Kristian Høgsberg8f7f4832013-06-25 16:18:35 -0400107 struct weston_surface *surface =
108 wl_resource_get_user_data(surface_resource);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800109 struct weston_test_surface *test_surface;
110
Giulio Camuffo7fe01b12013-03-28 18:02:42 +0100111 test_surface = surface->configure_private;
Jason Ekstranda7af7042013-10-12 22:38:11 -0500112 if (!test_surface) {
113 test_surface = malloc(sizeof *test_surface);
114 if (!test_surface) {
115 wl_resource_post_no_memory(resource);
116 return;
117 }
118
119 test_surface->view = weston_view_create(surface);
120 if (!test_surface->view) {
121 wl_resource_post_no_memory(resource);
122 free(test_surface);
123 return;
124 }
125
126 surface->configure_private = test_surface;
127 surface->configure = test_surface_configure;
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800128 }
129
130 test_surface->surface = surface;
Kristian Høgsberg8f7f4832013-06-25 16:18:35 -0400131 test_surface->test = wl_resource_get_user_data(resource);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800132 test_surface->x = x;
133 test_surface->y = y;
134}
135
136static void
137move_pointer(struct wl_client *client, struct wl_resource *resource,
138 int32_t x, int32_t y)
139{
Kristian Høgsberg8f7f4832013-06-25 16:18:35 -0400140 struct weston_test *test = wl_resource_get_user_data(resource);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800141 struct weston_seat *seat = get_seat(test);
Kristian Høgsberge3148752013-05-06 23:19:49 -0400142 struct weston_pointer *pointer = seat->pointer;
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800143
Kristian Høgsberg068b61c2013-02-25 17:04:47 -0500144 notify_motion(seat, 100,
145 wl_fixed_from_int(x) - pointer->x,
146 wl_fixed_from_int(y) - pointer->y);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800147
148 notify_pointer_position(test, resource);
149}
150
151static void
152send_button(struct wl_client *client, struct wl_resource *resource,
153 int32_t button, uint32_t state)
154{
Kristian Høgsberg8f7f4832013-06-25 16:18:35 -0400155 struct weston_test *test = wl_resource_get_user_data(resource);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800156 struct weston_seat *seat = get_seat(test);
157
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800158 notify_button(seat, 100, button, state);
159}
160
161static void
162activate_surface(struct wl_client *client, struct wl_resource *resource,
163 struct wl_resource *surface_resource)
164{
165 struct weston_surface *surface = surface_resource ?
Kristian Høgsberg8f7f4832013-06-25 16:18:35 -0400166 wl_resource_get_user_data(surface_resource) : NULL;
167 struct weston_test *test = wl_resource_get_user_data(resource);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800168 struct weston_seat *seat;
169
170 seat = get_seat(test);
171
172 if (surface) {
173 weston_surface_activate(surface, seat);
Kristian Høgsberge3148752013-05-06 23:19:49 -0400174 notify_keyboard_focus_in(seat, &seat->keyboard->keys,
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800175 STATE_UPDATE_AUTOMATIC);
176 }
177 else {
178 notify_keyboard_focus_out(seat);
179 weston_surface_activate(surface, seat);
180 }
181}
182
183static void
184send_key(struct wl_client *client, struct wl_resource *resource,
185 uint32_t key, enum wl_keyboard_key_state state)
186{
Kristian Høgsberg8f7f4832013-06-25 16:18:35 -0400187 struct weston_test *test = wl_resource_get_user_data(resource);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800188 struct weston_seat *seat = get_seat(test);
189
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800190 notify_key(seat, 100, key, state, STATE_UPDATE_AUTOMATIC);
191}
192
Marek Chalupac8daf772015-03-30 06:37:55 -0400193static void
194device_release(struct wl_client *client,
195 struct wl_resource *resource, const char *device)
196{
197 struct weston_test *test = wl_resource_get_user_data(resource);
198 struct weston_seat *seat = get_seat(test);
199
200 if (strcmp(device, "pointer") == 0) {
201 weston_seat_release_pointer(seat);
202 } else if (strcmp(device, "keyboard") == 0) {
203 weston_seat_release_keyboard(seat);
204 } else if (strcmp(device, "touch") == 0) {
205 weston_seat_release_touch(seat);
206 } else if (strcmp(device, "seat") == 0) {
207 weston_seat_release(seat);
208 } else {
209 assert(0 && "Unsupported device");
210 }
211}
212
213static void
214device_add(struct wl_client *client,
215 struct wl_resource *resource, const char *device)
216{
217 struct weston_test *test = wl_resource_get_user_data(resource);
218 struct weston_seat *seat = get_seat(test);
219
220 if (strcmp(device, "pointer") == 0) {
221 weston_seat_init_pointer(seat);
222 } else if (strcmp(device, "keyboard") == 0) {
223 weston_seat_init_keyboard(seat, NULL);
224 } else if (strcmp(device, "touch") == 0) {
225 weston_seat_init_touch(seat);
226 } else {
227 assert(0 && "Unsupported device");
228 }
229}
230
Neil Roberts40c0c3f2013-10-29 20:13:45 +0000231#ifdef ENABLE_EGL
232static int
233is_egl_buffer(struct wl_resource *resource)
234{
235 PFNEGLQUERYWAYLANDBUFFERWL query_buffer =
236 (void *) eglGetProcAddress("eglQueryWaylandBufferWL");
237 EGLint format;
238
239 if (query_buffer(eglGetCurrentDisplay(),
240 resource,
241 EGL_TEXTURE_FORMAT,
242 &format))
243 return 1;
244
245 return 0;
246}
247#endif /* ENABLE_EGL */
248
249static void
250get_n_buffers(struct wl_client *client, struct wl_resource *resource)
251{
252 int n_buffers = 0;
253
254#ifdef ENABLE_EGL
255 struct wl_resource *buffer_resource;
256 int i;
257
258 for (i = 0; i < 1000; i++) {
259 buffer_resource = wl_client_get_object(client, i);
260
261 if (buffer_resource == NULL)
262 continue;
263
264 if (is_egl_buffer(buffer_resource))
265 n_buffers++;
266 }
267#endif /* ENABLE_EGL */
268
Derek Foremanf6a65922015-02-24 09:32:14 -0600269 weston_test_send_n_egl_buffers(resource, n_buffers);
Neil Roberts40c0c3f2013-10-29 20:13:45 +0000270}
271
Bryce Harringtonf280d112015-05-05 15:13:20 -0700272enum weston_test_screenshot_outcome {
273 WESTON_TEST_SCREENSHOT_SUCCESS,
274 WESTON_TEST_SCREENSHOT_NO_MEMORY,
275 WESTON_TEST_SCREENSHOT_BAD_BUFFER
276 };
277
278typedef void (*weston_test_screenshot_done_func_t)(void *data,
279 enum weston_test_screenshot_outcome outcome);
280
281struct test_screenshot {
282 struct weston_compositor *compositor;
283 struct wl_global *global;
284 struct wl_client *client;
285 struct weston_process process;
286 struct wl_listener destroy_listener;
287};
288
289struct test_screenshot_frame_listener {
290 struct wl_listener listener;
291 struct weston_buffer *buffer;
292 weston_test_screenshot_done_func_t done;
293 void *data;
294};
295
296static void
297copy_bgra_yflip(uint8_t *dst, uint8_t *src, int height, int stride)
298{
299 uint8_t *end;
300
301 end = dst + height * stride;
302 while (dst < end) {
303 memcpy(dst, src, stride);
304 dst += stride;
305 src -= stride;
306 }
307}
308
309
310static void
311copy_bgra(uint8_t *dst, uint8_t *src, int height, int stride)
312{
313 /* TODO: optimize this out */
314 memcpy(dst, src, height * stride);
315}
316
317static void
318copy_row_swap_RB(void *vdst, void *vsrc, int bytes)
319{
320 uint32_t *dst = vdst;
321 uint32_t *src = vsrc;
322 uint32_t *end = dst + bytes / 4;
323
324 while (dst < end) {
325 uint32_t v = *src++;
326 /* A R G B */
327 uint32_t tmp = v & 0xff00ff00;
328 tmp |= (v >> 16) & 0x000000ff;
329 tmp |= (v << 16) & 0x00ff0000;
330 *dst++ = tmp;
331 }
332}
333
334static void
335copy_rgba_yflip(uint8_t *dst, uint8_t *src, int height, int stride)
336{
337 uint8_t *end;
338
339 end = dst + height * stride;
340 while (dst < end) {
341 copy_row_swap_RB(dst, src, stride);
342 dst += stride;
343 src -= stride;
344 }
345}
346
347static void
348copy_rgba(uint8_t *dst, uint8_t *src, int height, int stride)
349{
350 uint8_t *end;
351
352 end = dst + height * stride;
353 while (dst < end) {
354 copy_row_swap_RB(dst, src, stride);
355 dst += stride;
356 src += stride;
357 }
358}
359
360static void
361test_screenshot_frame_notify(struct wl_listener *listener, void *data)
362{
363 struct test_screenshot_frame_listener *l =
364 container_of(listener,
365 struct test_screenshot_frame_listener, listener);
366 struct weston_output *output = data;
367 struct weston_compositor *compositor = output->compositor;
368 int32_t stride;
369 uint8_t *pixels, *d, *s;
370
371 output->disable_planes--;
372 wl_list_remove(&listener->link);
373 stride = l->buffer->width * (PIXMAN_FORMAT_BPP(compositor->read_format) / 8);
374 pixels = malloc(stride * l->buffer->height);
375
376 if (pixels == NULL) {
377 l->done(l->data, WESTON_TEST_SCREENSHOT_NO_MEMORY);
378 free(l);
379 return;
380 }
381
382 // FIXME: Needs to handle output transformations
383
384 compositor->renderer->read_pixels(output,
385 compositor->read_format,
386 pixels,
387 0, 0,
388 output->current_mode->width,
389 output->current_mode->height);
390
391 stride = wl_shm_buffer_get_stride(l->buffer->shm_buffer);
392
393 d = wl_shm_buffer_get_data(l->buffer->shm_buffer);
394 s = pixels + stride * (l->buffer->height - 1);
395
396 wl_shm_buffer_begin_access(l->buffer->shm_buffer);
397
398 /* XXX: It would be nice if we used Pixman to do all this rather
399 * than our own implementation
400 */
401 switch (compositor->read_format) {
402 case PIXMAN_a8r8g8b8:
403 case PIXMAN_x8r8g8b8:
404 if (compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP)
405 copy_bgra_yflip(d, s, output->current_mode->height, stride);
406 else
407 copy_bgra(d, pixels, output->current_mode->height, stride);
408 break;
409 case PIXMAN_x8b8g8r8:
410 case PIXMAN_a8b8g8r8:
411 if (compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP)
412 copy_rgba_yflip(d, s, output->current_mode->height, stride);
413 else
414 copy_rgba(d, pixels, output->current_mode->height, stride);
415 break;
416 default:
417 break;
418 }
419
420 wl_shm_buffer_end_access(l->buffer->shm_buffer);
421
422 l->done(l->data, WESTON_TEST_SCREENSHOT_SUCCESS);
423 free(pixels);
424 free(l);
425}
426
427static bool
428weston_test_screenshot_shoot(struct weston_output *output,
429 struct weston_buffer *buffer,
430 weston_test_screenshot_done_func_t done,
431 void *data)
432{
433 struct test_screenshot_frame_listener *l;
434
435 /* Get the shm buffer resource the client created */
436 if (!wl_shm_buffer_get(buffer->resource)) {
437 done(data, WESTON_TEST_SCREENSHOT_BAD_BUFFER);
438 return false;
439 }
440
441 buffer->shm_buffer = wl_shm_buffer_get(buffer->resource);
442 buffer->width = wl_shm_buffer_get_width(buffer->shm_buffer);
443 buffer->height = wl_shm_buffer_get_height(buffer->shm_buffer);
444
445 /* Verify buffer is big enough */
446 if (buffer->width < output->current_mode->width ||
447 buffer->height < output->current_mode->height) {
448 done(data, WESTON_TEST_SCREENSHOT_BAD_BUFFER);
449 return false;
450 }
451
452 /* allocate the frame listener */
453 l = malloc(sizeof *l);
454 if (l == NULL) {
455 done(data, WESTON_TEST_SCREENSHOT_NO_MEMORY);
456 return false;
457 }
458
459 /* Set up the listener */
460 l->buffer = buffer;
461 l->done = done;
462 l->data = data;
463 l->listener.notify = test_screenshot_frame_notify;
464 wl_signal_add(&output->frame_signal, &l->listener);
465
466 /* Fire off a repaint */
467 output->disable_planes++;
468 weston_output_schedule_repaint(output);
469
470 return true;
471}
472
473static void
474capture_screenshot_done(void *data, enum weston_test_screenshot_outcome outcome)
475{
476 struct wl_resource *resource = data;
477
478 switch (outcome) {
479 case WESTON_TEST_SCREENSHOT_SUCCESS:
480 weston_test_send_capture_screenshot_done(resource);
481 break;
482 case WESTON_TEST_SCREENSHOT_NO_MEMORY:
483 wl_resource_post_no_memory(resource);
484 break;
485 default:
486 break;
487 }
488}
489
490
491/**
492 * Grabs a snapshot of the screen.
493 */
494static void
495capture_screenshot(struct wl_client *client,
496 struct wl_resource *resource,
497 struct wl_resource *output_resource,
498 struct wl_resource *buffer_resource)
499{
500 struct weston_output *output =
501 wl_resource_get_user_data(output_resource);
502 struct weston_buffer *buffer =
503 weston_buffer_from_resource(buffer_resource);
504
505 if (buffer == NULL) {
506 wl_resource_post_no_memory(resource);
507 return;
508 }
509
510 weston_test_screenshot_shoot(output, buffer,
511 capture_screenshot_done, resource);
512}
513
Derek Foremanf6a65922015-02-24 09:32:14 -0600514static const struct weston_test_interface test_implementation = {
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800515 move_surface,
516 move_pointer,
517 send_button,
518 activate_surface,
Neil Roberts40c0c3f2013-10-29 20:13:45 +0000519 send_key,
Marek Chalupac8daf772015-03-30 06:37:55 -0400520 device_release,
521 device_add,
Neil Roberts40c0c3f2013-10-29 20:13:45 +0000522 get_n_buffers,
Bryce Harringtonf280d112015-05-05 15:13:20 -0700523 capture_screenshot,
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800524};
525
526static void
527bind_test(struct wl_client *client, void *data, uint32_t version, uint32_t id)
528{
529 struct weston_test *test = data;
530 struct wl_resource *resource;
531
Derek Foremanf6a65922015-02-24 09:32:14 -0600532 resource = wl_resource_create(client, &weston_test_interface, 1, id);
Marek Chalupa42ebdda2014-07-11 12:33:02 +0200533 if (!resource) {
534 wl_client_post_no_memory(client);
535 return;
536 }
537
Kristian Høgsberg442a5fa2013-07-03 18:13:33 -0400538 wl_resource_set_implementation(resource,
539 &test_implementation, test, NULL);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800540
541 notify_pointer_position(test, resource);
542}
543
544static void
545idle_launch_client(void *data)
546{
547 struct weston_test *test = data;
548 pid_t pid;
549 sigset_t allsigs;
550 char *path;
551
552 path = getenv("WESTON_TEST_CLIENT_PATH");
553 if (path == NULL)
Pekka Paalanenf72e4792013-11-21 16:23:57 +0200554 return;
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800555 pid = fork();
556 if (pid == -1)
557 exit(EXIT_FAILURE);
558 if (pid == 0) {
559 sigfillset(&allsigs);
560 sigprocmask(SIG_UNBLOCK, &allsigs, NULL);
561 execl(path, path, NULL);
562 weston_log("compositor: executing '%s' failed: %m\n", path);
563 exit(EXIT_FAILURE);
564 }
565
566 test->process.pid = pid;
567 test->process.cleanup = test_client_sigchld;
568 weston_watch_process(&test->process);
569}
570
571WL_EXPORT int
Kristian Høgsbergcb4685b2013-02-20 15:37:49 -0500572module_init(struct weston_compositor *ec,
Ossama Othmana50e6e42013-05-14 09:48:26 -0700573 int *argc, char *argv[])
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800574{
575 struct weston_test *test;
576 struct wl_event_loop *loop;
577
Peter Huttererf3d62272013-08-08 11:57:05 +1000578 test = zalloc(sizeof *test);
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800579 if (test == NULL)
580 return -1;
581
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800582 test->compositor = ec;
583 weston_layer_init(&test->layer, &ec->cursor_layer.link);
584
Derek Foremanf6a65922015-02-24 09:32:14 -0600585 if (wl_global_create(ec->wl_display, &weston_test_interface, 1,
Kristian Høgsberg919cddb2013-07-08 19:03:57 -0400586 test, bind_test) == NULL)
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800587 return -1;
588
Marek Chalupac3c3fc42015-03-30 09:17:40 -0400589 /* create our own seat */
590 weston_seat_init(&test->seat, ec, "test-seat");
591
592 /* add devices */
593 weston_seat_init_pointer(&test->seat);
594 weston_seat_init_keyboard(&test->seat, NULL);
595 weston_seat_init_touch(&test->seat);
596
U. Artie Eoff65e7e7a2012-12-07 13:50:29 -0800597 loop = wl_display_get_event_loop(ec->wl_display);
598 wl_event_loop_add_idle(loop, idle_launch_client, test);
599
600 return 0;
601}