mirror of
https://github.com/labwc/labwc.git
synced 2026-03-17 05:33:47 -04:00
seat: re-map pointer to output on output change
This commit is contained in:
parent
f5f5a7b036
commit
6d6f243ff5
1 changed files with 12 additions and 3 deletions
15
src/seat.c
15
src/seat.c
|
|
@ -215,6 +215,14 @@ map_input_to_output(struct seat *seat, struct wlr_input_device *dev, char *outpu
|
||||||
wlr_cursor_map_input_to_region(seat->cursor, dev, NULL);
|
wlr_cursor_map_input_to_region(seat->cursor, dev, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
map_pointer_to_output(struct seat *seat, struct wlr_input_device *dev)
|
||||||
|
{
|
||||||
|
struct wlr_pointer *pointer = wlr_pointer_from_input_device(dev);
|
||||||
|
wlr_log(WLR_INFO, "map pointer to output %s\n", pointer->output_name);
|
||||||
|
map_input_to_output(seat, dev, pointer->output_name);
|
||||||
|
}
|
||||||
|
|
||||||
static struct input *
|
static struct input *
|
||||||
new_pointer(struct seat *seat, struct wlr_input_device *dev)
|
new_pointer(struct seat *seat, struct wlr_input_device *dev)
|
||||||
{
|
{
|
||||||
|
|
@ -225,9 +233,7 @@ new_pointer(struct seat *seat, struct wlr_input_device *dev)
|
||||||
|
|
||||||
/* In support of running with WLR_WL_OUTPUTS set to >=2 */
|
/* In support of running with WLR_WL_OUTPUTS set to >=2 */
|
||||||
if (dev->type == WLR_INPUT_DEVICE_POINTER) {
|
if (dev->type == WLR_INPUT_DEVICE_POINTER) {
|
||||||
struct wlr_pointer *pointer = wlr_pointer_from_input_device(dev);
|
map_pointer_to_output(seat, dev);
|
||||||
wlr_log(WLR_INFO, "map pointer to output %s\n", pointer->output_name);
|
|
||||||
map_input_to_output(seat, dev, pointer->output_name);
|
|
||||||
}
|
}
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
@ -659,6 +665,9 @@ seat_output_layout_changed(struct seat *seat)
|
||||||
struct input *input = NULL;
|
struct input *input = NULL;
|
||||||
wl_list_for_each(input, &seat->inputs, link) {
|
wl_list_for_each(input, &seat->inputs, link) {
|
||||||
switch (input->wlr_input_device->type) {
|
switch (input->wlr_input_device->type) {
|
||||||
|
case WLR_INPUT_DEVICE_POINTER:
|
||||||
|
map_pointer_to_output(seat, input->wlr_input_device);
|
||||||
|
break;
|
||||||
case WLR_INPUT_DEVICE_TOUCH:
|
case WLR_INPUT_DEVICE_TOUCH:
|
||||||
map_touch_to_output(seat, input->wlr_input_device);
|
map_touch_to_output(seat, input->wlr_input_device);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue