summaryrefslogtreecommitdiff
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2017-12-20 11:56:39 -0500
committerGitHub <[email protected]>2017-12-20 11:56:39 -0500
commit373def44468e0c919031a6ffe3049f91680e05ca (patch)
treee40dfdcc9292a71fcc2160bc5d643a66996664dc /sway/ipc-server.c
parenta51e74beb91a98181d6bc69137d377cd49e72d1f (diff)
parent63f7fb95172a72436698a1562b4f7ea1e9100a7e (diff)
Merge pull request #1505 from acrisci/feature/input
input management and seat
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r--sway/ipc-server.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index b7cd2d76..046e40a8 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -20,6 +20,7 @@
#include "sway/ipc-json.h"
#include "sway/ipc-server.h"
#include "sway/server.h"
+#include "sway/input/input-manager.h"
#include "list.h"
#include "log.h"
@@ -359,6 +360,19 @@ void ipc_client_handle_command(struct ipc_client *client) {
goto exit_cleanup;
}
+ case IPC_GET_INPUTS:
+ {
+ json_object *inputs = json_object_new_array();
+ struct sway_input_device *device = NULL;
+ wl_list_for_each(device, &input_manager->devices, link) {
+ json_object_array_add(inputs, ipc_json_describe_input(device));
+ }
+ const char *json_string = json_object_to_json_string(inputs);
+ ipc_send_reply(client, json_string, (uint32_t)strlen(json_string));
+ json_object_put(inputs); // free
+ goto exit_cleanup;
+ }
+
case IPC_GET_TREE:
{
json_object *tree =