|
|
@ -135,7 +135,8 @@ static struct sway_container *container_at_coords(
|
|
|
|
return output->swayc;
|
|
|
|
return output->swayc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec) {
|
|
|
|
void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
|
|
|
|
|
|
|
|
bool allow_refocusing) {
|
|
|
|
if (time_msec == 0) {
|
|
|
|
if (time_msec == 0) {
|
|
|
|
time_msec = get_current_time_msec();
|
|
|
|
time_msec = get_current_time_msec();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -145,7 +146,7 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec)
|
|
|
|
double sx, sy;
|
|
|
|
double sx, sy;
|
|
|
|
struct sway_container *c = container_at_coords(cursor->seat,
|
|
|
|
struct sway_container *c = container_at_coords(cursor->seat,
|
|
|
|
cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy);
|
|
|
|
cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy);
|
|
|
|
if (c && config->focus_follows_mouse) {
|
|
|
|
if (c && config->focus_follows_mouse && allow_refocusing) {
|
|
|
|
if (c->type == C_WORKSPACE) {
|
|
|
|
if (c->type == C_WORKSPACE) {
|
|
|
|
// Only follow the mouse if it would move to a new output
|
|
|
|
// Only follow the mouse if it would move to a new output
|
|
|
|
// Otherwise we'll focus the workspace, which is probably wrong
|
|
|
|
// Otherwise we'll focus the workspace, which is probably wrong
|
|
|
@ -193,7 +194,7 @@ static void handle_cursor_motion(struct wl_listener *listener, void *data) {
|
|
|
|
struct wlr_event_pointer_motion *event = data;
|
|
|
|
struct wlr_event_pointer_motion *event = data;
|
|
|
|
wlr_cursor_move(cursor->cursor, event->device,
|
|
|
|
wlr_cursor_move(cursor->cursor, event->device,
|
|
|
|
event->delta_x, event->delta_y);
|
|
|
|
event->delta_x, event->delta_y);
|
|
|
|
cursor_send_pointer_motion(cursor, event->time_msec);
|
|
|
|
cursor_send_pointer_motion(cursor, event->time_msec, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void handle_cursor_motion_absolute(
|
|
|
|
static void handle_cursor_motion_absolute(
|
|
|
@ -203,7 +204,7 @@ static void handle_cursor_motion_absolute(
|
|
|
|
wlr_idle_notify_activity(cursor->seat->input->server->idle, cursor->seat->wlr_seat);
|
|
|
|
wlr_idle_notify_activity(cursor->seat->input->server->idle, cursor->seat->wlr_seat);
|
|
|
|
struct wlr_event_pointer_motion_absolute *event = data;
|
|
|
|
struct wlr_event_pointer_motion_absolute *event = data;
|
|
|
|
wlr_cursor_warp_absolute(cursor->cursor, event->device, event->x, event->y);
|
|
|
|
wlr_cursor_warp_absolute(cursor->cursor, event->device, event->x, event->y);
|
|
|
|
cursor_send_pointer_motion(cursor, event->time_msec);
|
|
|
|
cursor_send_pointer_motion(cursor, event->time_msec, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void dispatch_cursor_button(struct sway_cursor *cursor,
|
|
|
|
void dispatch_cursor_button(struct sway_cursor *cursor,
|
|
|
@ -373,7 +374,7 @@ static void handle_tool_axis(struct wl_listener *listener, void *data) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wlr_cursor_warp_absolute(cursor->cursor, event->device, x, y);
|
|
|
|
wlr_cursor_warp_absolute(cursor->cursor, event->device, x, y);
|
|
|
|
cursor_send_pointer_motion(cursor, event->time_msec);
|
|
|
|
cursor_send_pointer_motion(cursor, event->time_msec, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void handle_tool_tip(struct wl_listener *listener, void *data) {
|
|
|
|
static void handle_tool_tip(struct wl_listener *listener, void *data) {
|
|
|
|