mirror of
https://github.com/swaywm/sway.git
synced 2026-04-28 06:46:26 -04:00
Allow output identifier in move, focus, and assign
This allows output identifiers to be used with the following commands: - `move container|window to output` - `focus output` - `assign [criteria] output`
This commit is contained in:
parent
477bca5e28
commit
2ff86d013a
3 changed files with 11 additions and 1 deletions
|
|
@ -194,6 +194,9 @@ static struct cmd_results *focus_output(struct sway_seat *seat,
|
|||
}
|
||||
char *identifier = join_args(argv, argc);
|
||||
struct sway_output *output = output_by_name(identifier);
|
||||
if (!output) {
|
||||
output = output_by_identifier(identifier);
|
||||
}
|
||||
|
||||
if (!output) {
|
||||
enum wlr_direction direction;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,11 @@ static struct sway_output *output_in_direction(const char *direction_string,
|
|||
}
|
||||
}
|
||||
|
||||
return output_by_name(direction_string);
|
||||
struct sway_output *output = output_by_name(direction_string);
|
||||
if (!output) {
|
||||
output = output_by_identifier(direction_string);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
static bool is_parallel(enum sway_container_layout layout,
|
||||
|
|
|
|||
|
|
@ -460,6 +460,9 @@ static struct sway_workspace *select_workspace(struct sway_view *view) {
|
|||
struct criteria *criteria = criterias->items[i];
|
||||
if (criteria->type == CT_ASSIGN_OUTPUT) {
|
||||
struct sway_output *output = output_by_name(criteria->target);
|
||||
if (!output) {
|
||||
output = output_by_identifier(criteria->target);
|
||||
}
|
||||
if (output) {
|
||||
ws = output_get_active_workspace(output);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue