aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-09-19 16:37:50 +0200
committerSimon Ser <contact@emersion.fr>2021-09-28 21:27:15 +0200
commit1bd8e3b4697b334309a8f26c9efd69010f191c2e (patch)
tree976641830aa5cf01482584967f2f312d63868a07
parent5fdc1c894d22a335a5f6897e9bb11ac1bb0b5027 (diff)
Add support for DRM panel orientation
References: https://github.com/swaywm/wlroots/pull/3205
-rw-r--r--sway/config/output.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sway/config/output.c b/sway/config/output.c
index 9fff79fd..8e937b28 100644
--- a/sway/config/output.c
+++ b/sway/config/output.c
@@ -406,9 +406,16 @@ static void queue_output_config(struct output_config *oc,
wlr_output_set_subpixel(wlr_output, oc->subpixel);
}
+ enum wl_output_transform tr = WL_OUTPUT_TRANSFORM_NORMAL;
if (oc && oc->transform >= 0) {
- sway_log(SWAY_DEBUG, "Set %s transform to %d", oc->name, oc->transform);
- wlr_output_set_transform(wlr_output, oc->transform);
+ tr = oc->transform;
+ } else if (wlr_output_is_drm(wlr_output)) {
+ tr = wlr_drm_connector_get_panel_orientation(wlr_output);
+ sway_log(SWAY_DEBUG, "Auto-detected output transform: %d", tr);
+ }
+ if (wlr_output->transform != tr) {
+ sway_log(SWAY_DEBUG, "Set %s transform to %d", oc->name, tr);
+ wlr_output_set_transform(wlr_output, tr);
}
// Apply the scale last before the commit, because the scale auto-detection