From 972c0f2fba84b6011328c685142172f51dd271a8 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 27 Nov 2017 18:34:05 +0100 Subject: Activate by default xdg apps Change-Id: I9acd2205d0cd171a82732e511493eb486dc34bb2 Signed-off-by: Romain Forlot --- src/app.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/app.cpp') diff --git a/src/app.cpp b/src/app.cpp index fcdda1f..ddb2182 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -607,10 +607,10 @@ void App::surface_created(uint32_t surface_id) { 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); + 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); } } @@ -619,13 +619,15 @@ void App::surface_created(uint32_t surface_id) { this->controller->layers[*layer_id]->add_surface( this->controller->surfaces[surface_id].get()); - // activate the main_surface right away - /*if (surface_id == static_cast(this->layers.main_surface)) { - HMI_DEBUG("wm", "Activating main_surface (%d)", surface_id); + if(this->layers.main_surface_name == XDG_DRAWING_NAME) { + // activate the main_surface right away + if (surface_id == static_cast(this->layers.main_surface)) { + HMI_DEBUG("wm", "Activating main_surface (%d)", surface_id); - this->api_activate_surface( - this->lookup_name(surface_id).value_or("unknown-name").c_str()); - }*/ + this->api_activate_surface( + this->lookup_name(surface_id).value_or("unknown-name").c_str()); + } + } } void App::surface_removed(uint32_t surface_id) { -- cgit 1.2.3-korg