diff options
Diffstat (limited to 'rcm-server-main.c')
-rw-r--r-- | rcm-server-main.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/rcm-server-main.c b/rcm-server-main.c index 572d5c9..2a3266f 100644 --- a/rcm-server-main.c +++ b/rcm-server-main.c @@ -75,7 +75,7 @@ method_listkeymaps(sd_bus_message *m, void *userdata, sd_bus_error *error) list_for_each_entry(keymap, &dev->keymaps, list) { printf("Listing keymaps for %s: %s\n", dev->name, keymap->name); - r = sd_bus_message_append(reply, "s", keymap->name); + r = sd_bus_message_append(reply, "s", keymap->id); if (r < 0) goto out; } @@ -101,7 +101,7 @@ method_getkeymap(sd_bus_message *m, void *userdata, sd_bus_error *error) struct manager *mgr = userdata; struct device *dev; struct keymap *keymap; - const char *name; + const char *id; int r; unsigned i; @@ -111,13 +111,13 @@ method_getkeymap(sd_bus_message *m, void *userdata, sd_bus_error *error) return -EINVAL; } - r = sd_bus_message_read(m, "s", &name); + r = sd_bus_message_read(m, "s", &id); if (r < 0) { fprintf(stderr, "Failed to parse parameters: %s\n", strerror(-r)); return r; } - keymap = find_keymap_by_name(dev, name); + keymap = find_keymap_by_id(dev, id); if (!keymap) { sd_bus_error_set_const(error, "org.gnome.RemoteControlManager.InvalidKeymap", "Sorry, unknown keymap"); return -EINVAL; @@ -127,6 +127,14 @@ method_getkeymap(sd_bus_message *m, void *userdata, sd_bus_error *error) if (r < 0) goto out; + r = sd_bus_message_append(reply, "s", keymap->name); + if (r < 0) + goto out; + + r = sd_bus_message_append(reply, "s", keymap->description); + if (r < 0) + goto out; + r = sd_bus_message_append(reply, "q", keymap->cols); if (r < 0) goto out; @@ -190,7 +198,7 @@ static const sd_bus_vtable device_vtable[] = { SD_BUS_PROPERTY("KernelKeymapName", "s", property_get, 0, 0), SD_BUS_PROPERTY("HardwareType", "s", property_get, 0, 0), SD_BUS_METHOD("ListKeymaps", NULL, "as", method_listkeymaps, SD_BUS_VTABLE_UNPRIVILEGED), - SD_BUS_METHOD("GetKeymap", "s", "qqaa{sv}aa{sv}", method_getkeymap, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD("GetKeymap", "s", "ssqqaa{sv}aa{sv}", method_getkeymap, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_SIGNAL("KeyPressed", "s", 0), SD_BUS_SIGNAL("KeyReleased", "s", 0), SD_BUS_VTABLE_END |