aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 4398f518..e370443c 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -391,8 +391,6 @@ static bool view_has_executed_criteria(struct sway_view *view,
}
void view_execute_criteria(struct sway_view *view) {
- struct sway_seat *seat = input_manager_current_seat(input_manager);
- struct sway_node *prior_focus = seat_get_focus(seat);
list_t *criterias = criteria_for_view(view, CT_COMMAND);
for (int i = 0; i < criterias->length; i++) {
struct criteria *criteria = criterias->items[i];
@@ -403,16 +401,12 @@ void view_execute_criteria(struct sway_view *view) {
}
wlr_log(WLR_DEBUG, "for_window '%s' matches view %p, cmd: '%s'",
criteria->raw, view, criteria->cmdlist);
- seat_set_focus_container(seat, view->container);
list_add(view->executed_criteria, criteria);
- struct cmd_results *res = execute_command(criteria->cmdlist, NULL);
- if (res->status != CMD_SUCCESS) {
- wlr_log(WLR_ERROR, "Command '%s' failed: %s", res->input, res->error);
- }
+ struct cmd_results *res = execute_command(
+ criteria->cmdlist, NULL, view->container);
free_cmd_results(res);
}
list_free(criterias);
- seat_set_focus(seat, prior_focus);
}
static struct sway_workspace *select_workspace(struct sway_view *view) {
@@ -785,14 +779,9 @@ static size_t parse_title_format(struct sway_view *view, char *buffer) {
}
static char *escape_title(char *buffer) {
- int length = escape_markup_text(buffer, NULL, 0);
+ size_t length = escape_markup_text(buffer, NULL);
char *escaped_title = calloc(length + 1, sizeof(char));
- int result = escape_markup_text(buffer, escaped_title, length);
- if (result != length) {
- wlr_log(WLR_ERROR, "Could not escape title: %s", buffer);
- free(escaped_title);
- return buffer;
- }
+ escape_markup_text(buffer, escaped_title);
free(buffer);
return escaped_title;
}