return "Surface does not exist in controller!";
}
- auto layer_id = *this->layers.get_layer_id(*surface_id);
- struct LayoutState &state = **this->layers.get_layout_state(*surface_id);
+ auto layer_id = this->layers.get_layer_id(*surface_id);
- logdebug("state @ %p = { %d, %d, %d }", &state, state.main, state.sub, state.s);
+ if (! layer_id) {
+ return "Surface is not on any layer!";
+ }
+
+ struct LayoutState &state = **this->layers.get_layout_state(*surface_id);
// disable layers that are above our current layer
for (auto const &l : this->layers.mapping) {
- if (l.layer_id <= layer_id) {
+ if (l.layer_id <= *layer_id) {
continue;
}
return nullptr;
}
- logdebug("state @ %p = { %d, %d, %d }", &state, state.main, state.sub, state.s);
-
if (state.main == *surface_id) {
if (state.sub != -1) {
this->emit_syncdraw(this->lookup_name(state.sub)->c_str());
// |_|
void App::surface_created(uint32_t surface_id) {
auto layer_id = this->layers.get_layer_id(surface_id);
- logdebug("surface_id is %u, layer_id is %u", surface_id, layer_id ? *layer_id : -1u);
+ if (! layer_id) {
+ logdebug("Newly created surfce %d is not associated with any layer!", surface_id);
+ return;
+ }
+
+ logdebug("surface_id is %u, layer_id is %u", surface_id, *layer_id);
this->controller->layers[*layer_id]
->add_surface(this->controller->surfaces[surface_id].get());
}
void App::emit_flushdraw(char const *label) {
- this->api.send_event("syncdraw", label);
+ this->api.send_event("flushdraw", label);
}
void App::emit_visible(char const *label, bool is_visible) {