diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-29 21:09:34 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-03-29 22:11:08 -0400 |
commit | f3fbf193127507e5ec5d23587c3e521ac2eb5891 (patch) | |
tree | 690ec43b681205b46f4c80f6d9f5ef4010c7b0a0 /sway | |
parent | Call arrange_windows on layer destroy (diff) | |
download | sway-f3fbf193127507e5ec5d23587c3e521ac2eb5891.tar.gz sway-f3fbf193127507e5ec5d23587c3e521ac2eb5891.tar.zst sway-f3fbf193127507e5ec5d23587c3e521ac2eb5891.zip |
Do some small cleanup
- Fix workspace events (security config isn't in use so it wasn't being
sent)
- Kill status bar process when swaybar exits
- Don't rearrange windows on every layer surface commit
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/layer_shell.c | 2 | ||||
-rw-r--r-- | sway/ipc-server.c | 23 |
2 files changed, 1 insertions, 24 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index d8ce0db1..a5cd79ba 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -204,8 +204,8 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) { | |||
204 | if (wlr_output != NULL) { | 204 | if (wlr_output != NULL) { |
205 | struct sway_output *output = wlr_output->data; | 205 | struct sway_output *output = wlr_output->data; |
206 | struct wlr_box old_geo = layer->geo; | 206 | struct wlr_box old_geo = layer->geo; |
207 | arrange_layers(output); | ||
208 | if (memcmp(&old_geo, &layer->geo, sizeof(struct wlr_box)) != 0) { | 207 | if (memcmp(&old_geo, &layer->geo, sizeof(struct wlr_box)) != 0) { |
208 | arrange_layers(output); | ||
209 | // TODO DAMAGE apply whole surface from previous and new geos | 209 | // TODO DAMAGE apply whole surface from previous and new geos |
210 | } else { | 210 | } else { |
211 | // TODO DAMAGE from surface damage | 211 | // TODO DAMAGE from surface damage |
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 59fc05f9..8250b3a0 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -242,33 +242,10 @@ int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { | |||
242 | } | 242 | } |
243 | 243 | ||
244 | static void ipc_send_event(const char *json_string, enum ipc_command_type event) { | 244 | static void ipc_send_event(const char *json_string, enum ipc_command_type event) { |
245 | static struct { | ||
246 | enum ipc_command_type event; | ||
247 | enum ipc_feature feature; | ||
248 | } security_mappings[] = { | ||
249 | { IPC_EVENT_WORKSPACE, IPC_FEATURE_EVENT_WORKSPACE }, | ||
250 | { IPC_EVENT_OUTPUT, IPC_FEATURE_EVENT_OUTPUT }, | ||
251 | { IPC_EVENT_MODE, IPC_FEATURE_EVENT_MODE }, | ||
252 | { IPC_EVENT_WINDOW, IPC_FEATURE_EVENT_WINDOW }, | ||
253 | { IPC_EVENT_BINDING, IPC_FEATURE_EVENT_BINDING }, | ||
254 | { IPC_EVENT_INPUT, IPC_FEATURE_EVENT_INPUT } | ||
255 | }; | ||
256 | |||
257 | uint32_t security_mask = 0; | ||
258 | for (size_t i = 0; i < sizeof(security_mappings) / sizeof(security_mappings[0]); ++i) { | ||
259 | if (security_mappings[i].event == event) { | ||
260 | security_mask = security_mappings[i].feature; | ||
261 | break; | ||
262 | } | ||
263 | } | ||
264 | |||
265 | int i; | 245 | int i; |
266 | struct ipc_client *client; | 246 | struct ipc_client *client; |
267 | for (i = 0; i < ipc_client_list->length; i++) { | 247 | for (i = 0; i < ipc_client_list->length; i++) { |
268 | client = ipc_client_list->items[i]; | 248 | client = ipc_client_list->items[i]; |
269 | if (!(client->security_policy & security_mask)) { | ||
270 | continue; | ||
271 | } | ||
272 | if ((client->subscribed_events & event_mask(event)) == 0) { | 249 | if ((client->subscribed_events & event_mask(event)) == 0) { |
273 | continue; | 250 | continue; |
274 | } | 251 | } |