aboutsummaryrefslogtreecommitdiff
path: root/backend/headless
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-04-02 12:41:19 +0200
committerDrew DeVault <sir@cmpwn.com>2020-04-08 16:31:21 +0200
commite04115898892129977a44e76aa39103a2bdd2144 (patch)
tree3b2616fabb0ac3e8f94587df034e8637661a6f2e /backend/headless
parent1fa9e0203b4192659a36ddd259c174569bc227d5 (diff)
output: introduce wlr_output_test
Diffstat (limited to 'backend/headless')
-rw-r--r--backend/headless/output.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/backend/headless/output.c b/backend/headless/output.c
index a2836159..326c9605 100644
--- a/backend/headless/output.c
+++ b/backend/headless/output.c
@@ -57,7 +57,7 @@ static bool output_attach_render(struct wlr_output *wlr_output,
buffer_age);
}
-static bool output_commit(struct wlr_output *wlr_output) {
+static bool output_test(struct wlr_output *wlr_output) {
if (wlr_output->pending.committed & WLR_OUTPUT_STATE_ENABLED) {
wlr_log(WLR_DEBUG, "Cannot disable a headless output");
return false;
@@ -65,6 +65,17 @@ static bool output_commit(struct wlr_output *wlr_output) {
if (wlr_output->pending.committed & WLR_OUTPUT_STATE_MODE) {
assert(wlr_output->pending.mode_type == WLR_OUTPUT_STATE_MODE_CUSTOM);
+ }
+
+ return true;
+}
+
+static bool output_commit(struct wlr_output *wlr_output) {
+ if (!output_test(wlr_output)) {
+ return false;
+ }
+
+ if (wlr_output->pending.committed & WLR_OUTPUT_STATE_MODE) {
if (!output_set_custom_mode(wlr_output,
wlr_output->pending.custom_mode.width,
wlr_output->pending.custom_mode.height,