mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-31 22:25:27 -04:00
fall back to a lower output mode if needed (swaywm/sway@4cdc4ac)
This commit is contained in:
parent
f44ba0cea2
commit
3321daef98
1 changed files with 19 additions and 3 deletions
22
output.c
22
output.c
|
|
@ -201,10 +201,26 @@ handle_new_output(struct wl_listener *listener, void *data)
|
||||||
output->frame.notify = handle_output_frame;
|
output->frame.notify = handle_output_frame;
|
||||||
wl_signal_add(&wlr_output->events.frame, &output->frame);
|
wl_signal_add(&wlr_output->events.frame, &output->frame);
|
||||||
|
|
||||||
struct wlr_output_mode *preferred_mode = wlr_output_preferred_mode(wlr_output);
|
if (!wl_list_empty(&wlr_output->modes)) {
|
||||||
if (preferred_mode) {
|
struct wlr_output_mode *preferred_mode = wlr_output_preferred_mode(wlr_output);
|
||||||
wlr_output_set_mode(wlr_output, preferred_mode);
|
if (preferred_mode) {
|
||||||
|
wlr_output_set_mode(wlr_output, preferred_mode);
|
||||||
|
}
|
||||||
|
if (!wlr_output_test(wlr_output)) {
|
||||||
|
struct wlr_output_mode *mode;
|
||||||
|
wl_list_for_each (mode, &wlr_output->modes, link) {
|
||||||
|
if (mode == preferred_mode) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
wlr_output_set_mode(wlr_output, mode);
|
||||||
|
if (wlr_output_test(wlr_output)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_output_set_transform(wlr_output, output->server->output_transform);
|
wlr_output_set_transform(wlr_output, output->server->output_transform);
|
||||||
|
|
||||||
if (server->output_mode == CAGE_MULTI_OUTPUT_MODE_LAST) {
|
if (server->output_mode == CAGE_MULTI_OUTPUT_MODE_LAST) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue