mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
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.
This commit is contained in:
parent
477bca5e28
commit
198d11f0ef
8 changed files with 22 additions and 37 deletions
|
|
@ -193,7 +193,7 @@ static struct cmd_results *focus_output(struct sway_seat *seat,
|
|||
"Expected 'focus output <direction|name>'");
|
||||
}
|
||||
char *identifier = join_args(argv, argc);
|
||||
struct sway_output *output = output_by_name(identifier);
|
||||
struct sway_output *output = output_by_name_or_id(identifier);
|
||||
|
||||
if (!output) {
|
||||
enum wlr_direction direction;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue