Skip to content

Commit 7c6d439

Browse files
authored
input: Fix input position with more than one wayland backend output (#1625)
1 parent 207b2b3 commit 7c6d439

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/core/seat/input-manager.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,18 @@ void wf::input_manager_t::refresh_device_mappings()
7272
auto mapped_output = section->get_option("output")->get_value_str();
7373
if (mapped_output.empty())
7474
{
75-
mapped_output = nonull(dev->name);
75+
if (dev->type == WLR_INPUT_DEVICE_POINTER)
76+
{
77+
mapped_output = nonull(wlr_pointer_from_input_device(
78+
dev)->output_name);
79+
} else if (dev->type == WLR_INPUT_DEVICE_TOUCH)
80+
{
81+
mapped_output =
82+
nonull(wlr_touch_from_input_device(dev)->output_name);
83+
} else
84+
{
85+
mapped_output = nonull(dev->name);
86+
}
7687
}
7788

7889
auto wo = wf::get_core().output_layout->find_output(mapped_output);

0 commit comments

Comments
 (0)