|
|
@ -101,8 +101,7 @@ static void seat_view_deco_button(struct roots_seat_view *view, double sx,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void roots_passthrough_cursor(struct roots_cursor *cursor,
|
|
|
|
static void roots_passthrough_cursor(struct roots_cursor *cursor,
|
|
|
|
int64_t time) {
|
|
|
|
uint32_t time) {
|
|
|
|
bool focus_changed;
|
|
|
|
|
|
|
|
double sx, sy;
|
|
|
|
double sx, sy;
|
|
|
|
struct roots_view *view = NULL;
|
|
|
|
struct roots_view *view = NULL;
|
|
|
|
struct roots_seat *seat = cursor->seat;
|
|
|
|
struct roots_seat *seat = cursor->seat;
|
|
|
@ -146,23 +145,26 @@ static void roots_passthrough_cursor(struct roots_cursor *cursor,
|
|
|
|
cursor->wlr_surface = surface;
|
|
|
|
cursor->wlr_surface = surface;
|
|
|
|
|
|
|
|
|
|
|
|
if (surface) {
|
|
|
|
if (surface) {
|
|
|
|
focus_changed = (seat->seat->pointer_state.focused_surface != surface);
|
|
|
|
|
|
|
|
wlr_seat_pointer_notify_enter(seat->seat, surface, sx, sy);
|
|
|
|
wlr_seat_pointer_notify_enter(seat->seat, surface, sx, sy);
|
|
|
|
if (!focus_changed && time > 0) {
|
|
|
|
wlr_seat_pointer_notify_motion(seat->seat, time, sx, sy);
|
|
|
|
wlr_seat_pointer_notify_motion(seat->seat, time, sx, sy);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
wlr_seat_pointer_clear_focus(seat->seat);
|
|
|
|
wlr_seat_pointer_clear_focus(seat->seat);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct roots_drag_icon *drag_icon;
|
|
|
|
if (seat->drag_icon != NULL) {
|
|
|
|
wl_list_for_each(drag_icon, &seat->drag_icons, link) {
|
|
|
|
roots_drag_icon_update_position(seat->drag_icon);
|
|
|
|
roots_drag_icon_update_position(drag_icon);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline int64_t timespec_to_msec(const struct timespec *a) {
|
|
|
|
|
|
|
|
return (int64_t)a->tv_sec * 1000 + a->tv_nsec / 1000000;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void roots_cursor_update_focus(struct roots_cursor *cursor) {
|
|
|
|
void roots_cursor_update_focus(struct roots_cursor *cursor) {
|
|
|
|
roots_passthrough_cursor(cursor, -1);
|
|
|
|
struct timespec now;
|
|
|
|
|
|
|
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
roots_passthrough_cursor(cursor, timespec_to_msec(&now));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void roots_cursor_update_position(struct roots_cursor *cursor,
|
|
|
|
void roots_cursor_update_position(struct roots_cursor *cursor,
|
|
|
|