mirror of
https://github.com/swaywm/sway.git
synced 2024-11-29 11:21:28 +00:00
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
This commit is contained in:
parent
5f5076baff
commit
f3fbf19312
|
@ -204,8 +204,8 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) {
|
|||
if (wlr_output != NULL) {
|
||||
struct sway_output *output = wlr_output->data;
|
||||
struct wlr_box old_geo = layer->geo;
|
||||
arrange_layers(output);
|
||||
if (memcmp(&old_geo, &layer->geo, sizeof(struct wlr_box)) != 0) {
|
||||
arrange_layers(output);
|
||||
// TODO DAMAGE apply whole surface from previous and new geos
|
||||
} else {
|
||||
// TODO DAMAGE from surface damage
|
||||
|
|
|
@ -242,33 +242,10 @@ int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) {
|
|||
}
|
||||
|
||||
static void ipc_send_event(const char *json_string, enum ipc_command_type event) {
|
||||
static struct {
|
||||
enum ipc_command_type event;
|
||||
enum ipc_feature feature;
|
||||
} security_mappings[] = {
|
||||
{ IPC_EVENT_WORKSPACE, IPC_FEATURE_EVENT_WORKSPACE },
|
||||
{ IPC_EVENT_OUTPUT, IPC_FEATURE_EVENT_OUTPUT },
|
||||
{ IPC_EVENT_MODE, IPC_FEATURE_EVENT_MODE },
|
||||
{ IPC_EVENT_WINDOW, IPC_FEATURE_EVENT_WINDOW },
|
||||
{ IPC_EVENT_BINDING, IPC_FEATURE_EVENT_BINDING },
|
||||
{ IPC_EVENT_INPUT, IPC_FEATURE_EVENT_INPUT }
|
||||
};
|
||||
|
||||
uint32_t security_mask = 0;
|
||||
for (size_t i = 0; i < sizeof(security_mappings) / sizeof(security_mappings[0]); ++i) {
|
||||
if (security_mappings[i].event == event) {
|
||||
security_mask = security_mappings[i].feature;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int i;
|
||||
struct ipc_client *client;
|
||||
for (i = 0; i < ipc_client_list->length; i++) {
|
||||
client = ipc_client_list->items[i];
|
||||
if (!(client->security_policy & security_mask)) {
|
||||
continue;
|
||||
}
|
||||
if ((client->subscribed_events & event_mask(event)) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -76,5 +76,6 @@ struct status_line *status_line_init(char *cmd) {
|
|||
void status_line_free(struct status_line *status) {
|
||||
close(status->read_fd);
|
||||
close(status->write_fd);
|
||||
kill(status->pid, SIGTERM);
|
||||
free(status);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue