Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4084 from orestisfl/get_output_by_name_primary_ac…
Browse files Browse the repository at this point in the history
…tive

get_output_by_name: guard output->primary with require_active
  • Loading branch information
Airblader committed May 15, 2020
2 parents 4d92900 + 0fb56a9 commit 08052dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/randr.c
Expand Up @@ -51,12 +51,12 @@ Output *get_output_by_name(const char *name, const bool require_active) {
Output *output;
bool get_primary = (strcasecmp("primary", name) == 0);
TAILQ_FOREACH (output, &outputs, outputs) {
if (output->primary && get_primary) {
return output;
}
if (require_active && !output->active) {
continue;
}
if (output->primary && get_primary) {
return output;
}
struct output_name *output_name;
SLIST_FOREACH (output_name, &output->names_head, names) {
if (strcasecmp(output_name->name, name) == 0) {
Expand Down

0 comments on commit 08052dd

Please sign in to comment.