// Set all others invisible
for (auto &i : this->controller->surfaces) {
auto &si = this->controller->sprops[i.second->id];
- if (si.visibility != 0 && int(si.id) != this->layers.main_surface) {
+ if (si.visibility != 0 &&
+ int(si.id) != this->layers.main_surface) {
this->deactivate(i.second->id);
}
}
// | .__/|_| \___/_/\_\_|\___|\__,_| |_____| \_/ \___|_| |_|\__|___/
// |_|
void App::surface_created(uint32_t surface_id) {
- //surface_id >>= id_allocator::id_shift;
-
logdebug("surface_id is %u", surface_id);
this->surface_init_layout(surface_id);
}
void App::surface_removed(uint32_t surface_id) {
- //surface_id >>= id_allocator::id_shift;
-
logdebug("surface_id is %u", surface_id);
this->id_alloc.remove_id(surface_id);
}
void App::activate(unsigned id) {
- this->controller->surfaces[id]->set_visibility(1);
- this->emit_activated(this->lookup_name(id).value_or("unknown-name").c_str());
+ if (this->controller->sprops[id].visibility == 0) {
+ this->controller->surfaces[id]->set_visibility(1);
+ this->emit_activated(
+ this->lookup_name(id).value_or("unknown-name").c_str());
+ }
}
void App::deactivate(unsigned id) {
- this->controller->surfaces[id]->set_visibility(0);
- this->emit_deactivated(this->lookup_name(id).value_or("unknown-name").c_str());
+ if (this->controller->sprops[id].visibility != 0) {
+ this->controller->surfaces[id]->set_visibility(0);
+ this->emit_deactivated(
+ this->lookup_name(id).value_or("unknown-name").c_str());
+ }
}
// _ _ _ _ _ _ _
logdebug("%s drawing_name %s", __func__, drawing_name);
auto r = this->app->activate_surface(drawing_name);
if (r != nullptr) {
+ logdebug("%s failed with error: %s", __func__, r);
return Err<json_object *>(r);
}
return Ok(json_object_new_object());
logdebug("%s drawing_name %s", __func__, drawing_name);
auto r = this->app->deactivate_surface(drawing_name);
if (r != nullptr) {
+ logdebug("%s failed with error: %s", __func__, r);
return Err<json_object *>(r);
}
return Ok(json_object_new_object());
return Ok(json_object_new_object());
}
-binding_api::result_type binding_api::demo_activate_surface(uint32_t s) {
- return Err<json_object *>("not implemented");
-}
-
-binding_api::result_type binding_api::demo_activate_all() {
- return Err<json_object *>("not implemented");
-}
-
// _ _ _ _ _
// ___ ___ _ __ | |_ _ __ ___ | | | ___ _ __ | |__ ___ ___ | | _____
// / __/ _ \| '_ \| __| '__/ _ \| | |/ _ \ '__|| '_ \ / _ \ / _ \| |/ / __|