|
|
@ -73,7 +73,7 @@ void wlr_cursor_move(struct wlr_cursor *cur, double delta_x, double delta_y) {
|
|
|
|
|
|
|
|
|
|
|
|
// TODO handle no layout
|
|
|
|
// TODO handle no layout
|
|
|
|
assert(cur->state->layout);
|
|
|
|
assert(cur->state->layout);
|
|
|
|
// TODO handle layout boundaries
|
|
|
|
|
|
|
|
double new_x = cur->x + delta_x;
|
|
|
|
double new_x = cur->x + delta_x;
|
|
|
|
double new_y = cur->y + delta_y;
|
|
|
|
double new_y = cur->y + delta_y;
|
|
|
|
int hotspot_x = 0;
|
|
|
|
int hotspot_x = 0;
|
|
|
@ -85,24 +85,28 @@ void wlr_cursor_move(struct wlr_cursor *cur, double delta_x, double delta_y) {
|
|
|
|
hotspot_y = image->hotspot_y;
|
|
|
|
hotspot_y = image->hotspot_y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (wlr_output_layout_output_at(cur->state->layout, new_x, new_y)) {
|
|
|
|
if (!wlr_output_layout_output_at(cur->state->layout, new_x, new_y)) {
|
|
|
|
//struct wlr_output *output;
|
|
|
|
int closest_x, closest_y;
|
|
|
|
//output = wlr_output_layout_output_at(cur->state->layout, new_x, new_y);
|
|
|
|
wlr_output_layout_closest_boundary(cur->state->layout, new_x, new_y,
|
|
|
|
struct wlr_output_layout_output *l_output;
|
|
|
|
&closest_x, &closest_y);
|
|
|
|
wl_list_for_each(l_output, &cur->state->layout->outputs, link) {
|
|
|
|
new_x = closest_x;
|
|
|
|
int output_x = new_x;
|
|
|
|
new_y = closest_y;
|
|
|
|
int output_y = new_y;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_output_layout_output *l_output;
|
|
|
|
|
|
|
|
wl_list_for_each(l_output, &cur->state->layout->outputs, link) {
|
|
|
|
|
|
|
|
int output_x = new_x;
|
|
|
|
|
|
|
|
int output_y = new_y;
|
|
|
|
|
|
|
|
|
|
|
|
// TODO fix double to int rounding issues
|
|
|
|
// TODO fix double to int rounding issues
|
|
|
|
wlr_output_layout_output_coords(cur->state->layout,
|
|
|
|
wlr_output_layout_output_coords(cur->state->layout,
|
|
|
|
l_output->output, &output_x, &output_y);
|
|
|
|
l_output->output, &output_x, &output_y);
|
|
|
|
wlr_output_move_cursor(l_output->output, output_x - hotspot_x,
|
|
|
|
wlr_output_move_cursor(l_output->output, output_x - hotspot_x,
|
|
|
|
output_y - hotspot_y);
|
|
|
|
output_y - hotspot_y);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cur->x = new_x;
|
|
|
|
|
|
|
|
cur->y = new_y;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cur->x = new_x;
|
|
|
|
|
|
|
|
cur->y = new_y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void handle_pointer_motion(struct wl_listener *listener, void *data) {
|
|
|
|
static void handle_pointer_motion(struct wl_listener *listener, void *data) {
|
|
|
|