|
|
|
@ -192,12 +192,12 @@ static void state_add_button(struct seatop_default_event *e, uint32_t button) {
|
|
|
|
|
static void cursor_do_rebase(struct sway_cursor *cursor, uint32_t time_msec,
|
|
|
|
|
struct sway_node *node, struct wlr_surface *surface,
|
|
|
|
|
double sx, double sy) {
|
|
|
|
|
struct wlr_seat *wlr_seat = cursor->seat->wlr_seat;
|
|
|
|
|
// Handle cursor image
|
|
|
|
|
if (surface) {
|
|
|
|
|
// Reset cursor if switching between clients
|
|
|
|
|
struct wl_client *client = wl_resource_get_client(surface->resource);
|
|
|
|
|
if (client != cursor->image_client) {
|
|
|
|
|
cursor_set_image(cursor, "left_ptr", client);
|
|
|
|
|
if (seat_is_input_allowed(cursor->seat, surface)) {
|
|
|
|
|
wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy);
|
|
|
|
|
wlr_seat_pointer_notify_motion(wlr_seat, time_msec, sx, sy);
|
|
|
|
|
}
|
|
|
|
|
} else if (node && node->type == N_CONTAINER) {
|
|
|
|
|
// Try a node's resize edge
|
|
|
|
@ -217,14 +217,7 @@ static void cursor_do_rebase(struct sway_cursor *cursor, uint32_t time_msec,
|
|
|
|
|
cursor_set_image(cursor, "left_ptr", NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Send pointer enter/leave
|
|
|
|
|
struct wlr_seat *wlr_seat = cursor->seat->wlr_seat;
|
|
|
|
|
if (surface) {
|
|
|
|
|
if (seat_is_input_allowed(cursor->seat, surface)) {
|
|
|
|
|
wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy);
|
|
|
|
|
wlr_seat_pointer_notify_motion(wlr_seat, time_msec, sx, sy);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (surface == NULL) {
|
|
|
|
|
wlr_seat_pointer_clear_focus(wlr_seat);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|