aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/focus.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-12-20 13:02:45 -0500
committerLibravatar emersion <contact@emersion.fr>2018-12-20 19:55:29 +0100
commit88d96bc41ff638bdc767e30bf6ccbbd530258420 (patch)
tree5d822da99812aab4e849e566c53d3a6ba87ba496 /sway/commands/focus.c
parentTerminate swaybg in output_disable (diff)
downloadsway-88d96bc41ff638bdc767e30bf6ccbbd530258420.tar.gz
sway-88d96bc41ff638bdc767e30bf6ccbbd530258420.tar.zst
sway-88d96bc41ff638bdc767e30bf6ccbbd530258420.zip
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/commands/focus.c')
-rw-r--r--sway/commands/focus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c
index 689edfec..97ffe91c 100644
--- a/sway/commands/focus.c
+++ b/sway/commands/focus.c
@@ -193,7 +193,7 @@ static struct cmd_results *focus_output(struct sway_seat *seat,
193 "Expected 'focus output <direction|name>'"); 193 "Expected 'focus output <direction|name>'");
194 } 194 }
195 char *identifier = join_args(argv, argc); 195 char *identifier = join_args(argv, argc);
196 struct sway_output *output = output_by_name(identifier); 196 struct sway_output *output = output_by_name_or_id(identifier);
197 197
198 if (!output) { 198 if (!output) {
199 enum wlr_direction direction; 199 enum wlr_direction direction;