Skip to content

Commit

Permalink
core: add support for 90/270 degree rotated monitors (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricekraus authored Feb 20, 2024
1 parent a756d76 commit 7b15d34
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/Output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 7b15d34

Please sign in to comment.