Add APIs which can get information of display and area
[apps/agl-service-windowmanager-2017.git] / src / wayland.cpp
index 4d6fc3d..9361b74 100644 (file)
@@ -148,6 +148,8 @@ void output::geometry(int32_t x, int32_t y, int32_t pw, int32_t ph,
    HMI_DEBUG("wm",
       "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->physical_width = pw;
+   this->physical_height = ph;
    this->transform = tx;
 }
 
@@ -163,10 +165,13 @@ void output::mode(uint32_t flags, int32_t w, int32_t h, int32_t r) {
 
 void output::done() {
    HMI_DEBUG("wm", "wl::output %s @ %p done", __func__, this->proxy.get());
-   // Let's just disregard the flipped ones...
+   // Pivot and flipped
    if (this->transform == WL_OUTPUT_TRANSFORM_90 ||
-       this->transform == WL_OUTPUT_TRANSFORM_270) {
+       this->transform == WL_OUTPUT_TRANSFORM_270 ||
+       this->transform == WL_OUTPUT_TRANSFORM_FLIPPED_90 ||
+       this->transform == WL_OUTPUT_TRANSFORM_FLIPPED_270) {
       std::swap(this->width, this->height);
+      std::swap(this->physical_width, this->physical_height);
    }
 }