aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app.cpp31
-rw-r--r--src/app.hpp1
-rw-r--r--src/main.cpp12
3 files changed, 12 insertions, 32 deletions
diff --git a/src/app.cpp b/src/app.cpp
index f83e3e7..f09f6f5 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -731,36 +731,11 @@ void App::surface_created(uint32_t surface_id)
this->controller->layers[*layer_id]->add_surface(surface_id);
this->layout_commit();
- // activate the main_surface right away
- /*if (surface_id == static_cast<unsigned>(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());
- }*/
}
void App::surface_removed(uint32_t surface_id)
{
HMI_DEBUG("wm", "surface_id is %u", surface_id);
-
- // We cannot normally deactivate the main_surface, so be explicit
- // about it:
- if (int(surface_id) == this->layers.main_surface)
- {
- this->deactivate_main_surface();
- }
- else
- {
- auto drawing_name = this->lookup_name(surface_id);
- if (drawing_name)
- {
- this->api_deactivate_surface(drawing_name->c_str(), [](const char *) {});
- }
- }
-
- this->id_alloc.remove_id(surface_id);
- this->layers.remove_surface(surface_id);
}
void App::emit_activated(char const *label)
@@ -1025,12 +1000,6 @@ void App::deactivate(int id)
}
}
-void App::deactivate_main_surface()
-{
- this->layers.main_surface = -1;
- this->api_deactivate_surface(this->layers.main_surface_name.c_str(), [](const char *) {});
-}
-
bool App::can_split(struct LayoutState const &state, int new_id)
{
if (state.main != -1 && state.main != new_id)
diff --git a/src/app.hpp b/src/app.hpp
index fc532d1..ab4e809 100644
--- a/src/app.hpp
+++ b/src/app.hpp
@@ -244,7 +244,6 @@ struct App
void activate(int id);
void deactivate(int id);
- void deactivate_main_surface();
bool can_split(struct LayoutState const &state, int new_id);
void try_layout(struct LayoutState &state,
diff --git a/src/main.cpp b/src/main.cpp
index 602e1f6..014c72e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -195,6 +195,18 @@ static void cbRemoveClientCtxt(void *data)
if (pSid)
{
auto sid = *pSid;
+ auto o_state = *g_afb_instance->app.layers.get_layout_state(sid);
+ if (o_state != nullptr)
+ {
+ if (o_state->main == sid)
+ {
+ o_state->main = -1;
+ }
+ else if (o_state->sub == sid)
+ {
+ o_state->sub = -1;
+ }
+ }
g_afb_instance->app.id_alloc.remove_id(sid);
g_afb_instance->app.layers.remove_surface(sid);
g_afb_instance->app.controller->sprops.erase(sid);