summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
7a14533)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
}
char const *App::activate_surface(char const *drawing_name) {
}
char const *App::activate_surface(char const *drawing_name) {
auto const &surface_id = this->lookup_id(drawing_name);
if (!surface_id) {
auto const &surface_id = this->lookup_id(drawing_name);
if (!surface_id) {
return "Surface already active";
}
return "Surface already active";
}
+ // Special case main_surface
+ if (*surface_id == this->layers.main_surface) {
+ for (auto const &s: this->controller->surfaces) {
+ if (s.second->id != *surface_id) {
+ this->deactivate(s.second->id);
+ }
+ }
+ this->activate(*surface_id);
+ this->state.main = this->state.sub = -1;
+ this->state.s = LayoutState::Single;
+ // commit changes
+ this->controller->commit_changes();
+ this->display->flush();
+ return nullptr;
+ }
+
// This should involve a policy check, but as we do not (yet) have
// such a thing, we will just switch to this surface.
// XXX: input focus missing!!1
// This should involve a policy check, but as we do not (yet) have
// such a thing, we will just switch to this surface.
// XXX: input focus missing!!1
}
char const *App::deactivate_surface(char const *drawing_name) {
}
char const *App::deactivate_surface(char const *drawing_name) {
auto const &surface_id = this->lookup_id(drawing_name);
if (!surface_id) {
auto const &surface_id = this->lookup_id(drawing_name);
if (!surface_id) {
return "No surface active";
}
return "No surface active";
}
+ if (*surface_id == this->layers.main_surface) {
+ logdebug("Refusing to deactivate main_surface %d", *surface_id);
+ return nullptr;
+ }
+
if (this->state.main == *surface_id) {
if (this->state.sub != -1) {
this->emit_syncdraw(this->lookup_name(this->state.sub)->c_str());
if (this->state.main == *surface_id) {
if (this->state.sub != -1) {
this->emit_syncdraw(this->lookup_name(this->state.sub)->c_str());
// | .__/|_| \___/_/\_\_|\___|\__,_| |_____| \_/ \___|_| |_|\__|___/
// |_|
void App::surface_created(uint32_t surface_id) {
// | .__/|_| \___/_/\_\_|\___|\__,_| |_____| \_/ \___|_| |_|\__|___/
// |_|
void App::surface_created(uint32_t surface_id) {
- logdebug("surface_id is %u", 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);
- this->controller->layers[this->layers.get_layer_id(surface_id).value()]
+ this->controller->layers[*layer_id]
->add_surface(this->controller->surfaces[surface_id].get());
// activate the main_surface right away
->add_surface(this->controller->surfaces[surface_id].get());
// activate the main_surface right away
if (!rname) {
// name does not exist yet, allocate surface id...
auto id = int(this->id_alloc.generate_id(drawing_name));
if (!rname) {
// name does not exist yet, allocate surface id...
auto id = int(this->id_alloc.generate_id(drawing_name));
- this->layers.add_surface(id, lid.value());
+ this->layers.add_surface(id, *lid);
// XXX: we set the main_surface[_name] here and now,
// not sure if we want this, but it worked so far.
// XXX: we set the main_surface[_name] here and now,
// not sure if we want this, but it worked so far.