mirror of
https://github.com/swaywm/sway.git
synced 2026-03-10 05:34:03 -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
88d96bc41f
8 changed files with 22 additions and 37 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue