aboutsummaryrefslogtreecommitdiff
path: root/backend/x11
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-08-16 19:41:56 +0300
committerDrew DeVault <sir@cmpwn.com>2019-12-30 11:21:11 -0700
commit5d1ba0f44687f49cd28fcd8f69abac3cb0e07eb8 (patch)
treec4adad72451ca45b37163a5d8eddbdf6677caa6a /backend/x11
parente0e5a167ed4bf4be85e1db6565cf169c5c84d9ec (diff)
output: re-introduce atomic mode, enabled, scale and transform
This reverts commit 01f903874b7e27539488fad7f31476d5bcbc6ac9 and re-applies commit ee5f98ad49fed0439f3313ec685307831d1d1d05. Updates: https://github.com/swaywm/wlroots/issues/1640 (Atomic output updates issue) See also: https://github.com/swaywm/wlroots/pull/1762 (Atomic output updates original PR) See also: https://github.com/swaywm/wlroots/issues/1780 (Issue caused by atomic output updates) See also: https://github.com/swaywm/sway/issues/4419 (Issue caused by atomic output updates) See also: https://github.com/swaywm/wlroots/pull/1781 (Revert PR)
Diffstat (limited to 'backend/x11')
-rw-r--r--backend/x11/output.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/backend/x11/output.c b/backend/x11/output.c
index b6d00852..c827b9d5 100644
--- a/backend/x11/output.c
+++ b/backend/x11/output.c
@@ -103,21 +103,38 @@ static bool output_commit(struct wlr_output *wlr_output) {
struct wlr_x11_output *output = get_x11_output_from_output(wlr_output);
struct wlr_x11_backend *x11 = output->x11;
- pixman_region32_t *damage = NULL;
- if (wlr_output->pending.committed & WLR_OUTPUT_STATE_DAMAGE) {
- damage = &wlr_output->pending.damage;
+ if (wlr_output->pending.committed & WLR_OUTPUT_STATE_ENABLED) {
+ wlr_log(WLR_DEBUG, "Cannot disable an X11 output");
+ return false;
}
- if (!wlr_egl_swap_buffers(&x11->egl, output->surf, damage)) {
- return false;
+ if (wlr_output->pending.committed & WLR_OUTPUT_STATE_MODE) {
+ assert(wlr_output->pending.mode_type == WLR_OUTPUT_STATE_MODE_CUSTOM);
+ if (!output_set_custom_mode(wlr_output,
+ wlr_output->pending.custom_mode.width,
+ wlr_output->pending.custom_mode.height,
+ wlr_output->pending.custom_mode.refresh)) {
+ return false;
+ }
+ }
+
+ if (wlr_output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
+ pixman_region32_t *damage = NULL;
+ if (wlr_output->pending.committed & WLR_OUTPUT_STATE_DAMAGE) {
+ damage = &wlr_output->pending.damage;
+ }
+
+ if (!wlr_egl_swap_buffers(&x11->egl, output->surf, damage)) {
+ return false;
+ }
+
+ wlr_output_send_present(wlr_output, NULL);
}
- wlr_output_send_present(wlr_output, NULL);
return true;
}
static const struct wlr_output_impl output_impl = {
- .set_custom_mode = output_set_custom_mode,
.destroy = output_destroy,
.attach_render = output_attach_render,
.commit = output_commit,