libratbag: Check for CAP_BUTTON_MACROS in ratbag_button_set_macro()

This commit is contained in:
Lyude
2016-10-13 13:57:32 -04:00
committed by Peter Hutterer
parent 1e2edefd93
commit 2bcacfc1ac

View File

@@ -1247,6 +1247,10 @@ ratbag_button_set_macro(struct ratbag_button *button,
{
int rc;
if (!ratbag_device_has_capability(button->profile->device,
RATBAG_DEVICE_CAP_BUTTON_MACROS))
return RATBAG_ERROR_CAPABILITY;
ratbag_button_copy_macro(button, macro);
rc = button->profile->device->driver->write_button(button, &button->action);