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