aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-02-20 06:48:33 -0500
committerDrew DeVault <sir@cmpwn.com>2017-02-20 06:48:33 -0500
commiteabfb6c5598d5b655b40d8677d97b58cce757ef5 (patch)
tree02075b877bb9a6751e492aa9c1cbe2d59491d3d1
parent1980a0835804b205da1fa00187640ae8a0c4f9be (diff)
downloadsway-eabfb6c5598d5b655b40d8677d97b58cce757ef5.zip
sway-eabfb6c5598d5b655b40d8677d97b58cce757ef5.tar.gz
sway-eabfb6c5598d5b655b40d8677d97b58cce757ef5.tar.bz2
Add * policies and fix bug
-rw-r--r--include/sway/config.h7
-rw-r--r--sway/commands.c2
-rw-r--r--sway/commands/ipc.c3
3 files changed, 11 insertions, 1 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index c3a916b..ba49b9a 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -224,7 +224,12 @@ enum ipc_feature {
IPC_FEATURE_EVENT_MODE = 1024,
IPC_FEATURE_EVENT_WINDOW = 2048,
IPC_FEATURE_EVENT_BINDING = 4096,
- IPC_FEATURE_EVENT_INPUT = 8192
+ IPC_FEATURE_EVENT_INPUT = 8192,
+
+ IPC_FEATURE_ALL_COMMANDS = 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128,
+ IPC_FEATURE_ALL_EVENTS = 256 | 512 | 1024 | 2048 | 4096 | 8192,
+
+ IPC_FEATURE_ALL = IPC_FEATURE_ALL_COMMANDS | IPC_FEATURE_ALL_EVENTS,
};
struct ipc_policy {
diff --git a/sway/commands.c b/sway/commands.c
index c15cb00..068e886 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -297,6 +297,7 @@ static struct cmd_handler bar_colors_handlers[] = {
};
static struct cmd_handler ipc_handlers[] = {
+ { "*", cmd_ipc_cmd },
{ "bar-config", cmd_ipc_cmd },
{ "command", cmd_ipc_cmd },
{ "events", cmd_ipc_events },
@@ -308,6 +309,7 @@ static struct cmd_handler ipc_handlers[] = {
};
static struct cmd_handler ipc_event_handlers[] = {
+ { "*", cmd_ipc_event_cmd },
{ "binding", cmd_ipc_event_cmd },
{ "input", cmd_ipc_event_cmd },
{ "mode", cmd_ipc_event_cmd },
diff --git a/sway/commands/ipc.c b/sway/commands/ipc.c
index 6b29706..d49aab6 100644
--- a/sway/commands/ipc.c
+++ b/sway/commands/ipc.c
@@ -32,6 +32,7 @@ struct cmd_results *cmd_ipc(int argc, char **argv) {
}
current_policy = alloc_ipc_policy(program);
+ list_add(config->ipc_policies, current_policy);
return cmd_results_new(CMD_BLOCK_IPC, NULL, NULL);
}
@@ -74,6 +75,7 @@ struct cmd_results *cmd_ipc_cmd(int argc, char **argv) {
char *name;
enum ipc_feature type;
} types[] = {
+ { "*", IPC_FEATURE_ALL_COMMANDS },
{ "command", IPC_FEATURE_COMMAND },
{ "workspaces", IPC_FEATURE_GET_WORKSPACES },
{ "outputs", IPC_FEATURE_GET_OUTPUTS },
@@ -123,6 +125,7 @@ struct cmd_results *cmd_ipc_event_cmd(int argc, char **argv) {
char *name;
enum ipc_feature type;
} types[] = {
+ { "*", IPC_FEATURE_ALL_EVENTS },
{ "workspace", IPC_FEATURE_EVENT_WORKSPACE },
{ "output", IPC_FEATURE_EVENT_OUTPUT },
{ "mode", IPC_FEATURE_EVENT_MODE },