Lines Matching refs:xwl_seat
66 xwl_seat_destroy_confined_pointer(struct xwl_seat *xwl_seat);
70 struct xwl_seat *xwl_seat);
72 release_tablet_manager_seat(struct xwl_seat *xwl_seat);
220 struct xwl_seat *xwl_seat = device->public.devicePrivate; in xwl_keyboard_proc() local
226 if (xwl_seat->keymap) in xwl_keyboard_proc()
227 len = strnlen(xwl_seat->keymap, xwl_seat->keymap_size); in xwl_keyboard_proc()
230 if (!InitKeyboardDeviceStructFromString(device, xwl_seat->keymap, in xwl_keyboard_proc()
374 struct xwl_seat *xwl_seat = data; in pointer_handle_enter() local
375 DeviceIntPtr dev = xwl_seat->pointer; in pointer_handle_enter()
381 ScreenPtr pScreen = xwl_seat->xwl_screen->screen; in pointer_handle_enter()
393 xwl_seat->xwl_screen->serial = serial; in pointer_handle_enter()
394 xwl_seat->pointer_enter_serial = serial; in pointer_handle_enter()
396 xwl_seat->focus_window = wl_surface_get_user_data(surface); in pointer_handle_enter()
397 dx = xwl_seat->focus_window->window->drawable.x; in pointer_handle_enter()
398 dy = xwl_seat->focus_window->window->drawable.y; in pointer_handle_enter()
401 xwl_seat->last_xwindow = NullWindow; in pointer_handle_enter()
429 if (xwl_seat->cursor.frame_cb) { in pointer_handle_enter()
430 wl_callback_destroy(xwl_seat->cursor.frame_cb); in pointer_handle_enter()
431 xwl_seat->cursor.frame_cb = NULL; in pointer_handle_enter()
432 xwl_seat_set_cursor(xwl_seat); in pointer_handle_enter()
435 if (xwl_seat->pointer_warp_emulator) { in pointer_handle_enter()
436 xwl_pointer_warp_emulator_maybe_lock(xwl_seat->pointer_warp_emulator, in pointer_handle_enter()
437 xwl_seat->focus_window, in pointer_handle_enter()
446 struct xwl_seat *xwl_seat = data; in pointer_handle_leave() local
447 DeviceIntPtr dev = xwl_seat->pointer; in pointer_handle_leave()
449 xwl_seat->xwl_screen->serial = serial; in pointer_handle_leave()
454 if (xwl_seat->focus_window) { in pointer_handle_leave()
455 xwl_seat->last_xwindow = xwl_seat->focus_window->window; in pointer_handle_leave()
456 xwl_seat->focus_window = NULL; in pointer_handle_leave()
462 dispatch_pointer_motion_event(struct xwl_seat *xwl_seat) in dispatch_pointer_motion_event() argument
466 if (xwl_seat->pointer_warp_emulator && in dispatch_pointer_motion_event()
467 xwl_seat->pending_pointer_event.has_relative) { in dispatch_pointer_motion_event()
473 dx = xwl_seat->pending_pointer_event.dx; in dispatch_pointer_motion_event()
474 dy = xwl_seat->pending_pointer_event.dy; in dispatch_pointer_motion_event()
475 dx_unaccel = xwl_seat->pending_pointer_event.dx_unaccel; in dispatch_pointer_motion_event()
476 dy_unaccel = xwl_seat->pending_pointer_event.dy_unaccel; in dispatch_pointer_motion_event()
477 xwl_pointer_warp_emulator_handle_motion(xwl_seat->pointer_warp_emulator, in dispatch_pointer_motion_event()
480 } else if (xwl_seat->pending_pointer_event.has_absolute || in dispatch_pointer_motion_event()
481 xwl_seat->pending_pointer_event.has_relative) { in dispatch_pointer_motion_event()
485 if (xwl_seat->pending_pointer_event.has_absolute) { in dispatch_pointer_motion_event()
486 int sx = wl_fixed_to_int(xwl_seat->pending_pointer_event.x); in dispatch_pointer_motion_event()
487 int sy = wl_fixed_to_int(xwl_seat->pending_pointer_event.y); in dispatch_pointer_motion_event()
488 int dx = xwl_seat->focus_window->window->drawable.x; in dispatch_pointer_motion_event()
489 int dy = xwl_seat->focus_window->window->drawable.y; in dispatch_pointer_motion_event()
494 miPointerGetPosition(xwl_seat->pointer, &x, &y); in dispatch_pointer_motion_event()
498 if (xwl_seat->pending_pointer_event.has_relative) { in dispatch_pointer_motion_event()
502 dx_unaccel = xwl_seat->pending_pointer_event.dx_unaccel; in dispatch_pointer_motion_event()
503 dy_unaccel = xwl_seat->pending_pointer_event.dy_unaccel; in dispatch_pointer_motion_event()
511 QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, in dispatch_pointer_motion_event()
515 xwl_seat->pending_pointer_event.has_absolute = FALSE; in dispatch_pointer_motion_event()
516 xwl_seat->pending_pointer_event.has_relative = FALSE; in dispatch_pointer_motion_event()
523 struct xwl_seat *xwl_seat = data; in pointer_handle_motion() local
525 if (!xwl_seat->focus_window) in pointer_handle_motion()
528 xwl_seat->pending_pointer_event.has_absolute = TRUE; in pointer_handle_motion()
529 xwl_seat->pending_pointer_event.x = sx_w; in pointer_handle_motion()
530 xwl_seat->pending_pointer_event.y = sy_w; in pointer_handle_motion()
532 if (wl_proxy_get_version((struct wl_proxy *) xwl_seat->wl_pointer) < 5) in pointer_handle_motion()
533 dispatch_pointer_motion_event(xwl_seat); in pointer_handle_motion()
540 struct xwl_seat *xwl_seat = data; in pointer_handle_button() local
544 xwl_seat->xwl_screen->serial = serial; in pointer_handle_button()
564 QueuePointerEvents(xwl_seat->pointer, in pointer_handle_button()
572 struct xwl_seat *xwl_seat = data; in pointer_handle_axis() local
590 xorg_list_for_each_entry(iter, &xwl_seat->axis_discrete_pending, l) { in pointer_handle_axis()
606 QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, POINTER_RELATIVE, &mask); in pointer_handle_axis()
612 struct xwl_seat *xwl_seat = data; in pointer_handle_frame() local
614 if (!xwl_seat->focus_window) in pointer_handle_frame()
617 dispatch_pointer_motion_event(xwl_seat); in pointer_handle_frame()
635 struct xwl_seat *xwl_seat = data; in pointer_handle_axis_discrete() local
644 xorg_list_add(&pending->l, &xwl_seat->axis_discrete_pending); in pointer_handle_axis_discrete()
669 struct xwl_seat *xwl_seat = data; in relative_pointer_handle_relative_motion() local
671 xwl_seat->pending_pointer_event.has_relative = TRUE; in relative_pointer_handle_relative_motion()
672 xwl_seat->pending_pointer_event.dx = wl_fixed_to_double(dxf); in relative_pointer_handle_relative_motion()
673 xwl_seat->pending_pointer_event.dy = wl_fixed_to_double(dyf); in relative_pointer_handle_relative_motion()
674 xwl_seat->pending_pointer_event.dx_unaccel = wl_fixed_to_double(dx_unaccelf); in relative_pointer_handle_relative_motion()
675 xwl_seat->pending_pointer_event.dy_unaccel = wl_fixed_to_double(dy_unaccelf); in relative_pointer_handle_relative_motion()
677 if (!xwl_seat->focus_window) in relative_pointer_handle_relative_motion()
680 if (wl_proxy_get_version((struct wl_proxy *) xwl_seat->wl_pointer) < 5) in relative_pointer_handle_relative_motion()
681 dispatch_pointer_motion_event(xwl_seat); in relative_pointer_handle_relative_motion()
692 struct xwl_seat *xwl_seat = data; in keyboard_handle_key() local
695 xwl_seat->xwl_screen->serial = serial; in keyboard_handle_key()
697 end = (uint32_t *) ((char *) xwl_seat->keys.data + xwl_seat->keys.size); in keyboard_handle_key()
698 for (k = xwl_seat->keys.data; k < end; k++) { in keyboard_handle_key()
702 xwl_seat->keys.size = (char *) end - (char *) xwl_seat->keys.data; in keyboard_handle_key()
704 k = wl_array_add(&xwl_seat->keys, sizeof *k); in keyboard_handle_key()
708 QueueKeyboardEvents(xwl_seat->keyboard, in keyboard_handle_key()
716 struct xwl_seat *xwl_seat = data; in keyboard_handle_keymap() local
721 if (xwl_seat->keymap) in keyboard_handle_keymap()
722 munmap(xwl_seat->keymap, xwl_seat->keymap_size); in keyboard_handle_keymap()
724 xwl_seat->keymap_size = size; in keyboard_handle_keymap()
725 xwl_seat->keymap = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); in keyboard_handle_keymap()
726 if (xwl_seat->keymap == MAP_FAILED) { in keyboard_handle_keymap()
727 xwl_seat->keymap_size = 0; in keyboard_handle_keymap()
728 xwl_seat->keymap = NULL; in keyboard_handle_keymap()
732 xkb = XkbCompileKeymapFromString(xwl_seat->keyboard, xwl_seat->keymap, in keyboard_handle_keymap()
733 strnlen(xwl_seat->keymap, in keyboard_handle_keymap()
734 xwl_seat->keymap_size)); in keyboard_handle_keymap()
740 if (xwl_seat->keyboard->key) in keyboard_handle_keymap()
742 XkbCopyControls(xkb, xwl_seat->keyboard->key->xkbInfo->desc); in keyboard_handle_keymap()
744 XkbDeviceApplyKeymap(xwl_seat->keyboard, xkb); in keyboard_handle_keymap()
746 master = GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD); in keyboard_handle_keymap()
761 struct xwl_seat *xwl_seat = data; in keyboard_handle_enter() local
764 xwl_seat->xwl_screen->serial = serial; in keyboard_handle_enter()
765 xwl_seat->keyboard_focus = surface; in keyboard_handle_enter()
767 wl_array_copy(&xwl_seat->keys, keys); in keyboard_handle_enter()
768 wl_array_for_each(k, &xwl_seat->keys) in keyboard_handle_enter()
769 QueueKeyboardEvents(xwl_seat->keyboard, EnterNotify, *k + 8); in keyboard_handle_enter()
776 struct xwl_seat *xwl_seat = data; in keyboard_handle_leave() local
779 xwl_seat->xwl_screen->serial = serial; in keyboard_handle_leave()
781 wl_array_for_each(k, &xwl_seat->keys) in keyboard_handle_leave()
782 QueueKeyboardEvents(xwl_seat->keyboard, LeaveNotify, *k + 8); in keyboard_handle_leave()
784 xwl_seat->keyboard_focus = NULL; in keyboard_handle_leave()
793 struct xwl_seat *xwl_seat = data; in keyboard_handle_modifiers() local
802 if (dev != xwl_seat->keyboard && in keyboard_handle_modifiers()
803 dev != GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD)) in keyboard_handle_modifiers()
833 struct xwl_seat *xwl_seat = dev->public.devicePrivate; in remove_sync_pending() local
836 if (!xwl_seat) in remove_sync_pending()
839 xorg_list_for_each_entry_safe(p, npd, &xwl_seat->sync_pending, l) { in remove_sync_pending()
841 xorg_list_del(&xwl_seat->sync_pending); in remove_sync_pending()
864 struct xwl_seat *xwl_seat = dev->public.devicePrivate; in keyboard_check_repeat() local
869 if (!xwl_seat) in keyboard_check_repeat()
873 xwl_screen = xwl_seat->xwl_screen; in keyboard_check_repeat()
876 xorg_list_for_each_entry(p, &xwl_seat->sync_pending, l) { in keyboard_check_repeat()
888 xorg_list_add(&p->l, &xwl_seat->sync_pending); in keyboard_check_repeat()
899 struct xwl_seat *xwl_seat = data; in keyboard_handle_repeat_info() local
909 if (dev != xwl_seat->keyboard && in keyboard_handle_repeat_info()
910 dev != GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD)) in keyboard_handle_repeat_info()
935 xwl_seat_lookup_touch(struct xwl_seat *xwl_seat, int32_t id) in xwl_seat_lookup_touch() argument
940 &xwl_seat->touches, link_touch) { in xwl_seat_lookup_touch()
950 struct xwl_seat *xwl_seat, int type) in xwl_touch_send_event() argument
958 x = (dx + xwl_touch->x) * 0xFFFF / xwl_seat->xwl_screen->width; in xwl_touch_send_event()
959 y = (dy + xwl_touch->y) * 0xFFFF / xwl_seat->xwl_screen->height; in xwl_touch_send_event()
964 QueueTouchEvents(xwl_seat->touch, type, xwl_touch->id, 0, &mask); in xwl_touch_send_event()
973 struct xwl_seat *xwl_seat = data; in touch_handle_down() local
989 xorg_list_add(&xwl_touch->link_touch, &xwl_seat->touches); in touch_handle_down()
991 xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchBegin); in touch_handle_down()
999 struct xwl_seat *xwl_seat = data; in touch_handle_up() local
1001 xwl_touch = xwl_seat_lookup_touch(xwl_seat, id); in touch_handle_up()
1006 xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchEnd); in touch_handle_up()
1016 struct xwl_seat *xwl_seat = data; in touch_handle_motion() local
1019 xwl_touch = xwl_seat_lookup_touch(xwl_seat, id); in touch_handle_motion()
1026 xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchUpdate); in touch_handle_motion()
1037 struct xwl_seat *xwl_seat = data; in touch_handle_cancel() local
1041 &xwl_seat->touches, link_touch) { in touch_handle_cancel()
1046 xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchEnd); in touch_handle_cancel()
1060 static struct xwl_seat *
1068 return (struct xwl_seat *) dev->public.devicePrivate; in find_matching_seat()
1074 release_grab(struct xwl_seat *xwl_seat) in release_grab() argument
1076 if (xwl_seat->keyboard_grab) in release_grab()
1077 zwp_xwayland_keyboard_grab_v1_destroy(xwl_seat->keyboard_grab); in release_grab()
1078 xwl_seat->keyboard_grab = NULL; in release_grab()
1082 set_grab(struct xwl_seat *xwl_seat, struct xwl_window *xwl_window) in set_grab() argument
1090 if (xwl_seat->keyboard_grab) in set_grab()
1091 release_grab (xwl_seat); in set_grab()
1093 xwl_screen = xwl_seat->xwl_screen; in set_grab()
1094 xwl_seat->keyboard_grab = in set_grab()
1097 xwl_seat->seat); in set_grab()
1103 struct xwl_seat *xwl_seat = device->public.devicePrivate; in xwl_keyboard_activate_grab() local
1108 if (xwl_seat == NULL) in xwl_keyboard_activate_grab()
1109 xwl_seat = find_matching_seat(device); in xwl_keyboard_activate_grab()
1110 if (xwl_seat) in xwl_keyboard_activate_grab()
1111 set_grab(xwl_seat, xwl_window_from_window(grab->window)); in xwl_keyboard_activate_grab()
1120 struct xwl_seat *xwl_seat = device->public.devicePrivate; in xwl_keyboard_deactivate_grab() local
1123 if (xwl_seat == NULL) in xwl_keyboard_deactivate_grab()
1124 xwl_seat = find_matching_seat(device); in xwl_keyboard_deactivate_grab()
1125 if (xwl_seat) in xwl_keyboard_deactivate_grab()
1126 release_grab (xwl_seat); in xwl_keyboard_deactivate_grab()
1139 add_device(struct xwl_seat *xwl_seat, in add_device() argument
1152 snprintf(name, sizeof name, "%s:%d", driver, xwl_seat->id); in add_device()
1154 dev->public.devicePrivate = xwl_seat; in add_device()
1169 enable_device(struct xwl_seat *xwl_seat, DeviceIntPtr dev) in enable_device() argument
1171 dev->public.devicePrivate = xwl_seat; in enable_device()
1177 init_pointer(struct xwl_seat *xwl_seat) in init_pointer() argument
1179 xwl_seat->wl_pointer = wl_seat_get_pointer(xwl_seat->seat); in init_pointer()
1180 wl_pointer_add_listener(xwl_seat->wl_pointer, in init_pointer()
1181 &pointer_listener, xwl_seat); in init_pointer()
1183 if (xwl_seat->pointer == NULL) { in init_pointer()
1184 xwl_seat_set_cursor(xwl_seat); in init_pointer()
1185 xwl_seat->pointer = in init_pointer()
1186 add_device(xwl_seat, "xwayland-pointer", xwl_pointer_proc); in init_pointer()
1187 ActivateDevice(xwl_seat->pointer, TRUE); in init_pointer()
1189 enable_device(xwl_seat, xwl_seat->pointer); in init_pointer()
1193 release_pointer(struct xwl_seat *xwl_seat) in release_pointer() argument
1195 wl_pointer_release(xwl_seat->wl_pointer); in release_pointer()
1196 xwl_seat->wl_pointer = NULL; in release_pointer()
1198 if (xwl_seat->pointer) in release_pointer()
1199 disable_device(xwl_seat->pointer); in release_pointer()
1203 init_relative_pointer(struct xwl_seat *xwl_seat) in init_relative_pointer() argument
1206 xwl_seat->xwl_screen->relative_pointer_manager; in init_relative_pointer()
1209 xwl_seat->wp_relative_pointer = in init_relative_pointer()
1211 relative_pointer_manager, xwl_seat->wl_pointer); in init_relative_pointer()
1212 zwp_relative_pointer_v1_add_listener(xwl_seat->wp_relative_pointer, in init_relative_pointer()
1214 xwl_seat); in init_relative_pointer()
1217 if (xwl_seat->relative_pointer == NULL) { in init_relative_pointer()
1218 xwl_seat->relative_pointer = in init_relative_pointer()
1219 add_device(xwl_seat, "xwayland-relative-pointer", in init_relative_pointer()
1221 ActivateDevice(xwl_seat->relative_pointer, TRUE); in init_relative_pointer()
1223 enable_device(xwl_seat, xwl_seat->relative_pointer); in init_relative_pointer()
1227 release_relative_pointer(struct xwl_seat *xwl_seat) in release_relative_pointer() argument
1229 if (xwl_seat->wp_relative_pointer) { in release_relative_pointer()
1230 zwp_relative_pointer_v1_destroy(xwl_seat->wp_relative_pointer); in release_relative_pointer()
1231 xwl_seat->wp_relative_pointer = NULL; in release_relative_pointer()
1234 if (xwl_seat->relative_pointer) in release_relative_pointer()
1235 disable_device(xwl_seat->relative_pointer); in release_relative_pointer()
1239 init_keyboard(struct xwl_seat *xwl_seat) in init_keyboard() argument
1243 xwl_seat->wl_keyboard = wl_seat_get_keyboard(xwl_seat->seat); in init_keyboard()
1244 wl_keyboard_add_listener(xwl_seat->wl_keyboard, in init_keyboard()
1245 &keyboard_listener, xwl_seat); in init_keyboard()
1247 if (xwl_seat->keyboard == NULL) { in init_keyboard()
1248 xwl_seat->keyboard = in init_keyboard()
1249 add_device(xwl_seat, "xwayland-keyboard", xwl_keyboard_proc); in init_keyboard()
1250 ActivateDevice(xwl_seat->keyboard, TRUE); in init_keyboard()
1252 enable_device(xwl_seat, xwl_seat->keyboard); in init_keyboard()
1253 xwl_seat->keyboard->key->xkbInfo->checkRepeat = keyboard_check_repeat; in init_keyboard()
1255 if (xwl_seat->xwl_screen->wp_grab) { in init_keyboard()
1257 master = GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD); in init_keyboard()
1264 release_keyboard(struct xwl_seat *xwl_seat) in release_keyboard() argument
1266 release_grab(xwl_seat); in release_keyboard()
1267 wl_keyboard_release(xwl_seat->wl_keyboard); in release_keyboard()
1268 xwl_seat->wl_keyboard = NULL; in release_keyboard()
1270 if (xwl_seat->keyboard) { in release_keyboard()
1271 remove_sync_pending(xwl_seat->keyboard); in release_keyboard()
1272 disable_device(xwl_seat->keyboard); in release_keyboard()
1277 init_touch(struct xwl_seat *xwl_seat) in init_touch() argument
1279 xwl_seat->wl_touch = wl_seat_get_touch(xwl_seat->seat); in init_touch()
1280 wl_touch_add_listener(xwl_seat->wl_touch, in init_touch()
1281 &touch_listener, xwl_seat); in init_touch()
1283 if (xwl_seat->touch == NULL) { in init_touch()
1284 xwl_seat->touch = in init_touch()
1285 add_device(xwl_seat, "xwayland-touch", xwl_touch_proc); in init_touch()
1286 ActivateDevice(xwl_seat->touch, TRUE); in init_touch()
1288 enable_device(xwl_seat, xwl_seat->touch); in init_touch()
1292 release_touch(struct xwl_seat *xwl_seat) in release_touch() argument
1294 wl_touch_release(xwl_seat->wl_touch); in release_touch()
1295 xwl_seat->wl_touch = NULL; in release_touch()
1297 if (xwl_seat->touch) in release_touch()
1298 disable_device(xwl_seat->touch); in release_touch()
1305 struct xwl_seat *xwl_seat = data; in seat_handle_capabilities() local
1307 if (caps & WL_SEAT_CAPABILITY_POINTER && xwl_seat->wl_pointer == NULL) { in seat_handle_capabilities()
1308 init_pointer(xwl_seat); in seat_handle_capabilities()
1309 init_relative_pointer(xwl_seat); in seat_handle_capabilities()
1310 } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && xwl_seat->wl_pointer) { in seat_handle_capabilities()
1311 release_pointer(xwl_seat); in seat_handle_capabilities()
1312 release_relative_pointer(xwl_seat); in seat_handle_capabilities()
1315 if (caps & WL_SEAT_CAPABILITY_KEYBOARD && xwl_seat->wl_keyboard == NULL) { in seat_handle_capabilities()
1316 init_keyboard(xwl_seat); in seat_handle_capabilities()
1317 } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && xwl_seat->wl_keyboard) { in seat_handle_capabilities()
1318 release_keyboard(xwl_seat); in seat_handle_capabilities()
1321 if (caps & WL_SEAT_CAPABILITY_TOUCH && xwl_seat->wl_touch == NULL) { in seat_handle_capabilities()
1322 init_touch(xwl_seat); in seat_handle_capabilities()
1323 } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && xwl_seat->wl_touch) { in seat_handle_capabilities()
1324 release_touch(xwl_seat); in seat_handle_capabilities()
1327 xwl_seat->xwl_screen->expecting_event--; in seat_handle_capabilities()
1363 struct xwl_seat *xwl_seat = wl_container_of(xwl_cursor, xwl_seat, cursor); in xwl_seat_update_cursor() local
1364 xwl_seat_set_cursor(xwl_seat); in xwl_seat_update_cursor()
1370 struct xwl_seat *xwl_seat; in create_input_device() local
1372 xwl_seat = calloc(1, sizeof *xwl_seat); in create_input_device()
1373 if (xwl_seat == NULL) { in create_input_device()
1378 xwl_seat->xwl_screen = xwl_screen; in create_input_device()
1379 xorg_list_add(&xwl_seat->link, &xwl_screen->seat_list); in create_input_device()
1381 xwl_seat->seat = in create_input_device()
1384 xwl_seat->id = id; in create_input_device()
1386 xwl_cursor_init(&xwl_seat->cursor, xwl_seat->xwl_screen, in create_input_device()
1388 wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat); in create_input_device()
1390 init_tablet_manager_seat(xwl_screen, xwl_seat); in create_input_device()
1392 wl_array_init(&xwl_seat->keys); in create_input_device()
1394 xorg_list_init(&xwl_seat->touches); in create_input_device()
1395 xorg_list_init(&xwl_seat->axis_discrete_pending); in create_input_device()
1396 xorg_list_init(&xwl_seat->sync_pending); in create_input_device()
1400 xwl_seat_destroy(struct xwl_seat *xwl_seat) in xwl_seat_destroy() argument
1407 &xwl_seat->touches, link_touch) { in xwl_seat_destroy()
1412 xorg_list_for_each_entry_safe(p, npd, &xwl_seat->sync_pending, l) { in xwl_seat_destroy()
1413 xorg_list_del(&xwl_seat->sync_pending); in xwl_seat_destroy()
1417 xorg_list_for_each_entry_safe(ad, ad_next, &xwl_seat->axis_discrete_pending, l) { in xwl_seat_destroy()
1422 release_tablet_manager_seat(xwl_seat); in xwl_seat_destroy()
1424 release_grab(xwl_seat); in xwl_seat_destroy()
1425 wl_seat_destroy(xwl_seat->seat); in xwl_seat_destroy()
1426 xwl_cursor_release(&xwl_seat->cursor); in xwl_seat_destroy()
1427 wl_array_release(&xwl_seat->keys); in xwl_seat_destroy()
1428 free(xwl_seat); in xwl_seat_destroy()
1451 struct xwl_seat *xwl_seat = xwl_tablet->seat; in tablet_handle_done() local
1453 if (xwl_seat->stylus == NULL) { in tablet_handle_done()
1454 xwl_seat->stylus = add_device(xwl_seat, "xwayland-stylus", xwl_tablet_proc); in tablet_handle_done()
1455 ActivateDevice(xwl_seat->stylus, TRUE); in tablet_handle_done()
1457 enable_device(xwl_seat, xwl_seat->stylus); in tablet_handle_done()
1459 if (xwl_seat->eraser == NULL) { in tablet_handle_done()
1460 xwl_seat->eraser = add_device(xwl_seat, "xwayland-eraser", xwl_tablet_proc); in tablet_handle_done()
1461 ActivateDevice(xwl_seat->eraser, TRUE); in tablet_handle_done()
1463 enable_device(xwl_seat, xwl_seat->eraser); in tablet_handle_done()
1465 if (xwl_seat->puck == NULL) { in tablet_handle_done()
1466 xwl_seat->puck = add_device(xwl_seat, "xwayland-cursor", xwl_tablet_proc); in tablet_handle_done()
1467 ActivateDevice(xwl_seat->puck, TRUE); in tablet_handle_done()
1469 enable_device(xwl_seat, xwl_seat->puck); in tablet_handle_done()
1476 struct xwl_seat *xwl_seat = xwl_tablet->seat; in tablet_handle_removed() local
1482 if (xorg_list_is_empty(&xwl_seat->tablets)) { in tablet_handle_removed()
1483 if (xwl_seat->stylus) in tablet_handle_removed()
1484 disable_device(xwl_seat->stylus); in tablet_handle_removed()
1485 if (xwl_seat->eraser) in tablet_handle_removed()
1486 disable_device(xwl_seat->eraser); in tablet_handle_removed()
1487 if (xwl_seat->puck) in tablet_handle_removed()
1488 disable_device(xwl_seat->puck); in tablet_handle_removed()
1509 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_receive_type() local
1513 xwl_tablet_tool->xdevice = xwl_seat->eraser; in tablet_tool_receive_type()
1517 xwl_tablet_tool->xdevice = xwl_seat->puck; in tablet_tool_receive_type()
1520 xwl_tablet_tool->xdevice = xwl_seat->stylus; in tablet_tool_receive_type()
1565 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_proximity_in() local
1579 xwl_seat->tablet_focus_window = wl_surface_get_user_data(wl_surface); in tablet_tool_proximity_in()
1588 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_proximity_out() local
1591 xwl_seat->tablet_focus_window = NULL; in tablet_tool_proximity_out()
1604 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_down() local
1607 xwl_seat->xwl_screen->serial = serial; in tablet_tool_down()
1628 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_motion() local
1633 if (!xwl_seat->tablet_focus_window) in tablet_tool_motion()
1636 dx = xwl_seat->tablet_focus_window->window->drawable.x; in tablet_tool_motion()
1637 dy = xwl_seat->tablet_focus_window->window->drawable.y; in tablet_tool_motion()
1648 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_pressure() local
1650 if (!xwl_seat->tablet_focus_window) in tablet_tool_pressure()
1668 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_tilt() local
1670 if (!xwl_seat->tablet_focus_window) in tablet_tool_tilt()
1682 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_rotation() local
1685 if (!xwl_seat->tablet_focus_window) in tablet_tool_rotation()
1701 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_slider() local
1704 if (!xwl_seat->tablet_focus_window) in tablet_tool_slider()
1715 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_wheel() local
1717 if (!xwl_seat->tablet_focus_window) in tablet_tool_wheel()
1728 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_button_state() local
1786 xwl_seat->xwl_screen->serial = serial; in tablet_tool_button_state()
2291 struct xwl_seat *xwl_seat = data; in tablet_seat_handle_add_tablet() local
2301 xwl_tablet->seat = xwl_seat; in tablet_seat_handle_add_tablet()
2303 xorg_list_add(&xwl_tablet->link, &xwl_seat->tablets); in tablet_seat_handle_add_tablet()
2321 struct xwl_seat *xwl_seat = data; in tablet_seat_handle_add_tool() local
2322 struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; in tablet_seat_handle_add_tool()
2332 xwl_tablet_tool->seat = xwl_seat; in tablet_seat_handle_add_tool()
2336 xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools); in tablet_seat_handle_add_tool()
2345 struct xwl_seat *xwl_seat = data; in tablet_seat_handle_add_pad() local
2355 xwl_tablet_pad->seat = xwl_seat; in tablet_seat_handle_add_pad()
2358 xorg_list_add(&xwl_tablet_pad->link, &xwl_seat->tablet_pads); in tablet_seat_handle_add_pad()
2372 struct xwl_seat *xwl_seat) in init_tablet_manager_seat() argument
2374 xorg_list_init(&xwl_seat->tablets); in init_tablet_manager_seat()
2375 xorg_list_init(&xwl_seat->tablet_tools); in init_tablet_manager_seat()
2376 xorg_list_init(&xwl_seat->tablet_pads); in init_tablet_manager_seat()
2381 xwl_seat->tablet_seat = in init_tablet_manager_seat()
2383 xwl_seat->seat); in init_tablet_manager_seat()
2385 zwp_tablet_seat_v2_add_listener(xwl_seat->tablet_seat, &tablet_seat_listener, xwl_seat); in init_tablet_manager_seat()
2389 release_tablet_manager_seat(struct xwl_seat *xwl_seat) in release_tablet_manager_seat() argument
2396 &xwl_seat->tablet_pads, link) { in release_tablet_manager_seat()
2403 &xwl_seat->tablet_tools, link) { in release_tablet_manager_seat()
2410 &xwl_seat->tablets, link) { in release_tablet_manager_seat()
2416 if (xwl_seat->tablet_seat) { in release_tablet_manager_seat()
2417 zwp_tablet_seat_v2_destroy(xwl_seat->tablet_seat); in release_tablet_manager_seat()
2418 xwl_seat->tablet_seat = NULL; in release_tablet_manager_seat()
2425 struct xwl_seat *xwl_seat; in init_tablet_manager() local
2432 xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { in init_tablet_manager()
2433 init_tablet_manager_seat(xwl_screen, xwl_seat); in init_tablet_manager()
2470 struct xwl_seat *xwl_seat; in init_keyboard_grab() local
2478 xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { in init_keyboard_grab()
2479 if (xwl_seat->keyboard) { in init_keyboard_grab()
2480 master = GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD); in init_keyboard_grab()
2538 struct xwl_seat *xwl_seat; in sprite_check_lost_focus() local
2550 xwl_seat = device->public.devicePrivate; in sprite_check_lost_focus()
2551 if (!xwl_seat) in sprite_check_lost_focus()
2562 if (master->lastSlave == xwl_seat->pointer && in sprite_check_lost_focus()
2563 xwl_seat->focus_window == NULL && in sprite_check_lost_focus()
2564 xwl_seat->last_xwindow != NullWindow && in sprite_check_lost_focus()
2565 IsParent(xwl_seat->last_xwindow, window)) in sprite_check_lost_focus()
2599 xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window) in xwl_seat_clear_touch() argument
2604 &xwl_seat->touches, link_touch) { in xwl_seat_clear_touch()
2625 if (!warp_emulator->xwl_seat->focus_window) in xwl_pointer_warp_emulator_set_fake_pos()
2628 window = warp_emulator->xwl_seat->focus_window->window; in xwl_pointer_warp_emulator_set_fake_pos()
2638 wl_surface_commit(warp_emulator->xwl_seat->focus_window->surface); in xwl_pointer_warp_emulator_set_fake_pos()
2654 struct xwl_seat *xwl_seat = warp_emulator->xwl_seat; in xwl_pointer_warp_emulator_lock() local
2655 struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; in xwl_pointer_warp_emulator_lock()
2658 struct xwl_window *lock_window = xwl_seat->focus_window; in xwl_pointer_warp_emulator_lock()
2665 xwl_seat->wl_pointer, in xwl_pointer_warp_emulator_lock()
2676 struct xwl_seat *xwl_seat = warp_emulator->xwl_seat; in xwl_pointer_warp_emulator_maybe_lock() local
2677 GrabPtr pointer_grab = xwl_seat->pointer->deviceGrab.grab; in xwl_pointer_warp_emulator_maybe_lock()
2686 if (!pointer_grab && xwl_seat->focus_window != xwl_window) in xwl_pointer_warp_emulator_maybe_lock()
2697 XYToWindow(sprite, x, y) != xwl_seat->focus_window->window) in xwl_pointer_warp_emulator_maybe_lock()
2723 struct xwl_seat *xwl_seat = warp_emulator->xwl_seat; in xwl_pointer_warp_emulator_handle_motion() local
2732 QueuePointerEvents(xwl_seat->relative_pointer, MotionNotify, 0, in xwl_pointer_warp_emulator_handle_motion()
2735 window = xwl_seat->focus_window->window; in xwl_pointer_warp_emulator_handle_motion()
2736 miPointerGetPosition(xwl_seat->pointer, &x, &y); in xwl_pointer_warp_emulator_handle_motion()
2739 xwl_seat->cursor_confinement_window != warp_emulator->locked_window && in xwl_pointer_warp_emulator_handle_motion()
2744 xwl_seat_destroy_pointer_warp_emulator(xwl_seat); in xwl_pointer_warp_emulator_handle_motion()
2750 xwl_pointer_warp_emulator_create(struct xwl_seat *xwl_seat) in xwl_pointer_warp_emulator_create() argument
2760 warp_emulator->xwl_seat = xwl_seat; in xwl_pointer_warp_emulator_create()
2774 xwl_seat_create_pointer_warp_emulator(struct xwl_seat *xwl_seat) in xwl_seat_create_pointer_warp_emulator() argument
2776 if (xwl_seat->confined_pointer) in xwl_seat_create_pointer_warp_emulator()
2777 xwl_seat_destroy_confined_pointer(xwl_seat); in xwl_seat_create_pointer_warp_emulator()
2779 xwl_seat->pointer_warp_emulator = in xwl_seat_create_pointer_warp_emulator()
2780 xwl_pointer_warp_emulator_create(xwl_seat); in xwl_seat_create_pointer_warp_emulator()
2784 xwl_seat_can_emulate_pointer_warp(struct xwl_seat *xwl_seat) in xwl_seat_can_emulate_pointer_warp() argument
2788 if (!xwl_seat) in xwl_seat_can_emulate_pointer_warp()
2791 if (!xwl_seat->pointer) in xwl_seat_can_emulate_pointer_warp()
2794 xwl_screen = xwl_seat->xwl_screen; in xwl_seat_can_emulate_pointer_warp()
2806 xwl_seat_emulate_pointer_warp(struct xwl_seat *xwl_seat, in xwl_seat_emulate_pointer_warp() argument
2811 if (!xwl_seat_can_emulate_pointer_warp(xwl_seat)) in xwl_seat_emulate_pointer_warp()
2814 if (xwl_seat->x_cursor != NULL) in xwl_seat_emulate_pointer_warp()
2817 if (!xwl_seat->pointer_warp_emulator) in xwl_seat_emulate_pointer_warp()
2818 xwl_seat_create_pointer_warp_emulator(xwl_seat); in xwl_seat_emulate_pointer_warp()
2820 if (!xwl_seat->pointer_warp_emulator) in xwl_seat_emulate_pointer_warp()
2823 xwl_pointer_warp_emulator_warp(xwl_seat->pointer_warp_emulator, in xwl_seat_emulate_pointer_warp()
2830 xwl_seat_maybe_lock_on_hidden_cursor(struct xwl_seat *xwl_seat) in xwl_seat_maybe_lock_on_hidden_cursor() argument
2836 if (xwl_seat->x_cursor || in xwl_seat_maybe_lock_on_hidden_cursor()
2837 !xwl_seat->cursor_confinement_window) in xwl_seat_maybe_lock_on_hidden_cursor()
2840 if (!xwl_seat->focus_window) in xwl_seat_maybe_lock_on_hidden_cursor()
2843 if (xwl_seat->confined_pointer) in xwl_seat_maybe_lock_on_hidden_cursor()
2844 xwl_seat_destroy_confined_pointer(xwl_seat); in xwl_seat_maybe_lock_on_hidden_cursor()
2846 xwl_seat_create_pointer_warp_emulator(xwl_seat); in xwl_seat_maybe_lock_on_hidden_cursor()
2847 xwl_pointer_warp_emulator_lock(xwl_seat->pointer_warp_emulator); in xwl_seat_maybe_lock_on_hidden_cursor()
2852 xwl_seat_cursor_visibility_changed(struct xwl_seat *xwl_seat) in xwl_seat_cursor_visibility_changed() argument
2854 if (xwl_seat->pointer_warp_emulator && xwl_seat->x_cursor != NULL) { in xwl_seat_cursor_visibility_changed()
2855 xwl_seat_destroy_pointer_warp_emulator(xwl_seat); in xwl_seat_cursor_visibility_changed()
2856 } else if (!xwl_seat->x_cursor && xwl_seat->cursor_confinement_window) { in xwl_seat_cursor_visibility_changed()
2859 xwl_seat_maybe_lock_on_hidden_cursor(xwl_seat); in xwl_seat_cursor_visibility_changed()
2864 xwl_seat_destroy_pointer_warp_emulator(struct xwl_seat *xwl_seat) in xwl_seat_destroy_pointer_warp_emulator() argument
2866 if (!xwl_seat->pointer_warp_emulator) in xwl_seat_destroy_pointer_warp_emulator()
2869 xwl_pointer_warp_emulator_destroy(xwl_seat->pointer_warp_emulator); in xwl_seat_destroy_pointer_warp_emulator()
2870 xwl_seat->pointer_warp_emulator = NULL; in xwl_seat_destroy_pointer_warp_emulator()
2872 if (xwl_seat->cursor_confinement_window) { in xwl_seat_destroy_pointer_warp_emulator()
2873 xwl_seat_confine_pointer(xwl_seat, in xwl_seat_destroy_pointer_warp_emulator()
2874 xwl_seat->cursor_confinement_window); in xwl_seat_destroy_pointer_warp_emulator()
2879 xwl_seat_confine_pointer(struct xwl_seat *xwl_seat, in xwl_seat_confine_pointer() argument
2883 xwl_seat->xwl_screen->pointer_constraints; in xwl_seat_confine_pointer()
2888 if (!xwl_seat->wl_pointer) in xwl_seat_confine_pointer()
2891 if (xwl_seat->cursor_confinement_window == xwl_window && in xwl_seat_confine_pointer()
2892 xwl_seat->confined_pointer) in xwl_seat_confine_pointer()
2895 xwl_seat_unconfine_pointer(xwl_seat); in xwl_seat_confine_pointer()
2897 xwl_seat->cursor_confinement_window = xwl_window; in xwl_seat_confine_pointer()
2899 if (xwl_seat->pointer_warp_emulator) in xwl_seat_confine_pointer()
2902 if (xwl_seat_maybe_lock_on_hidden_cursor(xwl_seat)) in xwl_seat_confine_pointer()
2905 xwl_seat->confined_pointer = in xwl_seat_confine_pointer()
2908 xwl_seat->wl_pointer, in xwl_seat_confine_pointer()
2914 xwl_seat_destroy_confined_pointer(struct xwl_seat *xwl_seat) in xwl_seat_destroy_confined_pointer() argument
2916 zwp_confined_pointer_v1_destroy(xwl_seat->confined_pointer); in xwl_seat_destroy_confined_pointer()
2917 xwl_seat->confined_pointer = NULL; in xwl_seat_destroy_confined_pointer()
2921 xwl_seat_unconfine_pointer(struct xwl_seat *xwl_seat) in xwl_seat_unconfine_pointer() argument
2923 xwl_seat->cursor_confinement_window = NULL; in xwl_seat_unconfine_pointer()
2925 if (xwl_seat->confined_pointer) in xwl_seat_unconfine_pointer()
2926 xwl_seat_destroy_confined_pointer(xwl_seat); in xwl_seat_unconfine_pointer()