summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-16 22:27:11 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-16 22:27:11 +1000
commite2f28c023c8c5e9e847e2e9495a009b645bc60fc (patch)
treec380b85e10b4008218c43238e06abce8a296b8df
parentImplement no_focus command (diff)
downloadsway-e2f28c023c8c5e9e847e2e9495a009b645bc60fc.tar.gz
sway-e2f28c023c8c5e9e847e2e9495a009b645bc60fc.tar.zst
sway-e2f28c023c8c5e9e847e2e9495a009b645bc60fc.zip
Focus view before running criteria when mapping
-rw-r--r--sway/tree/view.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index bc66a701..10c97518 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -504,15 +504,13 @@ void view_execute_criteria(struct sway_view *view) {
504 } 504 }
505 wlr_log(WLR_DEBUG, "for_window '%s' matches view %p, cmd: '%s'", 505 wlr_log(WLR_DEBUG, "for_window '%s' matches view %p, cmd: '%s'",
506 criteria->raw, view, criteria->cmdlist); 506 criteria->raw, view, criteria->cmdlist);
507 seat_set_focus(seat, view->swayc);
507 list_add(view->executed_criteria, criteria); 508 list_add(view->executed_criteria, criteria);
508 struct cmd_results *res = execute_command(criteria->cmdlist, NULL); 509 struct cmd_results *res = execute_command(criteria->cmdlist, NULL);
509 if (res->status != CMD_SUCCESS) { 510 if (res->status != CMD_SUCCESS) {
510 wlr_log(WLR_ERROR, "Command '%s' failed: %s", res->input, res->error); 511 wlr_log(WLR_ERROR, "Command '%s' failed: %s", res->input, res->error);
511 } 512 }
512 free_cmd_results(res); 513 free_cmd_results(res);
513 // view must be focused for commands to affect it,
514 // so always refocus in-between command lists
515 seat_set_focus(seat, view->swayc);
516 } 514 }
517 list_free(criterias); 515 list_free(criterias);
518 seat_set_focus(seat, prior_focus); 516 seat_set_focus(seat, prior_focus);