const char kNameAreaFull[] = "full";
const char kNameAreaMain[] = "main";
const char kNameAreaSub[] = "sub";
+const char kNameAreaDefault[] = "normal.full";
/* Key for json obejct */
const char kKeyDrawingName[] = "drawing_name";
// This protocol needs the output, so lets just add our mapping here...
this->controller->add_proxy_to_id_mapping(
- this->outputs.back()->proxy.get(),
+ this->outputs.front()->proxy.get(),
wl_proxy_get_id(reinterpret_cast<struct wl_proxy *>(
- this->outputs.back()->proxy.get())));
+ this->outputs.front()->proxy.get())));
// Create screen
- this->controller->create_screen(this->outputs.back()->proxy.get());
+ this->controller->create_screen(this->outputs.front()->proxy.get());
// Set display to controller
this->controller->display = this->display;
*/
void WindowManager::surface_created(uint32_t surface_id)
{
+ this->controller->get_surface_properties(surface_id, IVI_WM_PARAM_SIZE);
+
auto layer_id = this->layers.get_layer_id(surface_id);
if (!layer_id)
{
this->processNextRequest();
}
+void WindowManager::onApplicationTerminated(const WMClientCtxt& ctxt)
+{
+ if(!g_app_list.contains(ctxt.name))
+ {
+ return;
+ }
+ struct LayoutState priv;
+ bool found = false;
+ auto client = g_app_list.lookUpClient(ctxt.name);
+ unsigned sid = client->surfaceID(ctxt.role);
+ if(sid == 0) {
+ auto pSid = this->id_alloc.lookup(ctxt.role.c_str());
+ if(pSid) {
+ sid = *pSid;
+ }
+ }
+ // reset state
+ if(sid != 0)
+ {
+ auto o_state = *this->layers.get_layout_state(sid);
+ if (o_state != nullptr)
+ {
+ priv = *o_state;
+ if (o_state->main == sid)
+ {
+ o_state->main = -1;
+ }
+ else if (o_state->sub == sid)
+ {
+ o_state->sub = -1;
+ }
+ }
+ this->id_alloc.remove_id(sid);
+ this->layers.remove_surface(sid);
+ HMI_INFO("wm", "delete surfaceID %d", sid);
+ }
+
+ // Recovery Phase
+ if(priv.main == sid)
+ {
+ HMI_DEBUG("wm", "go to launcher");
+ if(ctxt.role != "launcher")
+ {
+ // goto launcher
+ auto pSid = this->id_alloc.lookup("launcher");
+ std::string app = g_app_list.getAppID(*pSid, "launcher", &found);
+ if(found)
+ {
+ this->api_activate_surface(app.c_str(), "launcher", kNameAreaDefault,
+ [](const char*){});
+ }
+ }
+ }
+ else if(priv.main != sid && priv.sub != sid)
+ {
+ // re-show top surface
+ this->deactivate(priv.main);
+ this->activate(priv.main);
+ this->layout_commit();
+ }
+ else {}
+ g_app_list.removeClient(ctxt.name);
+}
+
/*
******* Private Functions *******
*/
layer_id);
// set destination to the display rectangle
- s->set_source_rectangle(0, 0, w, h);
- this->layout_commit();
s->set_destination_rectangle(x, y, w, h);
// update area information
HMI_SEQ_DEBUG(req_num, "visible %s", act.role.c_str());
//this->lm_enddraw(act.role.c_str());
}
+ this->layout_commit();
// Change current state
this->changeCurrentState(req_num);
*/
void controller_hooks::surface_created(uint32_t surface_id)
{
- this->app->surface_created(surface_id);
+ this->wmgr->surface_created(surface_id);
}
void controller_hooks::surface_removed(uint32_t surface_id)
{
- this->app->surface_removed(surface_id);
+ this->wmgr->surface_removed(surface_id);
}
void controller_hooks::surface_visibility(uint32_t /*surface_id*/,