|
|
@ -63,7 +63,6 @@ static void pointer_handle_leave(void *data, struct wl_pointer *wl_pointer,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
backend->current_pointer = NULL;
|
|
|
|
backend->current_pointer = NULL;
|
|
|
|
wlr_log(L_DEBUG, "leave %p", surface);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
|
|
|
|
static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
|
|
|
@ -74,6 +73,17 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_output *wlr_output = &pointer->output->wlr_output;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_box box = {
|
|
|
|
|
|
|
|
.x = wl_fixed_to_int(sx),
|
|
|
|
|
|
|
|
.y = wl_fixed_to_int(sy),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
wlr_box_transform(&box, wlr_output->transform, wlr_output->width,
|
|
|
|
|
|
|
|
wlr_output->height, &box);
|
|
|
|
|
|
|
|
box.x /= wlr_output->scale;
|
|
|
|
|
|
|
|
box.y /= wlr_output->scale;
|
|
|
|
|
|
|
|
|
|
|
|
int output_width, output_height;
|
|
|
|
int output_width, output_height;
|
|
|
|
wlr_output_effective_resolution(&pointer->output->wlr_output,
|
|
|
|
wlr_output_effective_resolution(&pointer->output->wlr_output,
|
|
|
|
&output_width, &output_height);
|
|
|
|
&output_width, &output_height);
|
|
|
@ -81,10 +91,9 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
|
|
|
|
struct wlr_event_pointer_motion_absolute event = {
|
|
|
|
struct wlr_event_pointer_motion_absolute event = {
|
|
|
|
.device = &pointer->input_device->wlr_input_device,
|
|
|
|
.device = &pointer->input_device->wlr_input_device,
|
|
|
|
.time_msec = time,
|
|
|
|
.time_msec = time,
|
|
|
|
.x = (double)wl_fixed_to_int(sx) / output_width,
|
|
|
|
.x = (double)box.x / output_width,
|
|
|
|
.y = (double)wl_fixed_to_int(sy) / output_height,
|
|
|
|
.y = (double)box.y / output_height,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
wlr_log(L_DEBUG, "motion: %f,%f", event.x, event.y);
|
|
|
|
|
|
|
|
wlr_signal_emit_safe(&pointer->wlr_pointer.events.motion_absolute, &event);
|
|
|
|
wlr_signal_emit_safe(&pointer->wlr_pointer.events.motion_absolute, &event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|