mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-11 13:29:45 -05:00
output: atomic mode, enabled, scale and transform
This commit makes more output properties (mode, enabled, scale and transform) atomic. This means that they are double-buffered and only applied on commit. Compositors now need to call wlr_output_commit after setting any of those properties. Internally, backends still apply properties sequentially. The behaviour should be exactly the same as before. Future commits will update some backends to take advantage of the atomic interface. Some backends are non-atomic by design, e.g. the X11 backend or the legacy DRM backend. Updates: https://github.com/swaywm/wlroots/issues/1640
This commit is contained in:
parent
d20aee6c9d
commit
ee5f98ad49
10 changed files with 291 additions and 114 deletions
|
|
@ -470,8 +470,10 @@ void handle_output_manager_apply(struct wl_listener *listener, void *data) {
|
|||
wl_list_for_each(config_head, &config->heads, link) {
|
||||
struct wlr_output *wlr_output = config_head->state.output;
|
||||
if (!config_head->state.enabled) {
|
||||
ok &= wlr_output_enable(wlr_output, false);
|
||||
wlr_output_enable(wlr_output, false);
|
||||
wlr_output_layout_remove(desktop->layout, wlr_output);
|
||||
|
||||
ok &= wlr_output_commit(wlr_output);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -481,11 +483,12 @@ void handle_output_manager_apply(struct wl_listener *listener, void *data) {
|
|||
if (!config_head->state.enabled) {
|
||||
continue;
|
||||
}
|
||||
ok &= wlr_output_enable(wlr_output, true);
|
||||
|
||||
wlr_output_enable(wlr_output, true);
|
||||
if (config_head->state.mode != NULL) {
|
||||
ok &= wlr_output_set_mode(wlr_output, config_head->state.mode);
|
||||
wlr_output_set_mode(wlr_output, config_head->state.mode);
|
||||
} else {
|
||||
ok &= wlr_output_set_custom_mode(wlr_output,
|
||||
wlr_output_set_custom_mode(wlr_output,
|
||||
config_head->state.custom_mode.width,
|
||||
config_head->state.custom_mode.height,
|
||||
config_head->state.custom_mode.refresh);
|
||||
|
|
@ -494,6 +497,8 @@ void handle_output_manager_apply(struct wl_listener *listener, void *data) {
|
|||
config_head->state.x, config_head->state.y);
|
||||
wlr_output_set_transform(wlr_output, config_head->state.transform);
|
||||
wlr_output_set_scale(wlr_output, config_head->state.scale);
|
||||
|
||||
ok &= wlr_output_commit(wlr_output);
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
|
|
@ -674,6 +679,7 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
wlr_output_layout_add_auto(desktop->layout, wlr_output);
|
||||
}
|
||||
wlr_output_commit(wlr_output);
|
||||
|
||||
struct roots_seat *seat;
|
||||
wl_list_for_each(seat, &input->seats, link) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue