From 8e62d3497f82e0febf088538e54b1cdb927ee4aa Mon Sep 17 00:00:00 2001 From: Yuta Doi Date: Mon, 21 May 2018 14:10:05 +0900 Subject: Waiting for the surface of new app is created before setting the size Change-Id: I7e60330739388b5b5dc339076f432e6ca77f12b4 Signed-off-by: Yuta Doi --- src/app.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app.cpp b/src/app.cpp index eaebd59..7191727 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -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(); -- cgit 1.2.3-korg