2 * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "windowmanager.hpp"
20 //////////////////////////////////////////
21 // THIS IS STILL UNDER HEAVY DEVELOPMENT!
22 // DO NOT JUDGE THE SOURCE CODE :)
23 //////////////////////////////////////////
25 // three layers will be defined. The HomeScreen will be placed
26 // full screen in the background.
27 // On top all applications in one layer.
28 // On top of that, the popup layer.
29 #define WINDOWMANAGER_LAYER_POPUP 100
30 #define WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY 101
31 #define WINDOWMANAGER_LAYER_APPLICATIONS 102
32 #define WINDOWMANAGER_LAYER_HOMESCREEN 103
34 #define WINDOWMANAGER_LAYER_NUM 4
36 #define WINDOWMANAGER_LAYER_ID_SHIFT 22
38 // the HomeScreen app has to have the surface id 1000
39 #define WINDOWMANAGER_HOMESCREEN_MAIN_SURFACE_ID 1000
41 void* WindowManager::myThis = 0;
43 WindowManager::WindowManager(QObject *parent) :
47 mp_layoutAreaToSurfaceIdAssignment(0),
49 m_screenId(0), // use screen "0"
52 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
58 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
59 m_showLayers = new t_ilm_layer[WINDOWMANAGER_LAYER_NUM];
61 m_showLayers[0] = 0; /* POPUP is not shown by default */
62 m_showLayers[1] = 0; /* HOMESCREEN_OVERLAY is not shown by default */
63 m_showLayers[2] = 0; /* APPLICATIONS is not shown by default */
64 m_showLayers[3] = WINDOWMANAGER_LAYER_HOMESCREEN; /* HOMESCREEN is shwon by default */
67 qDebug("-=[WindowManager]=-");
70 void WindowManager::start()
72 qDebug("-=[start]=-");
73 mp_layoutAreaToSurfaceIdAssignment = new QMap<int, unsigned int>;
74 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
78 qDebug("ilm_init = %d", err);
79 if(ILM_SUCCESS != err)
81 qDebug("failed! Exiting!");
87 ilm_getScreenResolution(m_screenId, &m_screenWidth, &m_screenHeight);
89 createNewLayer(WINDOWMANAGER_LAYER_POPUP);
90 createNewLayer(WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY);
91 // createNewLayer(WINDOWMANAGER_LAYER_APPLICATIONS);
92 createNewLayer(WINDOWMANAGER_LAYER_HOMESCREEN);
94 ilm_registerNotification(WindowManager::notificationFunc_static, this);
97 QDBusConnection dbus = QDBusConnection::sessionBus();
98 dbus.registerObject("/windowmanager", this);
99 dbus.registerService("org.agl.windowmanager");
101 // publish windowmanager interface
102 mp_windowManagerAdaptor = new WindowmanagerAdaptor((QObject*)this);
105 WindowManager::~WindowManager()
107 qDebug("-=[~WindowManager]=-");
108 delete mp_windowManagerAdaptor;
109 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
112 delete mp_layoutAreaToSurfaceIdAssignment;
115 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
116 int WindowManager::getLayerRenderOrder(t_ilm_layer id_array[])
120 for (i = WINDOWMANAGER_LAYER_NUM - 1, j = 0; i >= 0; i--, j++) {
121 if (m_showLayers[i] != 0) {
122 id_array[j] = m_showLayers[i];
130 void WindowManager::dumpScene()
133 qDebug("current layout : %d", m_currentLayout);
134 qDebug("available layouts: %d", m_layouts.size());
135 QList<Layout>::const_iterator i = m_layouts.begin();
137 while (i != m_layouts.constEnd())
139 qDebug("--[id: %d]--[%s]--", i->id, i->name.toStdString().c_str());
140 qDebug(" %d surface areas", i->layoutAreas.size());
141 for (int j = 0; j < i->layoutAreas.size(); ++j)
143 qDebug(" -area %d", j);
144 qDebug(" -x : %d", i->layoutAreas.at(j).x);
145 qDebug(" -y : %d", i->layoutAreas.at(j).y);
146 qDebug(" -width : %d", i->layoutAreas.at(j).width);
147 qDebug(" -height: %d", i->layoutAreas.at(j).height);
154 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
156 void WindowManager::createNewLayer(int layerId)
158 qDebug("-=[createNewLayer]=-");
159 qDebug(" layerId %d", layerId);
161 t_ilm_layer newLayerId = layerId;
162 ilm_layerCreateWithDimension(&newLayerId, m_screenWidth, m_screenHeight);
163 ilm_layerSetOpacity(newLayerId, 1.0);
164 ilm_layerSetVisibility(newLayerId, ILM_TRUE);
165 ilm_layerSetSourceRectangle(newLayerId,
170 ilm_layerSetDestinationRectangle(newLayerId,
179 t_ilm_layer WindowManager::getAppLayerID(pid_t pid)
181 t_ilm_layer layer_id;
183 // layer_id = pid + (WINDOWMANAGER_LAYER_APPLICATIONS << WINDOWMANAGER_LAYER_ID_SHIFT);
184 layer_id = pid + (WINDOWMANAGER_LAYER_APPLICATIONS * 100000); /* for debug */
189 void WindowManager::addSurfaceToAppLayer(int surfaceId)
191 struct ilmSurfaceProperties surfaceProperties;
192 t_ilm_layer layer_id;
196 qDebug("-=[addSurfaceToAppLayer]=-");
197 qDebug(" surfaceId %d", surfaceId);
199 ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties);
200 pid = surfaceProperties.creatorPid;
204 qDebug("addSurfaceToAppLayer(%d) got pid == -1", surfaceId);
208 QMap<pid_t, t_ilm_layer>::const_iterator i = m_appLayers.find(pid);
209 if (i == m_appLayers.end()) {
210 qDebug("No layer found, create new for app(pid=%d)", pid);
212 /* not found, create new one */
213 t_ilm_layer layer_id = getAppLayerID(pid);
215 createNewLayer(layer_id);
216 m_appLayers.insert(pid, layer_id);
220 void WindowManager::addSurfaceToLayer(int surfaceId, int layerId)
222 qDebug("-=[addSurfaceToLayer]=-");
223 qDebug(" surfaceId %d", surfaceId);
224 qDebug(" layerId %d", layerId);
226 if (layerId == WINDOWMANAGER_LAYER_HOMESCREEN)
228 struct ilmSurfaceProperties surfaceProperties;
229 ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties);
231 // homescreen app always fullscreen in the back
232 ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, m_screenWidth, m_screenHeight);
233 //ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, m_screenWidth, m_screenHeight);
234 ilm_surfaceSetOpacity(surfaceId, 1.0);
235 ilm_surfaceSetVisibility(surfaceId, ILM_TRUE);
237 ilm_layerAddSurface(layerId, surfaceId);
240 if (layerId == WINDOWMANAGER_LAYER_APPLICATIONS)
242 struct ilmSurfaceProperties surfaceProperties;
243 ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties);
245 //ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
246 //ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
247 //ilm_surfaceSetOpacity(surfaceId, 0.0);
248 //ilm_surfaceSetVisibility(surfaceId, ILM_FALSE);
250 ilm_layerAddSurface(layerId, surfaceId);
253 if (layerId == WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY)
255 struct ilmSurfaceProperties surfaceProperties;
256 ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties);
258 //ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
259 //ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
260 //ilm_surfaceSetOpacity(surfaceId, 0.5);
261 //ilm_surfaceSetVisibility(surfaceId, ILM_TRUE);
263 ilm_layerAddSurface(layerId, surfaceId);
266 if (layerId == WINDOWMANAGER_LAYER_POPUP)
268 struct ilmSurfaceProperties surfaceProperties;
269 ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties);
271 //ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
272 //ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
273 //ilm_surfaceSetOpacity(surfaceId, 0.0);
274 //ilm_surfaceSetVisibility(surfaceId, ILM_FALSE);
276 ilm_layerAddSurface(layerId, surfaceId);
284 void WindowManager::updateScreen()
286 qDebug("-=[updateScreen]=-");
289 //#ifdef HAVE_IVI_LAYERMANAGEMENT_API
290 if (-1 != m_currentLayout)
293 for (int i = 0; i < m_appSurfaces.size(); ++i)
295 ilm_layerRemoveSurface(WINDOWMANAGER_LAYER_APPLICATIONS, m_appSurfaces.at(i));
296 //ilm_surfaceSetVisibility(m_appSurfaces.at(i), ILM_FALSE);
297 //ilm_surfaceSetOpacity(m_appSurfaces.at(i), 0.0);
301 // find the current used layout
302 QList<Layout>::const_iterator ci = m_layouts.begin();
304 Layout currentLayout;
305 while (ci != m_layouts.constEnd())
307 if (ci->id == m_currentLayout)
315 qDebug("show %d apps", mp_layoutAreaToSurfaceIdAssignment->size());
316 for (int j = 0; j < mp_layoutAreaToSurfaceIdAssignment->size(); ++j)
318 int surfaceToShow = mp_layoutAreaToSurfaceIdAssignment->find(j).value();
319 qDebug(" surface no. %d: %d", j, surfaceToShow);
321 addSurfaceToLayer(surfaceToShow, WINDOWMANAGER_LAYER_APPLICATIONS);
323 ilm_surfaceSetVisibility(surfaceToShow, ILM_TRUE);
324 ilm_surfaceSetOpacity(surfaceToShow, 1.0);
326 qDebug(" layout area %d", j);
327 qDebug(" x: %d", currentLayout.layoutAreas[j].x);
328 qDebug(" y: %d", currentLayout.layoutAreas[j].y);
329 qDebug(" w: %d", currentLayout.layoutAreas[j].width);
330 qDebug(" h: %d", currentLayout.layoutAreas[j].height);
332 ilm_surfaceSetDestinationRectangle(surfaceToShow,
333 currentLayout.layoutAreas[j].x,
334 currentLayout.layoutAreas[j].y,
335 currentLayout.layoutAreas[j].width,
336 currentLayout.layoutAreas[j].height);
341 // layer surface render order
343 t_ilm_surface* pArray;
344 ilm_getSurfaceIDsOnLayer(WINDOWMANAGER_LAYER_HOMESCREEN, &length, &pArray);
345 ilm_layerSetRenderOrder(WINDOWMANAGER_LAYER_HOMESCREEN, pArray, length);
347 ilm_getSurfaceIDsOnLayer(WINDOWMANAGER_LAYER_APPLICATIONS, &length, &pArray);
348 ilm_layerSetRenderOrder(WINDOWMANAGER_LAYER_APPLICATIONS, pArray, length);
350 ilm_getSurfaceIDsOnLayer(WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY, &length, &pArray);
351 ilm_layerSetRenderOrder(WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY, pArray, length);
353 ilm_getSurfaceIDsOnLayer(WINDOWMANAGER_LAYER_POPUP, &length, &pArray);
354 ilm_layerSetRenderOrder(WINDOWMANAGER_LAYER_POPUP, pArray, length);
357 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
358 if (m_pending_to_show != -1) {
359 showAppLayer(m_pending_to_show);
361 // display layer render order
362 t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
363 int num_layers = getLayerRenderOrder(renderOrder);
364 ilm_displaySetRenderOrder(m_screenId, renderOrder, num_layers);
370 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
371 void WindowManager::notificationFunc_non_static(ilmObjectType object,
375 qDebug("-=[notificationFunc_non_static]=-");
376 qDebug("Notification from weston!");
377 if (ILM_SURFACE == object)
379 struct ilmSurfaceProperties surfaceProperties;
383 qDebug("Surface created, ID: %d", id);
384 ilm_getPropertiesOfSurface(id, &surfaceProperties);
385 qDebug(" origSourceWidth : %d", surfaceProperties.origSourceWidth);
386 qDebug(" origSourceHeight: %d", surfaceProperties.origSourceHeight);
388 if (WINDOWMANAGER_HOMESCREEN_MAIN_SURFACE_ID == id)
390 qDebug("HomeScreen app detected");
391 addSurfaceToLayer(id, WINDOWMANAGER_LAYER_HOMESCREEN);
396 addSurfaceToAppLayer(id);
397 //addSurfaceToLayer(id, WINDOWMANAGER_LAYER_APPLICATIONS);
398 //m_appSurfaces.append(id);
400 ilm_surfaceAddNotification(id, surfaceCallbackFunction_static);
406 qDebug("Surface destroyed, ID: %d", id);
408 m_appSurfaces.removeAt(m_appSurfaces.indexOf(id));
409 ilm_surfaceRemoveNotification(id);
415 if (ILM_LAYER == object)
417 //qDebug("Layer.. we don't care...");
421 void WindowManager::notificationFunc_static(ilmObjectType object,
426 static_cast<WindowManager*>(WindowManager::myThis)->notificationFunc_non_static(object, id, created);
429 void WindowManager::surfaceCallbackFunction_non_static(t_ilm_surface surface,
430 struct ilmSurfaceProperties* surfaceProperties,
431 t_ilm_notification_mask mask)
433 qDebug("-=[surfaceCallbackFunction_non_static]=-");
434 qDebug("surfaceCallbackFunction_non_static changes for surface %d", surface);
435 if (ILM_NOTIFICATION_VISIBILITY & mask)
437 qDebug("ILM_NOTIFICATION_VISIBILITY");
438 surfaceVisibilityChanged(surface, surfaceProperties->visibility);
440 if (ILM_NOTIFICATION_OPACITY & mask)
442 qDebug("ILM_NOTIFICATION_OPACITY");
444 if (ILM_NOTIFICATION_ORIENTATION & mask)
446 qDebug("ILM_NOTIFICATION_ORIENTATION");
448 if (ILM_NOTIFICATION_SOURCE_RECT & mask)
450 qDebug("ILM_NOTIFICATION_SOURCE_RECT");
452 if (ILM_NOTIFICATION_DEST_RECT & mask)
454 qDebug("ILM_NOTIFICATION_DEST_RECT");
456 if (ILM_NOTIFICATION_CONTENT_AVAILABLE & mask)
458 qDebug("ILM_NOTIFICATION_CONTENT_AVAILABLE");
459 /* add surface to layer for the application */
461 ilmErrorTypes result;
462 pid_t pid = surfaceProperties->creatorPid;
464 QMap<pid_t, t_ilm_layer>::const_iterator i = m_appLayers.find(pid);
465 if (i != m_appLayers.end()) {
466 t_ilm_layer layer_id = m_appLayers.value(pid);
468 result = ilm_layerAddSurface(layer_id, surface);
470 if (result != ILM_SUCCESS) {
471 qDebug("ilm_layerAddSurface(%d,%d) failed.", layer_id, surface);
474 /* Dirty hack! cut & paste from HomeScreen/src/layouthandler.cpp */
475 const int SCREEN_WIDTH = 1080;
476 const int SCREEN_HEIGHT = 1920;
478 const int TOPAREA_HEIGHT = 218;
479 const int TOPAREA_WIDTH = SCREEN_WIDTH;
480 const int TOPAREA_X = 0;
481 const int TOPAREA_Y = 0;
482 const int MEDIAAREA_HEIGHT = 215;
483 const int MEDIAAREA_WIDTH = SCREEN_WIDTH;
484 const int MEDIAAREA_X = 0;
485 const int MEDIAAREA_Y = SCREEN_HEIGHT - MEDIAAREA_HEIGHT;
487 ilm_surfaceSetDestinationRectangle(surface,
491 SCREEN_HEIGHT - TOPAREA_HEIGHT - MEDIAAREA_HEIGHT);
495 qDebug("No layer for application(pid=%d)", surfaceProperties->creatorPid);
498 if (ILM_NOTIFICATION_CONTENT_REMOVED & mask)
500 qDebug("ILM_NOTIFICATION_CONTENT_REMOVED");
502 /* application being down */
503 m_appLayers.remove(surfaceProperties->creatorPid);
507 if (ILM_NOTIFICATION_CONFIGURED & mask)
509 qDebug("ILM_NOTIFICATION_CONFIGURED");
510 qDebug(" surfaceProperties %d", surface);
511 qDebug(" surfaceProperties.origSourceWidth: %d", surfaceProperties->origSourceWidth);
512 qDebug(" surfaceProperties.origSourceHeight: %d", surfaceProperties->origSourceHeight);
514 ilm_surfaceSetSourceRectangle(surface,
517 surfaceProperties->origSourceWidth,
518 surfaceProperties->origSourceHeight);
520 ilm_surfaceSetVisibility(surface, ILM_TRUE);
526 void WindowManager::surfaceCallbackFunction_static(t_ilm_surface surface,
527 struct ilmSurfaceProperties* surfaceProperties,
528 t_ilm_notification_mask mask)
531 static_cast<WindowManager*>(WindowManager::myThis)->surfaceCallbackFunction_non_static(surface, surfaceProperties, mask);
535 int WindowManager::layoutId() const
537 return m_currentLayout;
540 QString WindowManager::layoutName() const
542 QList<Layout>::const_iterator i = m_layouts.begin();
544 QString result = "not found";
545 while (i != m_layouts.constEnd())
547 if (i->id == m_currentLayout)
559 int WindowManager::addLayout(int layoutId, const QString &layoutName, const QList<LayoutArea> &surfaceAreas)
561 qDebug("-=[addLayout]=-");
562 m_layouts.append(Layout(layoutId, layoutName, surfaceAreas));
564 qDebug("addLayout %d %s, size %d",
566 layoutName.toStdString().c_str(),
567 surfaceAreas.size());
571 return WINDOWMANAGER_NO_ERROR;
574 int WindowManager::deleteLayoutById(int layoutId)
576 qDebug("-=[deleteLayoutById]=-");
577 qDebug("layoutId: %d", layoutId);
578 int result = WINDOWMANAGER_NO_ERROR;
580 if (m_currentLayout == layoutId)
582 result = WINDOWMANAGER_ERROR_ID_IN_USE;
586 QList<Layout>::iterator i = m_layouts.begin();
587 result = WINDOWMANAGER_ERROR_ID_IN_USE;
588 while (i != m_layouts.constEnd())
590 if (i->id == layoutId)
593 result = WINDOWMANAGER_NO_ERROR;
605 QList<Layout> WindowManager::getAllLayouts()
607 qDebug("-=[getAllLayouts]=-");
613 QList<int> WindowManager::getAllSurfacesOfProcess(int pid)
616 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
617 struct ilmSurfaceProperties surfaceProperties;
619 for (int i = 0; i < m_appSurfaces.size(); ++i)
621 ilm_getPropertiesOfSurface(m_appSurfaces.at(i), &surfaceProperties);
622 if (pid == surfaceProperties.creatorPid)
624 result.append(m_appSurfaces.at(i));
632 QList<int> WindowManager::getAvailableLayouts(int numberOfAppSurfaces)
634 qDebug("-=[getAvailableLayouts]=-");
635 QList<Layout>::const_iterator i = m_layouts.begin();
638 while (i != m_layouts.constEnd())
640 if (i->layoutAreas.size() == numberOfAppSurfaces)
642 result.append(i->id);
652 QList<int> WindowManager::getAvailableSurfaces()
654 qDebug("-=[getAvailableSurfaces]=-");
656 return m_appSurfaces;
660 QString WindowManager::getLayoutName(int layoutId)
662 qDebug("-=[getLayoutName]=-");
663 QList<Layout>::const_iterator i = m_layouts.begin();
665 QString result = "not found";
666 while (i != m_layouts.constEnd())
668 if (i->id == layoutId)
679 void WindowManager::hideLayer(int layer)
681 qDebug("-=[hideLayer]=-");
682 qDebug("layer %d", layer);
684 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
685 // POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
686 if (layer >= 0 && layer < WINDOWMANAGER_LAYER_NUM) {
687 /* hide target layer */
688 m_showLayers[layer] = 0;
690 if (layer == WINDOWMANAGER_LAYER_APPLICATIONS) {
691 /* clear pending flag */
692 m_pending_to_show = -1;
693 } else if (m_pending_to_show != -1) {
694 /* there is a pending application to show */
695 showAppLayer(m_pending_to_show);
699 t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
700 int num_layers = getLayerRenderOrder(renderOrder);
701 ilm_displaySetRenderOrder(m_screenId, renderOrder, num_layers);
707 int WindowManager::setLayoutById(int layoutId)
709 qDebug("-=[setLayoutById]=-");
710 int result = WINDOWMANAGER_NO_ERROR;
711 m_currentLayout = layoutId;
713 mp_layoutAreaToSurfaceIdAssignment->clear();
720 int WindowManager::setLayoutByName(const QString &layoutName)
722 qDebug("-=[setLayoutByName]=-");
723 int result = WINDOWMANAGER_NO_ERROR;
725 QList<Layout>::const_iterator i = m_layouts.begin();
727 while (i != m_layouts.constEnd())
729 if (i->name == layoutName)
731 m_currentLayout = i->id;
733 mp_layoutAreaToSurfaceIdAssignment->clear();
744 int WindowManager::setSurfaceToLayoutArea(int surfaceId, int layoutAreaId)
746 qDebug("-=[setSurfaceToLayoutArea]=-");
747 int result = WINDOWMANAGER_NO_ERROR;
749 qDebug("surfaceId %d", surfaceId);
750 qDebug("layoutAreaId %d", layoutAreaId);
751 mp_layoutAreaToSurfaceIdAssignment->insert(layoutAreaId, surfaceId);
760 void WindowManager::showLayer(int layer)
762 qDebug("-=[showLayer]=-");
763 qDebug("layer %d", layer);
765 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
766 // POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
767 if (layer >= 0 && layer < WINDOWMANAGER_LAYER_NUM) {
768 static const int layer_id_array[] = {
769 WINDOWMANAGER_LAYER_POPUP,
770 WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY,
771 WINDOWMANAGER_LAYER_APPLICATIONS,
772 WINDOWMANAGER_LAYER_HOMESCREEN,
775 m_showLayers[layer] = layer_id_array[layer];
777 t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
778 int num_layers = getLayerRenderOrder(renderOrder);
779 ilm_displaySetRenderOrder(m_screenId, renderOrder, num_layers);
785 void WindowManager::showAppLayer(int pid)
787 qDebug("-=[showAppLayer]=-");
788 qDebug("pid %d", pid);
791 /* nothing to show */
794 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
796 /* clear pending flag */
797 m_pending_to_show = -1;
799 /* search layer id for application to show */
800 QMap<pid_t, t_ilm_layer>::const_iterator i = m_appLayers.find(pid);
802 if (i != m_appLayers.end()) {
803 m_showLayers[2] = m_appLayers.value(pid);
804 qDebug("Found layer(%d) to show for app(pid=%d)", m_showLayers[2], pid);
806 /* Probably app layer hasn't been made yet */
807 m_pending_to_show = pid;
808 /* hide current app once, back to default screen */
811 qDebug("No layer to show for app(pid=%d)", pid);
813 t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
815 int num_layers = getLayerRenderOrder(renderOrder);
816 ilm_displaySetRenderOrder(m_screenId, renderOrder, num_layers);