mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-23 10:29:49 +01:00
smooth pointer transitioning between outputs
This commit is contained in:
parent
9978349903
commit
431e1ddeca
1 changed files with 13 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue