Bug Fix : set source rectangle x, y is not 0
[apps/agl-service-windowmanager.git] / src / app.cpp
index c0130d2..debbcbd 100644 (file)
@@ -1387,7 +1387,15 @@ bool App::api_set_role(char const *appid, char const *drawing_name, unsigned pid
 
     const auto &o_layer = this->layers.get_layer(*lid);
     auto rect = o_layer.value().rect;
-    this->controller->surfaces[surface]->set_source_rectangle(rect.x, rect.y, rect.w, rect.h);
+    if(rect.w < 0)
+    {
+        rect.w = this->controller->output_size.w + 1 + rect.w;
+    }
+    if(rect.h < 0)
+    {
+        rect.h = this->controller->output_size.h + 1 + rect.h;
+    }
+    this->controller->surfaces[surface]->set_source_rectangle(0, 0, rect.w, rect.h);
 
     this->controller->layers[*lid]->add_surface(surface);
     this->layout_commit();