aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-11-29 21:11:50 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-12-03 13:01:18 +0900
commita96fae7e99c2d13bc864d919cbdbcd68ba9cb841 (patch)
tree862543d37148e492b922a6c629a2a3be13480ab9
parent2b1bf85afe0a8b24f75386f7c24df85f9b785bd3 (diff)
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 <knimitz@witz-inc.co.jp>
-rw-r--r--src/window_manager.cpp3
-rw-r--r--src/wm_client.cpp5
-rw-r--r--src/wm_client.hpp1
3 files changed, 9 insertions, 0 deletions
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<int> 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<int>(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);