From: Marcus Fritzsch Date: Thu, 3 Aug 2017 10:38:51 +0000 (+0200) Subject: app/api: add demo_activate_all() X-Git-Tag: 4.99.1~175 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=staging%2Fwindowmanager.git;a=commitdiff_plain;h=d41f142b48e7d38031be8339b15e377d5b264b0a app/api: add demo_activate_all() Signed-off-by: Marcus Fritzsch --- diff --git a/generate-binding-glue.py b/generate-binding-glue.py index 7aaad36..43bc742 100644 --- a/generate-binding-glue.py +++ b/generate-binding-glue.py @@ -108,6 +108,7 @@ API = { ], }, { 'name': 'demo_activate_surface', 'args': [ { 'name': 'surfaceid', 'type': 'uint32_t', 'jtype': 'int' } ] }, + { 'name': 'demo_activate_all' }, { 'name': 'debug_status', }, { 'name': 'debug_layers', }, { 'name': 'debug_surfaces', }, diff --git a/src/app.cpp b/src/app.cpp index 57d1b17..88ee0fa 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -330,15 +330,16 @@ char const *App::activate_surface(uint32_t surface_id) { // Make it visible, no (or little effect) if already visible auto &s = this->controller->surfaces[surface_id]; - s->set_visibility(1); // Set all others invisible for (auto &i: this->controller->surfaces) { auto &si = this->controller->sprops[i.second->id]; - if (si.visibility == 1 && si.id != s->id && int(si.id) != this->layers.main_surface) { + if (si.visibility == 1 && si.id != s->id && + int(si.id) != this->layers.main_surface) { i.second->set_visibility(0); } } + s->set_visibility(1); // commit changes this->controller->commit_changes(); @@ -438,6 +439,15 @@ binding_api::result_type binding_api::demo_activate_surface( return Ok(json_object_new_object()); } +binding_api::result_type binding_api::demo_activate_all() { + for (auto &s: this->app->controller->surfaces) { + s.second->set_visibility(1); + } + this->app->controller->commit_changes(); + this->app->display->flush(); + return Ok(json_object_new_object()); +} + // _ _ _ _ _ // ___ ___ _ __ | |_ _ __ ___ | | | ___ _ __ | |__ ___ ___ | | _____ // / __/ _ \| '_ \| __| '__/ _ \| | |/ _ \ '__|| '_ \ / _ \ / _ \| |/ / __|