Skip to content

Commit

Permalink
ipc-input-methods: Pass device vendor/product id from libinput if ava…
Browse files Browse the repository at this point in the history
…ilable
  • Loading branch information
soreau committed Dec 18, 2024
1 parent 158ff3e commit 56b9e51
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions plugins/ipc-rules/ipc-input-methods.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,20 @@ class ipc_rules_input_methods_t
for (auto& device : wf::get_core().get_input_devices())
{
nlohmann::json d;
d["id"] = (intptr_t)device->get_wlr_handle();
d["name"] = nonull(device->get_wlr_handle()->name);
d["type"] = wlr_input_device_type_to_string(device->get_wlr_handle()->type);
d["id"] = (intptr_t)device->get_wlr_handle();
d["name"] = nonull(device->get_wlr_handle()->name);
d["vendor"] = "unknown";
d["product"] = "unknown";
if (wlr_input_device_is_libinput(device->get_wlr_handle()))
{
if (auto libinput_handle = wlr_libinput_get_device_handle(device->get_wlr_handle()))
{
d["vendor"] = libinput_device_get_id_vendor(libinput_handle);
d["product"] = libinput_device_get_id_product(libinput_handle);
}
}

d["type"] = wlr_input_device_type_to_string(device->get_wlr_handle()->type);
d["enabled"] = device->is_enabled();
response.push_back(d);
}
Expand Down

0 comments on commit 56b9e51

Please sign in to comment.