Skip to content

Commit

Permalink
Add a new IntegratedIn=Remote flag
Browse files Browse the repository at this point in the history
In commit 2dd3501 ("Deprecate the WacomClass in the API")
libwacom_get_class() was deprecated. But that function remains the only
way to reliably identify the ExpressKey Remote as remote. This didn't
really matter since at least GNOME identifies that by PID/VID rather
than class.

Other vendors now make their own remotes (XP Pen ACK05, Huion Keypad
mini) so let's add an integration flag for those.
  • Loading branch information
whot committed Oct 21, 2024
1 parent 4a18fd2 commit 081e03a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/wacom-ek-remote.tablet
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ModelName=ACK-411050
DeviceMatch=usb|056a|0331
Layout=wacom-ek-remote.svg
Class=Remote
IntegratedIn=Remote

[Features]
Stylus=false
Expand Down
3 changes: 2 additions & 1 deletion libwacom/libwacom-database.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@ static const struct {
WacomIntegrationFlags value;
} integration_flags[] = {
{ "Display", WACOM_DEVICE_INTEGRATED_DISPLAY },
{ "System", WACOM_DEVICE_INTEGRATED_SYSTEM }
{ "System", WACOM_DEVICE_INTEGRATED_SYSTEM },
{ "Remote", WACOM_DEVICE_INTEGRATED_REMOTE }
};

static void
Expand Down
2 changes: 2 additions & 0 deletions libwacom/libwacom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,8 @@ static void print_integrated_flags_for_device (int fd, const WacomDevice *device
dprintf(fd, "Display;");
if (device->integration_flags & WACOM_DEVICE_INTEGRATED_SYSTEM)
dprintf(fd, "System;");
if (device->integration_flags & WACOM_DEVICE_INTEGRATED_REMOTE)
dprintf(fd, "Remote;");
dprintf(fd, "\n");
}

Expand Down
18 changes: 17 additions & 1 deletion libwacom/libwacom.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,24 @@ typedef enum {
*/
typedef enum {
WACOM_DEVICE_INTEGRATED_NONE = 0,
/**
* The device is integrated into a display
* like the Wacom Cintiq series.
*/
WACOM_DEVICE_INTEGRATED_DISPLAY = (1 << 0),
WACOM_DEVICE_INTEGRATED_SYSTEM = (1 << 1)
/**
* This flag is almost always used together
* with @ref WACOM_DEVICE_INTEGRATED_DISPLAY
* and indicates that the device is a built-in
* device such as a Wacom tablet in the screen
* of a laptop.
*/
WACOM_DEVICE_INTEGRATED_SYSTEM = (1 << 1),
/**
* The device is an external pad
* like the Wacom ExpressKey Remote.
*/
WACOM_DEVICE_INTEGRATED_REMOTE = (1 << 2),
} WacomIntegrationFlags;

/**
Expand Down

0 comments on commit 081e03a

Please sign in to comment.