From d24ea1e6627271edbf573025541dbac0e62bc043 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 20 Feb 2019 12:16:15 +1000 Subject: [PATCH] Drop the switchable-resolution device capability This capability is superfluous. If we have more than one resolution, we can switch between them because ... well, why have more than one then? Signed-off-by:Peter Hutterer --- ratbagd/ratbagd-device.c | 1 - src/driver-hidpp10.c | 1 - src/driver-hidpp20.c | 1 - src/driver-logitech-g300.c | 1 - src/driver-logitech-g600.c | 1 - src/libratbag-enums.h | 10 ---------- src/libratbag.c | 4 +--- tools/ratbagctl.in | 1 - tools/ratbagd.py | 1 - 9 files changed, 1 insertion(+), 20 deletions(-) diff --git a/ratbagd/ratbagd-device.c b/ratbagd/ratbagd-device.c index 194f2a16..b025b7f1 100644 --- a/ratbagd/ratbagd-device.c +++ b/ratbagd/ratbagd-device.c @@ -247,7 +247,6 @@ ratbagd_device_get_capabilities(sd_bus *bus, enum ratbag_device_capability caps[] = { RATBAG_DEVICE_CAP_QUERY_CONFIGURATION, RATBAG_DEVICE_CAP_RESOLUTION, - RATBAG_DEVICE_CAP_RESOLUTION_SWITCHABLE, RATBAG_DEVICE_CAP_PROFILE, RATBAG_DEVICE_CAP_PROFILE_SWITCHABLE, RATBAG_DEVICE_CAP_BUTTON, diff --git a/src/driver-hidpp10.c b/src/driver-hidpp10.c index be71e799..64d0712d 100644 --- a/src/driver-hidpp10.c +++ b/src/driver-hidpp10.c @@ -426,7 +426,6 @@ hidpp10drv_read_profile(struct ratbag_profile *profile) xres = 0xffff; ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION); - ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION_SWITCHABLE); ratbag_profile_for_each_resolution(profile, res) { unsigned int dpis[hidpp10->dpi_count]; diff --git a/src/driver-hidpp20.c b/src/driver-hidpp20.c index c19c79f5..f927cc9b 100644 --- a/src/driver-hidpp20.c +++ b/src/driver-hidpp20.c @@ -1097,7 +1097,6 @@ hidpp20drv_init_feature(struct ratbag_device *device, uint16_t feature) if (rc < 0) return 0; /* this is not a hard failure */ ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION); - ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION_SWITCHABLE); drv_data->capabilities |= HIDPP_CAP_SWITCHABLE_RESOLUTION_2201; break; } diff --git a/src/driver-logitech-g300.c b/src/driver-logitech-g300.c index c012d89c..4de4a9b8 100644 --- a/src/driver-logitech-g300.c +++ b/src/driver-logitech-g300.c @@ -499,7 +499,6 @@ logitech_g300_probe(struct ratbag_device *device) logitech_g300_read_profile(profile); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION); - ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION_SWITCHABLE); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE_SWITCHABLE); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON); diff --git a/src/driver-logitech-g600.c b/src/driver-logitech-g600.c index 1eb023fc..18a0c869 100644 --- a/src/driver-logitech-g600.c +++ b/src/driver-logitech-g600.c @@ -496,7 +496,6 @@ logitech_g600_probe(struct ratbag_device *device) logitech_g600_read_profile(profile); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION); - ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION_SWITCHABLE); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_PROFILE_SWITCHABLE); ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON); diff --git a/src/libratbag-enums.h b/src/libratbag-enums.h index cad4f6cd..0e5510dc 100644 --- a/src/libratbag-enums.h +++ b/src/libratbag-enums.h @@ -104,16 +104,6 @@ enum ratbag_device_capability { */ RATBAG_DEVICE_CAP_RESOLUTION = 100, - /** - * The device can change resolution, either software-controlled or - * by a hardware button. - * - * FIXME: what about devices that only have hw buttons? can we - * query that, even if we can't switch it ourselves? Maybe better to - * have a separate cap for that then. - */ - RATBAG_DEVICE_CAP_RESOLUTION_SWITCHABLE, - /** * The device provides read and/or write access to one or more * profiles. diff --git a/src/libratbag.c b/src/libratbag.c index 6709bda2..2d7cd052 100644 --- a/src/libratbag.c +++ b/src/libratbag.c @@ -728,10 +728,8 @@ ratbag_device_init_profiles(struct ratbag_device *device, ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON_KEY); } - if (num_resolutions > 1) { + if (num_resolutions > 1) ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION); - ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_RESOLUTION_SWITCHABLE); - } if (num_leds > 0) ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_LED); diff --git a/tools/ratbagctl.in b/tools/ratbagctl.in index 38f6a112..24b2b614 100755 --- a/tools/ratbagctl.in +++ b/tools/ratbagctl.in @@ -258,7 +258,6 @@ def print_device(d, level): caps = {RatbagdDevice.CAP_RESOLUTION: "resolution", RatbagdDevice.CAP_PROFILE: "profile", RatbagdDevice.CAP_BUTTON: "button", - RatbagdDevice.CAP_RESOLUTION_SWITCHABLE: "switchable-resolution", RatbagdDevice.CAP_PROFILE_SWITCHABLE: "switchable-profile", RatbagdDevice.CAP_BUTTON_KEY: "button-keys", RatbagdDevice.CAP_BUTTON_MACROS: "button-macros", diff --git a/tools/ratbagd.py b/tools/ratbagd.py index b64a59b9..36ed0b4c 100644 --- a/tools/ratbagd.py +++ b/tools/ratbagd.py @@ -320,7 +320,6 @@ class RatbagdDevice(_RatbagdDBus): CAP_NONE = 0 CAP_QUERY_CONFIGURATION = 1 CAP_RESOLUTION = 100 - CAP_RESOLUTION_SWITCHABLE = 101 CAP_PROFILE = 200 CAP_PROFILE_SWITCHABLE = 201 CAP_BUTTON = 300