+ /* add surface to layer for the application */
+
+ ilmErrorTypes result;
+ pid_t pid = surfaceProperties->creatorPid;
+
+ QMap<pid_t, t_ilm_layer>::const_iterator i = m_appLayers.find(pid);
+ if (i != m_appLayers.end()) {
+ t_ilm_layer layer_id = m_appLayers.value(pid);
+
+ result = ilm_layerAddSurface(layer_id, surface);
+
+ if (result != ILM_SUCCESS) {
+ qDebug("ilm_layerAddSurface(%d,%d) failed.", layer_id, surface);
+ }
+
+ /* Dirty hack! cut & paste from HomeScreen/src/layouthandler.cpp */
+ const int SCREEN_WIDTH = 1080;
+ const int SCREEN_HEIGHT = 1920;
+
+ const int TOPAREA_HEIGHT = 218;
+ const int TOPAREA_WIDTH = SCREEN_WIDTH;
+ const int TOPAREA_X = 0;
+ const int TOPAREA_Y = 0;
+ const int MEDIAAREA_HEIGHT = 215;
+ const int MEDIAAREA_WIDTH = SCREEN_WIDTH;
+ const int MEDIAAREA_X = 0;
+ const int MEDIAAREA_Y = SCREEN_HEIGHT - MEDIAAREA_HEIGHT;
+
+ ilm_surfaceSetDestinationRectangle(surface,
+ 0,
+ TOPAREA_HEIGHT,
+ SCREEN_WIDTH,
+ SCREEN_HEIGHT - TOPAREA_HEIGHT - MEDIAAREA_HEIGHT);
+
+ ilm_commitChanges();
+ } else {
+ qDebug("No layer for application(pid=%d)", surfaceProperties->creatorPid);
+ }