multi-seat: re-enable mouse button+motion reporting support

This commit is contained in:
Daniel Eklöf 2020-07-08 18:16:43 +02:00
parent be2490022d
commit 58415428cf
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 47 additions and 38 deletions

22
input.c
View file

@ -1020,7 +1020,8 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer,
selection_update(term, col, row);
term_mouse_motion(
term, seat->mouse.button, seat->mouse.row, seat->mouse.col);
term, seat->mouse.button, seat->mouse.row, seat->mouse.col,
seat->kbd.shift, seat->kbd.alt, seat->kbd.ctrl);
break;
}
}
@ -1232,7 +1233,9 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
}
}
term_mouse_down(term, button, seat->mouse.row, seat->mouse.col);
term_mouse_down(
term, button, seat->mouse.row, seat->mouse.col,
seat->kbd.shift, seat->kbd.alt, seat->kbd.ctrl);
break;
}
@ -1240,7 +1243,9 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
if (button == BTN_LEFT && term->selection.end.col != -1)
selection_finalize(term, serial);
term_mouse_up(term, button, seat->mouse.row, seat->mouse.col);
term_mouse_up(
term, button, seat->mouse.row, seat->mouse.col,
seat->kbd.shift, seat->kbd.alt, seat->kbd.ctrl);
break;
}
break;
@ -1288,9 +1293,14 @@ mouse_scroll(struct seat *seat, int amount)
keyboard_key(seat, NULL, seat->input_serial, 0, key - 8, XKB_KEY_DOWN);
keyboard_key(seat, NULL, seat->input_serial, 0, key - 8, XKB_KEY_UP);
} else {
for (int i = 0; i < amount; i++)
term_mouse_down(term, button, seat->mouse.row, seat->mouse.col);
term_mouse_up(term, button, seat->mouse.row, seat->mouse.col);
for (int i = 0; i < amount; i++) {
term_mouse_down(
term, button, seat->mouse.row, seat->mouse.col,
seat->kbd.shift, seat->kbd.alt, seat->kbd.ctrl);
}
term_mouse_up(
term, button, seat->mouse.row, seat->mouse.col,
seat->kbd.shift, seat->kbd.alt, seat->kbd.ctrl);
scrollback(term, amount);
}