summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-30 14:45:28 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-04 16:54:00 +0200
commite30e5c0f8d3c118ac4e8120dd48cc76954b0a940 (patch)
tree11b40efcd3ce313a55d35d1f1dbcf38f44edf288 /src
parent844ab2cec795023439bd5f865a238c7841755af4 (diff)
wayland: honor output transformations
At least rotations by 90 and 270 degrees. Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r--src/wayland.cpp6
-rw-r--r--src/wayland.hpp1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/wayland.cpp b/src/wayland.cpp
index 672dab0..01ac275 100644
--- a/src/wayland.cpp
+++ b/src/wayland.cpp
@@ -136,6 +136,7 @@ void output::geometry(int32_t x, int32_t y, int32_t pw, int32_t ph,
logdebug(
"wl::output %s @ %p x %i y %i w %i h %i spel %x make %s model %s tx %i",
__func__, this->proxy.get(), x, y, pw, ph, subpel, make, model, tx);
+ this->transform = tx;
}
void output::mode(uint32_t flags, int32_t w, int32_t h, int32_t r) {
@@ -150,6 +151,11 @@ void output::mode(uint32_t flags, int32_t w, int32_t h, int32_t r) {
void output::done() {
logdebug("wl::output %s @ %p done", __func__, this->proxy.get());
+ // Let's just disregard the flipped ones...
+ if (this->transform == WL_OUTPUT_TRANSFORM_90 ||
+ this->transform == WL_OUTPUT_TRANSFORM_270) {
+ std::swap(this->width, this->height);
+ }
}
void output::scale(int32_t factor) {
diff --git a/src/wayland.hpp b/src/wayland.hpp
index d30c2f8..256553d 100644
--- a/src/wayland.hpp
+++ b/src/wayland.hpp
@@ -109,6 +109,7 @@ struct output : wayland_proxy<struct wl_output> {
int width{};
int height{};
int refresh{};
+ int transform{};
output(output const &) = delete;
output &operator=(output const &) = delete;