Waiting for the surface of new app is created before setting the size
authorYuta Doi <yuta-d@witz-inc.co.jp>
Mon, 21 May 2018 05:10:05 +0000 (14:10 +0900)
committerYuta Doi <yuta-d@witz-inc.co.jp>
Mon, 21 May 2018 05:16:25 +0000 (14:16 +0900)
Change-Id: I7e60330739388b5b5dc339076f432e6ca77f12b4
Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
src/app.cpp

index eaebd59..7191727 100644 (file)
@@ -1100,6 +1100,12 @@ void App::setSurfaceSize(const char* role, const char* area) {
 
     // Set destination to the display rectangle
     int surface_id = this->role2surfaceid_[role];
+
+    if (!this->controller->surface_exists(surface_id)) {
+        // Block until all pending request are processed by wayland display server
+        // because waiting for the surface of new app is created
+        this->display->roundtrip();
+    }
     auto &s = this->controller->surfaces[surface_id];
     s->set_destination_rectangle(size.x, size.y, size.w, size.h);
     this->layout_commit();