diff options
-rw-r--r-- | include/ipc.h | 2 | ||||
-rw-r--r-- | include/sway/config.h | 9 | ||||
-rw-r--r-- | sway/config.c | 1 | ||||
-rw-r--r-- | sway/ipc-server.c | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/include/ipc.h b/include/ipc.h index 496625ce..98390335 100644 --- a/include/ipc.h +++ b/include/ipc.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _SWAY_IPC_H | 1 | #ifndef _SWAY_IPC_H |
2 | #define _SWAY_IPC_H | 2 | #define _SWAY_IPC_H |
3 | 3 | ||
4 | #define event_mask(ev) (1 << (ev & 0x7F)) | ||
5 | |||
4 | enum ipc_command_type { | 6 | enum ipc_command_type { |
5 | IPC_COMMAND = 0, | 7 | IPC_COMMAND = 0, |
6 | IPC_GET_WORKSPACES = 1, | 8 | IPC_GET_WORKSPACES = 1, |
diff --git a/include/sway/config.h b/include/sway/config.h index 14a86e49..1154b871 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -135,7 +135,7 @@ struct bar_config { | |||
135 | int height; // -1 not defined | 135 | int height; // -1 not defined |
136 | int tray_padding; | 136 | int tray_padding; |
137 | bool workspace_buttons; | 137 | bool workspace_buttons; |
138 | bool wrap_scroll; | 138 | bool wrap_scroll; |
139 | char *separator_symbol; | 139 | char *separator_symbol; |
140 | bool strip_workspace_numbers; | 140 | bool strip_workspace_numbers; |
141 | bool binding_mode_indicator; | 141 | bool binding_mode_indicator; |
@@ -191,7 +191,7 @@ enum command_context { | |||
191 | 191 | ||
192 | struct command_policy { | 192 | struct command_policy { |
193 | char *command; | 193 | char *command; |
194 | enum command_context context; | 194 | uint32_t context; |
195 | }; | 195 | }; |
196 | 196 | ||
197 | enum secure_feature { | 197 | enum secure_feature { |
@@ -206,7 +206,7 @@ enum secure_feature { | |||
206 | 206 | ||
207 | struct feature_policy { | 207 | struct feature_policy { |
208 | char *program; | 208 | char *program; |
209 | enum secure_feature features; | 209 | uint32_t features; |
210 | }; | 210 | }; |
211 | 211 | ||
212 | /** | 212 | /** |
@@ -228,7 +228,7 @@ struct sway_config { | |||
228 | uint32_t floating_mod; | 228 | uint32_t floating_mod; |
229 | uint32_t dragging_key; | 229 | uint32_t dragging_key; |
230 | uint32_t resizing_key; | 230 | uint32_t resizing_key; |
231 | char *floating_scroll_up_cmd; | 231 | char *floating_scroll_up_cmd; |
232 | char *floating_scroll_down_cmd; | 232 | char *floating_scroll_down_cmd; |
233 | char *floating_scroll_left_cmd; | 233 | char *floating_scroll_left_cmd; |
234 | char *floating_scroll_right_cmd; | 234 | char *floating_scroll_right_cmd; |
@@ -281,6 +281,7 @@ struct sway_config { | |||
281 | // Security | 281 | // Security |
282 | list_t *command_policies; | 282 | list_t *command_policies; |
283 | list_t *feature_policies; | 283 | list_t *feature_policies; |
284 | uint32_t ipc_policy; | ||
284 | }; | 285 | }; |
285 | 286 | ||
286 | void pid_workspace_add(struct pid_workspace *pw); | 287 | void pid_workspace_add(struct pid_workspace *pw); |
diff --git a/sway/config.c b/sway/config.c index e55c6dea..b1b0aac9 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -345,6 +345,7 @@ static void config_defaults(struct sway_config *config) { | |||
345 | // Security | 345 | // Security |
346 | config->command_policies = create_list(); | 346 | config->command_policies = create_list(); |
347 | config->feature_policies = create_list(); | 347 | config->feature_policies = create_list(); |
348 | config->ipc_policy = UINT32_MAX; | ||
348 | } | 349 | } |
349 | 350 | ||
350 | static int compare_modifiers(const void *left, const void *right) { | 351 | static int compare_modifiers(const void *left, const void *right) { |
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 0442a2f9..ef741e3b 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -55,8 +55,6 @@ bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t pay | |||
55 | void ipc_get_workspaces_callback(swayc_t *workspace, void *data); | 55 | void ipc_get_workspaces_callback(swayc_t *workspace, void *data); |
56 | void ipc_get_outputs_callback(swayc_t *container, void *data); | 56 | void ipc_get_outputs_callback(swayc_t *container, void *data); |
57 | 57 | ||
58 | #define event_mask(ev) (1 << (ev & 0x7F)) | ||
59 | |||
60 | void ipc_init(void) { | 58 | void ipc_init(void) { |
61 | ipc_socket = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); | 59 | ipc_socket = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); |
62 | if (ipc_socket == -1) { | 60 | if (ipc_socket == -1) { |