smooth pointer transitioning between outputs

This commit is contained in:
Tony Crisci 2017-08-24 09:18:42 -04:00
parent 9978349903
commit 431e1ddeca

View file

@ -85,16 +85,20 @@ void wlr_cursor_move(struct wlr_cursor *cur, double delta_x, double delta_y) {
hotspot_y = image->hotspot_y;
}
struct wlr_output *output;
output = 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;
//output = wlr_output_layout_output_at(cur->state->layout, new_x, 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;
if (output) {
int output_x = new_x;
int output_y = new_y;
// TODO fix double to int rounding issues
wlr_output_layout_output_coords(cur->state->layout, output, &output_x, &output_y);
wlr_output_move_cursor(output, output_x - hotspot_x, output_y - hotspot_y);
// TODO fix double to int rounding issues
wlr_output_layout_output_coords(cur->state->layout,
l_output->output, &output_x, &output_y);
wlr_output_move_cursor(l_output->output, output_x - hotspot_x,
output_y - hotspot_y);
}
cur->x = new_x;
cur->y = new_y;