From a29adaf9134756ed20ba2cb31be960facee9b5bb Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Sun, 29 Jul 2018 16:54:56 +0200 Subject: [PATCH] hidpp10: use profile name from device Tested on G9 --- src/driver-hidpp10.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/driver-hidpp10.c b/src/driver-hidpp10.c index 2f3cfa45..a2fca37f 100644 --- a/src/driver-hidpp10.c +++ b/src/driver-hidpp10.c @@ -407,8 +407,14 @@ hidpp10drv_read_profile(struct ratbag_profile *profile) if (rc) return; + ratbag_profile_set_cap(profile, RATBAG_PROFILE_CAP_WRITABLE_NAME); + profile->is_enabled = p.enabled; + if (profile->name) + free(profile->name); + profile->name = strdup_safe((char*)p.name); + rc = hidpp10_get_current_profile(hidpp10, &idx); if (rc == 0 && (unsigned int)idx == profile->index) profile->is_active = true; @@ -543,6 +549,7 @@ hidpp10drv_commit(struct ratbag_device *device) return rc; p.enabled = profile->is_enabled; + strncpy_safe((char*)p.name, profile->name, 24); ratbag_profile_for_each_resolution(profile, resolution) { p.dpi_modes[resolution->index].xres = resolution->dpi_x;