From a96fae7e99c2d13bc864d919cbdbcd68ba9cb841 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Thu, 29 Nov 2018 21:11:50 +0900 Subject: Fix timing issue of surface creation Rarely Window Manager get the event of surface creation after activateWindow. In that case, Window Manager reject application request because client doesn't have surface. This patch makes WM does provisional registration. Change-Id: Ib0a54a7f399f333175e0a4613364f7bcb0de9cc7 Signed-off-by: Kazumasa Mitsunari --- src/window_manager.cpp | 3 +++ src/wm_client.cpp | 5 +++++ src/wm_client.hpp | 1 + 3 files changed, 9 insertions(+) diff --git a/src/window_manager.cpp b/src/window_manager.cpp index cd7d2e5..5dc22be 100644 --- a/src/window_manager.cpp +++ b/src/window_manager.cpp @@ -187,6 +187,9 @@ result WindowManager::api_request_surface(char const *appid, char const *dr auto id = int(this->id_alloc.generate_id(role)); this->tmp_surface2app[id] = {str_id, lid}; + auto client = g_app_list.lookUpClient(str_id); + client->registerSurface(id); + return Ok(id); } diff --git a/src/wm_client.cpp b/src/wm_client.cpp index e7cb552..040c52b 100644 --- a/src/wm_client.cpp +++ b/src/wm_client.cpp @@ -111,6 +111,11 @@ unsigned WMClient::surfaceID() const return this->surface; } +void WMClient::registerSurface(unsigned surface) +{ + this->surface = surface; +} + /** * Add surface to the client * diff --git a/src/wm_client.hpp b/src/wm_client.hpp index 623d34f..9568324 100644 --- a/src/wm_client.hpp +++ b/src/wm_client.hpp @@ -51,6 +51,7 @@ class WMClient std::string role() const; unsigned layerID() const; unsigned surfaceID() const; + void registerSurface(unsigned surface); WMError addSurface(unsigned surface); bool removeSurfaceIfExist(unsigned surface); -- cgit 1.2.3-korg