From 0a98360c38431ccea2679955dd0e43af129d0256 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 27 Nov 2017 14:56:50 +0100 Subject: Draft: Allow XDG to be displayed. Change-Id: I962ae2f35ce8af6c4459982b4e8a1e25e9238252 Signed-off-by: Romain Forlot --- src/app.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/app.cpp') diff --git a/src/app.cpp b/src/app.cpp index 307217e..324825f 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -596,9 +596,22 @@ void App::api_ping() { this->dispatch_pending_events(); } void App::surface_created(uint32_t surface_id) { auto layer_id = this->layers.get_layer_id(surface_id); if (!layer_id) { - HMI_DEBUG("wm", "Newly created surfce %d is not associated with any layer!", + HMI_DEBUG("wm", "Newly created surface %d is not associated with any layer! Must be a XDG apps", surface_id); - return; + auto layer_id = this->layers.get_layer_id(XDG_DRAWING_NAME); + if(!layer_id) + { + HMI_DEBUG("wm", "No role found for that XDG App"); + return; + } + + this->layers.add_surface(surface_id, *layer_id); + // set the main_surface[_name] here and now + if (!this->layers.main_surface_name.empty() && + this->layers.main_surface_name == XDG_DRAWING_NAME) { + this->layers.main_surface = surface_id; + HMI_DEBUG("wm", "Set main_surface id to %u", surface_id); + } } HMI_DEBUG("wm", "surface_id is %u, layer_id is %u", surface_id, *layer_id); -- cgit 1.2.3-korg