Lines Matching +full:tablet +full:- +full:mode
33 #include <xserver-properties.h>
38 #include "tablet-unstable-v2-client-protocol.h"
114 device->public.on = FALSE; in xwl_pointer_proc()
147 device->public.on = TRUE; in xwl_pointer_proc()
152 device->public.on = FALSE; in xwl_pointer_proc()
170 device->public.on = FALSE; in xwl_pointer_proc_relative()
198 device->public.on = TRUE; in xwl_pointer_proc_relative()
203 device->public.on = FALSE; in xwl_pointer_proc_relative()
220 struct xwl_seat *xwl_seat = device->public.devicePrivate; in xwl_keyboard_proc()
225 device->public.on = FALSE; in xwl_keyboard_proc()
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()
237 device->public.on = TRUE; in xwl_keyboard_proc()
242 device->public.on = FALSE; in xwl_keyboard_proc()
261 device->public.on = FALSE; in xwl_touch_proc()
285 device->public.on = TRUE; in xwl_touch_proc()
290 device->public.on = FALSE; in xwl_touch_proc()
312 device->public.on = FALSE; in xwl_tablet_proc()
328 /* Valuators - match the xf86-input-wacom ranges */ in xwl_tablet_proc()
338 -64, 63, 57, 0, 57, Absolute); in xwl_tablet_proc()
341 -64, 63, 57, 0, 57, Absolute); in xwl_tablet_proc()
344 -900, 899, 1, 0, 1, Absolute); in xwl_tablet_proc()
355 device->public.on = TRUE; in xwl_tablet_proc()
360 device->public.on = FALSE; in xwl_tablet_proc()
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()
404 (*pScreen->SetCursorPosition) (dev, pScreen, dx + sx, dy + sy, TRUE); in pointer_handle_enter()
421 for (i = 0; i < dev->button->numButtons; i++) in pointer_handle_enter()
422 if (BitIsOn(dev->button->down, i)) 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()
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()
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()
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()
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()
544 xwl_seat->xwl_screen->serial = serial; in pointer_handle_button()
557 /* Skip indexes 4-7: they are used for vertical and horizontal scroll. in pointer_handle_button()
559 index = 8 + button - BTN_SIDE; in pointer_handle_button()
564 QueuePointerEvents(xwl_seat->pointer, in pointer_handle_button()
590 xorg_list_for_each_entry(iter, &xwl_seat->axis_discrete_pending, l) { in pointer_handle_axis()
591 if (iter->axis == axis) { in pointer_handle_axis()
600 valuator_mask_set(&mask, index, pending->discrete); in pointer_handle_axis()
601 xorg_list_del(&pending->l); in pointer_handle_axis()
606 QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, POINTER_RELATIVE, &mask); in pointer_handle_axis()
614 if (!xwl_seat->focus_window) in pointer_handle_frame()
641 pending->axis = axis; in pointer_handle_axis_discrete()
642 pending->discrete = discrete; in pointer_handle_axis_discrete()
644 xorg_list_add(&pending->l, &xwl_seat->axis_discrete_pending); in pointer_handle_axis_discrete()
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()
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()
700 *k = *--end; 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()
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()
738 XkbUpdateDescActions(xkb, xkb->min_key_code, XkbNumKeys(xkb), &changes); 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()
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()
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()
801 for (dev = inputInfo.devices; dev; dev = dev->next) { in keyboard_handle_modifiers()
802 if (dev != xwl_seat->keyboard && in keyboard_handle_modifiers()
803 dev != GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD)) in keyboard_handle_modifiers()
806 old_state = dev->key->xkbInfo->state; in keyboard_handle_modifiers()
807 new_state = &dev->key->xkbInfo->state; in keyboard_handle_modifiers()
809 new_state->locked_group = group & XkbAllGroupsMask; in keyboard_handle_modifiers()
810 new_state->base_mods = mods_depressed & XkbAllModifiersMask; in keyboard_handle_modifiers()
811 new_state->locked_mods = mods_locked & XkbAllModifiersMask; in keyboard_handle_modifiers()
815 XkbComputeDerivedState(dev->key->xkbInfo); in keyboard_handle_modifiers()
833 struct xwl_seat *xwl_seat = dev->public.devicePrivate; in remove_sync_pending()
839 xorg_list_for_each_entry_safe(p, npd, &xwl_seat->sync_pending, l) { in remove_sync_pending()
840 if (p->pending_dev == dev) { 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()
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()
877 if (p->pending_dev == dev) { in keyboard_check_repeat()
886 p->pending_dev = dev; in keyboard_check_repeat()
887 callback = wl_display_sync (xwl_screen->display); in keyboard_check_repeat()
888 xorg_list_add(&p->l, &xwl_seat->sync_pending); in keyboard_check_repeat()
908 for (dev = inputInfo.devices; dev; dev = dev->next) { in keyboard_handle_repeat_info()
909 if (dev != xwl_seat->keyboard && in keyboard_handle_repeat_info()
910 dev != GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD)) in keyboard_handle_repeat_info()
914 ctrl = dev->key->xkbInfo->desc->ctrls; in keyboard_handle_repeat_info()
915 ctrl->repeat_delay = delay; in keyboard_handle_repeat_info()
917 ctrl->repeat_interval = 1000 / rate; in keyboard_handle_repeat_info()
919 XkbSetRepeatKeys(dev, -1, AutoRepeatModeOn); in keyboard_handle_repeat_info()
921 XkbSetRepeatKeys(dev, -1, AutoRepeatModeOff); in keyboard_handle_repeat_info()
940 &xwl_seat->touches, link_touch) { in xwl_seat_lookup_touch()
941 if (xwl_touch->id == id) in xwl_seat_lookup_touch()
955 dx = xwl_touch->window->window->drawable.x; in xwl_touch_send_event()
956 dy = xwl_touch->window->window->drawable.y; in xwl_touch_send_event()
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()
985 xwl_touch->window = wl_surface_get_user_data(surface); in touch_handle_down()
986 xwl_touch->id = id; in touch_handle_down()
987 xwl_touch->x = wl_fixed_to_int(sx_w); in touch_handle_down()
988 xwl_touch->y = wl_fixed_to_int(sy_w); in touch_handle_down()
989 xorg_list_add(&xwl_touch->link_touch, &xwl_seat->touches); in touch_handle_down()
1007 xorg_list_del(&xwl_touch->link_touch); in touch_handle_up()
1024 xwl_touch->x = wl_fixed_to_int(sx_w); in touch_handle_motion()
1025 xwl_touch->y = wl_fixed_to_int(sy_w); in touch_handle_motion()
1041 &xwl_seat->touches, link_touch) { in touch_handle_cancel()
1047 xorg_list_del(&xwl_touch->link_touch); in touch_handle_cancel()
1065 for (dev = inputInfo.devices; dev; dev = dev->next) in find_matching_seat()
1066 if (dev->deviceProc == xwl_keyboard_proc && in find_matching_seat()
1068 return (struct xwl_seat *) dev->public.devicePrivate; in find_matching_seat()
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()
1090 if (xwl_seat->keyboard_grab) in set_grab()
1093 xwl_screen = xwl_seat->xwl_screen; in set_grab()
1094 xwl_seat->keyboard_grab = in set_grab()
1095 zwp_xwayland_keyboard_grab_manager_v1_grab_keyboard(xwl_screen->wp_grab, in set_grab()
1096 xwl_window->surface, in set_grab()
1097 xwl_seat->seat); in set_grab()
1103 struct xwl_seat *xwl_seat = device->public.devicePrivate; 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()
1134 device->deviceGrab.ActivateGrab = xwl_keyboard_activate_grab; in setup_keyboard_grab_handler()
1135 device->deviceGrab.DeactivateGrab = xwl_keyboard_deactivate_grab; in setup_keyboard_grab_handler()
1152 snprintf(name, sizeof name, "%s:%d", driver, xwl_seat->id); in add_device()
1154 dev->public.devicePrivate = xwl_seat; in add_device()
1155 dev->type = SLAVE; in add_device()
1156 dev->spriteInfo->spriteOwner = FALSE; in add_device()
1165 dev->public.devicePrivate = NULL; in disable_device()
1171 dev->public.devicePrivate = xwl_seat; in enable_device()
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()
1183 if (xwl_seat->pointer == NULL) { 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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
1307 if (caps & WL_SEAT_CAPABILITY_POINTER && xwl_seat->wl_pointer == NULL) { in seat_handle_capabilities()
1310 } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && xwl_seat->wl_pointer) { in seat_handle_capabilities()
1315 if (caps & WL_SEAT_CAPABILITY_KEYBOARD && xwl_seat->wl_keyboard == NULL) { in seat_handle_capabilities()
1317 } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && xwl_seat->wl_keyboard) { in seat_handle_capabilities()
1321 if (caps & WL_SEAT_CAPABILITY_TOUCH && xwl_seat->wl_touch == NULL) { in seat_handle_capabilities()
1323 } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && xwl_seat->wl_touch) { in seat_handle_capabilities()
1327 xwl_seat->xwl_screen->expecting_event--; in seat_handle_capabilities()
1346 xwl_cursor->surface = wl_compositor_create_surface(xwl_screen->compositor); in xwl_cursor_init()
1347 xwl_cursor->update_proc = update_proc; in xwl_cursor_init()
1348 xwl_cursor->frame_cb = NULL; in xwl_cursor_init()
1349 xwl_cursor->needs_update = FALSE; in xwl_cursor_init()
1355 wl_surface_destroy(xwl_cursor->surface); in xwl_cursor_release()
1356 if (xwl_cursor->frame_cb) in xwl_cursor_release()
1357 wl_callback_destroy(xwl_cursor->frame_cb); in xwl_cursor_release()
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()
1382 wl_registry_bind(xwl_screen->registry, id, 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()
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()
1407 &xwl_seat->touches, link_touch) { in xwl_seat_destroy()
1408 xorg_list_del(&xwl_touch->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()
1418 xorg_list_del(&ad->l); 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()
1432 tablet_handle_name(void *data, struct zwp_tablet_v2 *tablet, const char *name) in tablet_handle_name() argument
1437 tablet_handle_id(void *data, struct zwp_tablet_v2 *tablet, uint32_t vid, in tablet_handle_id() argument
1443 tablet_handle_path(void *data, struct zwp_tablet_v2 *tablet, const char *path) in tablet_handle_path() argument
1448 tablet_handle_done(void *data, struct zwp_tablet_v2 *tablet) in tablet_handle_done() argument
1451 struct xwl_seat *xwl_seat = xwl_tablet->seat; in tablet_handle_done()
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()
1473 tablet_handle_removed(void *data, struct zwp_tablet_v2 *tablet) in tablet_handle_removed() argument
1476 struct xwl_seat *xwl_seat = xwl_tablet->seat; in tablet_handle_removed()
1478 xorg_list_del(&xwl_tablet->link); in tablet_handle_removed()
1480 /* The tablet is merely disabled, not removed. The next tablet in tablet_handle_removed()
1481 will re-use the same X devices */ in tablet_handle_removed()
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()
1492 zwp_tablet_v2_destroy(tablet); in tablet_handle_removed()
1509 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_receive_type()
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()
1553 xorg_list_del(&xwl_tablet_tool->link); in tablet_tool_receive_removed()
1554 xwl_cursor_release(&xwl_tablet_tool->cursor); in tablet_tool_receive_removed()
1561 uint32_t serial, struct zwp_tablet_v2 *tablet, in tablet_tool_proximity_in() argument
1565 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_proximity_in()
1578 xwl_tablet_tool->proximity_in_serial = serial; in tablet_tool_proximity_in()
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()
1590 xwl_tablet_tool->proximity_in_serial = 0; in tablet_tool_proximity_out()
1591 xwl_seat->tablet_focus_window = NULL; in tablet_tool_proximity_out()
1593 xwl_tablet_tool->pressure = 0; in tablet_tool_proximity_out()
1594 xwl_tablet_tool->tilt_x = 0; in tablet_tool_proximity_out()
1595 xwl_tablet_tool->tilt_y = 0; in tablet_tool_proximity_out()
1596 xwl_tablet_tool->rotation = 0; in tablet_tool_proximity_out()
1597 xwl_tablet_tool->slider = 0; in tablet_tool_proximity_out()
1604 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_down()
1607 xwl_seat->xwl_screen->serial = serial; in tablet_tool_down()
1610 QueuePointerEvents(xwl_tablet_tool->xdevice, ButtonPress, 1, 0, &mask); in tablet_tool_down()
1620 QueuePointerEvents(xwl_tablet_tool->xdevice, ButtonRelease, 1, 0, &mask); in tablet_tool_up()
1628 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_motion()
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()
1639 xwl_tablet_tool->x = (double) dx + sx; in tablet_tool_motion()
1640 xwl_tablet_tool->y = (double) dy + sy; in tablet_tool_motion()
1648 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_pressure()
1650 if (!xwl_seat->tablet_focus_window) in tablet_tool_pressure()
1654 xwl_tablet_tool->pressure = pressure; in tablet_tool_pressure()
1668 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_tilt()
1670 if (!xwl_seat->tablet_focus_window) in tablet_tool_tilt()
1673 xwl_tablet_tool->tilt_x = wl_fixed_to_double(tilt_x); in tablet_tool_tilt()
1674 xwl_tablet_tool->tilt_y = wl_fixed_to_double(tilt_y); in tablet_tool_tilt()
1682 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_rotation()
1685 if (!xwl_seat->tablet_focus_window) in tablet_tool_rotation()
1693 xwl_tablet_tool->rotation = rotation; in tablet_tool_rotation()
1701 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_slider()
1704 if (!xwl_seat->tablet_focus_window) in tablet_tool_slider()
1707 xwl_tablet_tool->slider = (position * 1799.0f) - 900.0f; in tablet_tool_slider()
1715 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_wheel()
1717 if (!xwl_seat->tablet_focus_window) in tablet_tool_wheel()
1720 xwl_tablet_tool->wheel_clicks = clicks; in tablet_tool_wheel()
1728 struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; in tablet_tool_button_state()
1729 uint32_t *mask = &xwl_tablet_tool->buttons_now; in tablet_tool_button_state()
1734 xbtn = button - 0x100 + 1; in tablet_tool_button_state()
1738 xbtn = button - 0x130 + 10; in tablet_tool_button_state()
1742 xbtn = button - 0x126 + 16; in tablet_tool_button_state()
1775 ErrorF("unknown tablet button number %d\n", button); in tablet_tool_button_state()
1782 SetBit(mask, xbtn - 1); in tablet_tool_button_state()
1784 ClearBit(mask, xbtn - 1); in tablet_tool_button_state()
1786 xwl_seat->xwl_screen->serial = serial; in tablet_tool_button_state()
1798 valuator_mask_set_double(&mask, 0, xwl_tablet_tool->x); in tablet_tool_frame()
1799 valuator_mask_set_double(&mask, 1, xwl_tablet_tool->y); in tablet_tool_frame()
1800 valuator_mask_set(&mask, 2, xwl_tablet_tool->pressure); in tablet_tool_frame()
1801 valuator_mask_set_double(&mask, 3, xwl_tablet_tool->tilt_x); in tablet_tool_frame()
1802 valuator_mask_set_double(&mask, 4, xwl_tablet_tool->tilt_y); in tablet_tool_frame()
1803 valuator_mask_set_double(&mask, 5, xwl_tablet_tool->rotation + xwl_tablet_tool->slider); in tablet_tool_frame()
1805 QueuePointerEvents(xwl_tablet_tool->xdevice, MotionNotify, 0, in tablet_tool_frame()
1810 diff = xwl_tablet_tool->buttons_prev ^ xwl_tablet_tool->buttons_now; in tablet_tool_frame()
1811 released = diff & ~xwl_tablet_tool->buttons_now; in tablet_tool_frame()
1812 pressed = diff & xwl_tablet_tool->buttons_now; in tablet_tool_frame()
1817 QueuePointerEvents(xwl_tablet_tool->xdevice, in tablet_tool_frame()
1826 QueuePointerEvents(xwl_tablet_tool->xdevice, in tablet_tool_frame()
1832 xwl_tablet_tool->buttons_prev = xwl_tablet_tool->buttons_now; in tablet_tool_frame()
1834 while (xwl_tablet_tool->wheel_clicks) { in tablet_tool_frame()
1835 if (xwl_tablet_tool->wheel_clicks < 0) { in tablet_tool_frame()
1837 xwl_tablet_tool->wheel_clicks++; in tablet_tool_frame()
1841 xwl_tablet_tool->wheel_clicks--; in tablet_tool_frame()
1844 QueuePointerEvents(xwl_tablet_tool->xdevice, in tablet_tool_frame()
1846 QueuePointerEvents(xwl_tablet_tool->xdevice, in tablet_tool_frame()
1877 zwp_tablet_pad_ring_v2_destroy(ring->ring); in tablet_pad_ring_destroy()
1878 xorg_list_del(&ring->link); in tablet_pad_ring_destroy()
1895 struct xwl_tablet_pad *pad = ring->group->pad; in tablet_pad_ring_angle()
1900 valuator_mask_set(&mask, 5 + ring->index, deg/360.0 * 71); in tablet_pad_ring_angle()
1901 QueuePointerEvents(pad->xdevice, MotionNotify, 0, 0, &mask); in tablet_pad_ring_angle()
1928 zwp_tablet_pad_strip_v2_destroy(strip->strip); in tablet_pad_strip_destroy()
1929 xorg_list_del(&strip->link); in tablet_pad_strip_destroy()
1946 struct xwl_tablet_pad *pad = strip->group->pad; in tablet_pad_strip_position()
1950 valuator_mask_set(&mask, 3 + strip->index, position/65535.0 * 2048); in tablet_pad_strip_position()
1951 QueuePointerEvents(pad->xdevice, MotionNotify, 0, 0, &mask); in tablet_pad_strip_position()
1981 &group->pad_group_ring_list, in tablet_pad_group_destroy()
1986 &group->pad_group_strip_list, in tablet_pad_group_destroy()
1990 zwp_tablet_pad_group_v2_destroy(group->group); in tablet_pad_group_destroy()
1991 xorg_list_del(&group->link); in tablet_pad_group_destroy()
2018 ring->index = ring_index++; in tablet_pad_group_ring()
2019 ring->group = group; in tablet_pad_group_ring()
2020 ring->ring = wp_ring; in tablet_pad_group_ring()
2022 xorg_list_add(&ring->link, &group->pad_group_ring_list); in tablet_pad_group_ring()
2043 strip->index = strip_index++; in tablet_pad_group_strip()
2044 strip->group = group; in tablet_pad_group_strip()
2045 strip->strip = wp_strip; in tablet_pad_group_strip()
2047 xorg_list_add(&strip->link, &group->pad_group_strip_list); in tablet_pad_group_strip()
2073 uint32_t mode) in tablet_pad_group_mode_switch() argument
2090 struct xwl_tablet_pad *pad = dixGetPrivate(&device->devPrivates, in xwl_tablet_pad_proc()
2092 /* Axis layout mirrors that of xf86-input-wacom to have better in xwl_tablet_pad_proc()
2103 device->public.on = FALSE; in xwl_tablet_pad_proc()
2117 nbuttons = min(max(pad->nbuttons + 4, 7), MAX_BUTTONS); in xwl_tablet_pad_proc()
2128 /* Pressure - unused, for backwards compat only */ in xwl_tablet_pad_proc()
2150 device->public.on = TRUE; in xwl_tablet_pad_proc()
2155 device->public.on = FALSE; in xwl_tablet_pad_proc()
2177 group->pad = pad; in tablet_pad_group()
2178 group->group = pad_group; in tablet_pad_group()
2179 xorg_list_init(&group->pad_group_ring_list); in tablet_pad_group()
2180 xorg_list_init(&group->pad_group_strip_list); in tablet_pad_group()
2182 xorg_list_add(&group->link, &pad->pad_group_list); in tablet_pad_group()
2204 pad->nbuttons = buttons; in tablet_pad_buttons()
2213 pad->xdevice = add_device(pad->seat, "xwayland-pad", in tablet_pad_done()
2215 dixSetPrivate(&pad->xdevice->devPrivates, &xwl_tablet_private_key, pad); in tablet_pad_done()
2216 ActivateDevice(pad->xdevice, TRUE); in tablet_pad_done()
2217 EnableDevice(pad->xdevice, TRUE); in tablet_pad_done()
2230 button++; /* wayland index vs X's 1-offset */ in tablet_pad_button()
2231 /* skip scroll wheel buttons 4-7 */ in tablet_pad_button()
2235 QueuePointerEvents(pad->xdevice, in tablet_pad_button()
2243 struct zwp_tablet_v2 *tablet, in tablet_pad_enter() argument
2246 /* pairs the pad with the tablet but also to set the focus. We in tablet_pad_enter()
2256 /* pairs the pad with the tablet but also to set the focus. We in tablet_pad_leave()
2267 xorg_list_for_each_entry_safe(g, tg, &pad->pad_group_list, link) in tablet_pad_removed()
2270 RemoveDevice(pad->xdevice, TRUE); in tablet_pad_removed()
2271 xorg_list_del(&pad->link); in tablet_pad_removed()
2272 zwp_tablet_pad_v2_destroy(pad->pad); in tablet_pad_removed()
2289 struct zwp_tablet_v2 *tablet) in tablet_seat_handle_add_tablet() argument
2300 xwl_tablet->tablet = tablet; in tablet_seat_handle_add_tablet()
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()
2305 zwp_tablet_v2_add_listener(tablet, &tablet_listener, xwl_tablet); in tablet_seat_handle_add_tablet()
2322 struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; in tablet_seat_handle_add_tool()
2331 xwl_tablet_tool->tool = tool; in tablet_seat_handle_add_tool()
2332 xwl_tablet_tool->seat = xwl_seat; in tablet_seat_handle_add_tool()
2333 xwl_cursor_init(&xwl_tablet_tool->cursor, xwl_screen, in tablet_seat_handle_add_tool()
2336 xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools); in tablet_seat_handle_add_tool()
2354 xwl_tablet_pad->pad = pad; in tablet_seat_handle_add_pad()
2355 xwl_tablet_pad->seat = xwl_seat; in tablet_seat_handle_add_pad()
2356 xorg_list_init(&xwl_tablet_pad->pad_group_list); in tablet_seat_handle_add_pad()
2358 xorg_list_add(&xwl_tablet_pad->link, &xwl_seat->tablet_pads); in tablet_seat_handle_add_pad()
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()
2378 if (!xwl_screen->tablet_manager) in init_tablet_manager_seat()
2381 xwl_seat->tablet_seat = in init_tablet_manager_seat()
2382 zwp_tablet_manager_v2_get_tablet_seat(xwl_screen->tablet_manager, 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()
2396 &xwl_seat->tablet_pads, link) { in release_tablet_manager_seat()
2397 xorg_list_del(&xwl_tablet_pad->link); in release_tablet_manager_seat()
2398 zwp_tablet_pad_v2_destroy(xwl_tablet_pad->pad); in release_tablet_manager_seat()
2403 &xwl_seat->tablet_tools, link) { in release_tablet_manager_seat()
2404 xorg_list_del(&xwl_tablet_tool->link); in release_tablet_manager_seat()
2405 zwp_tablet_tool_v2_destroy(xwl_tablet_tool->tool); in release_tablet_manager_seat()
2410 &xwl_seat->tablets, link) { in release_tablet_manager_seat()
2411 xorg_list_del(&xwl_tablet->link); in release_tablet_manager_seat()
2412 zwp_tablet_v2_destroy(xwl_tablet->tablet); 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()
2427 xwl_screen->tablet_manager = wl_registry_bind(xwl_screen->registry, in init_tablet_manager()
2432 xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { in init_tablet_manager()
2440 if (xwl_screen->tablet_manager) { in xwl_screen_release_tablet_manager()
2441 zwp_tablet_manager_v2_destroy(xwl_screen->tablet_manager); in xwl_screen_release_tablet_manager()
2442 xwl_screen->tablet_manager = NULL; in xwl_screen_release_tablet_manager()
2450 xwl_screen->relative_pointer_manager = in init_relative_pointer_manager()
2451 wl_registry_bind(xwl_screen->registry, id, in init_relative_pointer_manager()
2460 xwl_screen->pointer_constraints = in init_pointer_constraints()
2461 wl_registry_bind(xwl_screen->registry, id, in init_pointer_constraints()
2473 xwl_screen->wp_grab = in init_keyboard_grab()
2474 wl_registry_bind(xwl_screen->registry, id, in init_keyboard_grab()
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()
2495 xwl_screen->expecting_event++; in input_handler()
2540 for (device = inputInfo.devices; device; device = device->next) { in sprite_check_lost_focus()
2541 /* Ignore non-wayland devices */ in sprite_check_lost_focus()
2542 if (device->deviceProc == xwl_pointer_proc && in sprite_check_lost_focus()
2543 device->spriteInfo->sprite == sprite) in sprite_check_lost_focus()
2550 xwl_seat = device->public.devicePrivate; in sprite_check_lost_focus()
2555 if (!master || !master->lastSlave) 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()
2579 screen->XYToWindow = xwl_screen->XYToWindow; in xwl_xy_to_window()
2580 ret = screen->XYToWindow(screen, sprite, x, y); in xwl_xy_to_window()
2581 xwl_screen->XYToWindow = screen->XYToWindow; in xwl_xy_to_window()
2582 screen->XYToWindow = xwl_xy_to_window; in xwl_xy_to_window()
2591 sprite->spriteTraceGood = 1; in xwl_xy_to_window()
2592 return sprite->spriteTrace[0]; in xwl_xy_to_window()
2604 &xwl_seat->touches, link_touch) { in xwl_seat_clear_touch()
2605 if (xwl_touch->window->window == window) { in xwl_seat_clear_touch()
2606 xorg_list_del(&xwl_touch->link_touch); in xwl_seat_clear_touch()
2618 warp_emulator->locked_pointer; in xwl_pointer_warp_emulator_set_fake_pos()
2622 if (!warp_emulator->locked_pointer) in xwl_pointer_warp_emulator_set_fake_pos()
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()
2629 if (x >= window->drawable.x || in xwl_pointer_warp_emulator_set_fake_pos()
2630 y >= window->drawable.y || in xwl_pointer_warp_emulator_set_fake_pos()
2631 x < (window->drawable.x + window->drawable.width) || in xwl_pointer_warp_emulator_set_fake_pos()
2632 y < (window->drawable.y + window->drawable.height)) { in xwl_pointer_warp_emulator_set_fake_pos()
2633 sx = x - window->drawable.x; in xwl_pointer_warp_emulator_set_fake_pos()
2634 sy = y - window->drawable.y; 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()
2645 if (warp_emulator->locked_pointer) in xwl_pointer_warp_emulator_is_locked()
2654 struct xwl_seat *xwl_seat = warp_emulator->xwl_seat; in xwl_pointer_warp_emulator_lock()
2655 struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; in xwl_pointer_warp_emulator_lock()
2657 xwl_screen->pointer_constraints; in xwl_pointer_warp_emulator_lock()
2658 struct xwl_window *lock_window = xwl_seat->focus_window; in xwl_pointer_warp_emulator_lock()
2660 warp_emulator->locked_window = lock_window; in xwl_pointer_warp_emulator_lock()
2662 warp_emulator->locked_pointer = in xwl_pointer_warp_emulator_lock()
2664 lock_window->surface, 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()
2677 GrabPtr pointer_grab = xwl_seat->pointer->deviceGrab.grab; in xwl_pointer_warp_emulator_maybe_lock()
2679 if (warp_emulator->locked_pointer) in xwl_pointer_warp_emulator_maybe_lock()
2686 if (!pointer_grab && xwl_seat->focus_window != xwl_window) in xwl_pointer_warp_emulator_maybe_lock()
2695 !pointer_grab->ownerEvents && 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()
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()
2740 (x < window->drawable.x || in xwl_pointer_warp_emulator_handle_motion()
2741 y < window->drawable.y || in xwl_pointer_warp_emulator_handle_motion()
2742 x >= (window->drawable.x + window->drawable.width) || in xwl_pointer_warp_emulator_handle_motion()
2743 y >= (window->drawable.y + window->drawable.height))) in xwl_pointer_warp_emulator_handle_motion()
2760 warp_emulator->xwl_seat = xwl_seat; in xwl_pointer_warp_emulator_create()
2768 if (warp_emulator->locked_pointer) in xwl_pointer_warp_emulator_destroy()
2769 zwp_locked_pointer_v1_destroy(warp_emulator->locked_pointer); in xwl_pointer_warp_emulator_destroy()
2776 if (xwl_seat->confined_pointer) in xwl_seat_create_pointer_warp_emulator()
2779 xwl_seat->pointer_warp_emulator = in xwl_seat_create_pointer_warp_emulator()
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()
2796 if (!xwl_screen->relative_pointer_manager) in xwl_seat_can_emulate_pointer_warp()
2799 if (!xwl_screen->pointer_constraints) in xwl_seat_can_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()
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()
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()
2847 xwl_pointer_warp_emulator_lock(xwl_seat->pointer_warp_emulator); in xwl_seat_maybe_lock_on_hidden_cursor()
2854 if (xwl_seat->pointer_warp_emulator && xwl_seat->x_cursor != NULL) { in xwl_seat_cursor_visibility_changed()
2856 } else if (!xwl_seat->x_cursor && xwl_seat->cursor_confinement_window) { in xwl_seat_cursor_visibility_changed()
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()
2874 xwl_seat->cursor_confinement_window); in xwl_seat_destroy_pointer_warp_emulator()
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()
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()
2905 xwl_seat->confined_pointer = in xwl_seat_confine_pointer()
2907 xwl_window->surface, in xwl_seat_confine_pointer()
2908 xwl_seat->wl_pointer, in xwl_seat_confine_pointer()
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()
2923 xwl_seat->cursor_confinement_window = NULL; in xwl_seat_unconfine_pointer()
2925 if (xwl_seat->confined_pointer) in xwl_seat_unconfine_pointer()
2942 xwl_screen->input_registry = wl_display_get_registry(xwl_screen->display); in InitInput()
2943 wl_registry_add_listener(xwl_screen->input_registry, &input_listener, in InitInput()
2946 xwl_screen->XYToWindow = pScreen->XYToWindow; in InitInput()
2947 pScreen->XYToWindow = xwl_xy_to_window; in InitInput()