Skip to content

Commit

Permalink
apps: daemon: Rename the virtual devices
Browse files Browse the repository at this point in the history
- Instead of naming them "IPTS xy" we call them "IPTSD xy" to clearly
  express that they come from this software.
- "Stylus" / "Touch" are now "Virtual Stylus" / "Virtual Touchscreen"
  to better communicate that these are not real devices.
- The vendor and product ID of the underlying device are added to the
  name. This is needed, because we are starting to get devices where
  both the touchscreen and the touchpad need to be driven by iptsd.
  • Loading branch information
StollD committed Feb 21, 2024
1 parent e49d55b commit d04fa91
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/apps/daemon/stylus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class StylusDevice {
public:
StylusDevice(const core::Config &config, const core::DeviceInfo &info)
{
m_uinput->set_name("IPTS Stylus");
m_uinput->set_name("Stylus");
m_uinput->set_vendor(info.vendor);
m_uinput->set_product(info.product);

Expand Down
2 changes: 1 addition & 1 deletion src/apps/daemon/touch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class TouchDevice {
public:
TouchDevice(const core::Config &config, const core::DeviceInfo &info) : m_config {config}
{
m_uinput->set_name("IPTS Touch");
m_uinput->set_name("Touchscreen");
m_uinput->set_vendor(info.vendor);
m_uinput->set_product(info.product);

Expand Down
5 changes: 4 additions & 1 deletion src/apps/daemon/uinput-device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,11 @@ class UinputDevice {
setup.id.product = m_product;
setup.id.version = m_version;

const std::string name =
fmt::format("IPTSD Virtual {} {:04X}:{:04X}", m_name, m_vendor, m_product);

// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
m_name.copy(setup.name, m_name.length(), 0);
name.copy(setup.name, name.length(), 0);

syscalls::ioctl(m_fd, UI_DEV_SETUP, &setup);
syscalls::ioctl(m_fd, UI_DEV_CREATE);
Expand Down

0 comments on commit d04fa91

Please sign in to comment.