From 7b15d34f0af9b1c8ef49279827eee47e4dca9afa Mon Sep 17 00:00:00 2001 From: Maurice Kraus Date: Tue, 20 Feb 2024 20:20:08 +0100 Subject: [PATCH] core: add support for 90/270 degree rotated monitors (#26) --- src/core/Output.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/Output.cpp b/src/core/Output.cpp index cebdab3..1622ef0 100644 --- a/src/core/Output.cpp +++ b/src/core/Output.cpp @@ -11,7 +11,13 @@ static void handleGeometry(void* data, wl_output* output, int32_t x, int32_t y, static void handleMode(void* data, wl_output* output, uint32_t flags, int32_t width, int32_t height, int32_t refresh) { const auto POUTPUT = (COutput*)data; - POUTPUT->size = {width, height}; + + // handle portrait mode and flipped cases + if (POUTPUT->transform == WL_OUTPUT_TRANSFORM_270 || POUTPUT->transform == WL_OUTPUT_TRANSFORM_90 || + POUTPUT->transform == WL_OUTPUT_TRANSFORM_FLIPPED_270 || POUTPUT->transform == WL_OUTPUT_TRANSFORM_FLIPPED_90) + POUTPUT->size = {height, width}; + else + POUTPUT->size = {width, height}; } static void handleDone(void* data, wl_output* output) {