summaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorBrian Ashworth <[email protected]>2018-12-20 13:02:45 -0500
committeremersion <[email protected]>2018-12-20 19:55:29 +0100
commit88d96bc41ff638bdc767e30bf6ccbbd530258420 (patch)
tree5d822da99812aab4e849e566c53d3a6ba87ba496 /sway/tree/view.c
parent477bca5e288cc3155c536265272490b413328778 (diff)
Combine output_by_name and output_by_identifier
This combines `output_by_name` and `output_by_identifier` into a single function called `output_by_name_or_id`. This allows for output identifiers to be used in all commands, simplifies the logic of the callers, and is more efficient since worst case is a single pass through the output list.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index e890f4f3..deb20676 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -459,7 +459,7 @@ static struct sway_workspace *select_workspace(struct sway_view *view) {
for (int i = 0; i < criterias->length; ++i) {
struct criteria *criteria = criterias->items[i];
if (criteria->type == CT_ASSIGN_OUTPUT) {
- struct sway_output *output = output_by_name(criteria->target);
+ struct sway_output *output = output_by_name_or_id(criteria->target);
if (output) {
ws = output_get_active_workspace(output);
break;