Merge pull request #3768 from orestisfl/get_first_output
get_first_output changes
This commit is contained in:
commit
ac9e55caa5
|
@ -813,12 +813,13 @@ int main(int argc, char *argv[]) {
|
||||||
if (!output) {
|
if (!output) {
|
||||||
ELOG("ERROR: No screen at (%d, %d), starting on the first screen\n",
|
ELOG("ERROR: No screen at (%d, %d), starting on the first screen\n",
|
||||||
pointerreply->root_x, pointerreply->root_y);
|
pointerreply->root_x, pointerreply->root_y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!output) {
|
||||||
output = get_first_output();
|
output = get_first_output();
|
||||||
}
|
}
|
||||||
|
|
||||||
con_activate(con_descend_focused(output_get_content(output->con)));
|
con_activate(con_descend_focused(output_get_content(output->con)));
|
||||||
free(pointerreply);
|
free(pointerreply);
|
||||||
}
|
|
||||||
|
|
||||||
tree_render();
|
tree_render();
|
||||||
|
|
||||||
|
|
17
src/randr.c
17
src/randr.c
|
@ -70,11 +70,22 @@ Output *get_output_by_name(const char *name, const bool require_active) {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Output *get_first_output(void) {
|
Output *get_first_output(void) {
|
||||||
Output *output;
|
Output *output, *result = NULL;
|
||||||
|
|
||||||
TAILQ_FOREACH(output, &outputs, outputs)
|
TAILQ_FOREACH(output, &outputs, outputs) {
|
||||||
if (output->active)
|
if (output->active) {
|
||||||
|
if (output->primary) {
|
||||||
return output;
|
return output;
|
||||||
|
}
|
||||||
|
if (!result) {
|
||||||
|
result = output;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
die("No usable outputs available.\n");
|
die("No usable outputs available.\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue