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"
55 m_showLayers = new t_ilm_layer[WINDOWMANAGER_LAYER_NUM];
57 m_showLayers[0] = 0; /* POPUP is not shown by default */
58 m_showLayers[1] = 0; /* HOMESCREEN_OVERLAY is not shown by default */
59 m_showLayers[2] = 0; /* APPLICATIONS is not shown by default */
60 m_showLayers[3] = WINDOWMANAGER_LAYER_HOMESCREEN; /* HOMESCREEN is shwon by default */
62 qDebug("-=[WindowManager]=-");
65 void WindowManager::start()
67 qDebug("-=[start]=-");
68 mp_layoutAreaToSurfaceIdAssignment = new QMap<int, unsigned int>;
69 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
73 qDebug("ilm_init = %d", err);
74 if(ILM_SUCCESS != err)
76 qDebug("failed! Exiting!");
82 ilm_getScreenResolution(m_screenId, &m_screenWidth, &m_screenHeight);
84 createNewLayer(WINDOWMANAGER_LAYER_POPUP);
85 createNewLayer(WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY);
86 // createNewLayer(WINDOWMANAGER_LAYER_APPLICATIONS);
87 createNewLayer(WINDOWMANAGER_LAYER_HOMESCREEN);
89 ilm_registerNotification(WindowManager::notificationFunc_static, this);
92 QDBusConnection dbus = QDBusConnection::sessionBus();
93 dbus.registerObject("/windowmanager", this);
94 dbus.registerService("org.agl.windowmanager");
96 // publish windowmanager interface
97 mp_windowManagerAdaptor = new WindowmanagerAdaptor((QObject*)this);
100 WindowManager::~WindowManager()
102 qDebug("-=[~WindowManager]=-");
103 delete mp_windowManagerAdaptor;
104 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
107 delete mp_layoutAreaToSurfaceIdAssignment;
110 int WindowManager::getLayerRenderOrder(t_ilm_layer id_array[])
114 for (i = WINDOWMANAGER_LAYER_NUM - 1, j = 0; i >= 0; i--, j++) {
115 if (m_showLayers[i] != 0) {
116 id_array[j] = m_showLayers[i];
123 void WindowManager::dumpScene()
126 qDebug("current layout : %d", m_currentLayout);
127 qDebug("available layouts: %d", m_layouts.size());
128 QList<Layout>::const_iterator i = m_layouts.begin();
130 while (i != m_layouts.constEnd())
132 qDebug("--[id: %d]--[%s]--", i->id, i->name.toStdString().c_str());
133 qDebug(" %d surface areas", i->layoutAreas.size());
134 for (int j = 0; j < i->layoutAreas.size(); ++j)
136 qDebug(" -area %d", j);
137 qDebug(" -x : %d", i->layoutAreas.at(j).x);
138 qDebug(" -y : %d", i->layoutAreas.at(j).y);
139 qDebug(" -width : %d", i->layoutAreas.at(j).width);
140 qDebug(" -height: %d", i->layoutAreas.at(j).height);
147 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
149 void WindowManager::createNewLayer(int layerId)
151 qDebug("-=[createNewLayer]=-");
152 qDebug(" layerId %d", layerId);
154 t_ilm_layer newLayerId = layerId;
155 ilm_layerCreateWithDimension(&newLayerId, m_screenWidth, m_screenHeight);
156 ilm_layerSetOpacity(newLayerId, 1.0);
157 ilm_layerSetVisibility(newLayerId, ILM_TRUE);
158 ilm_layerSetSourceRectangle(newLayerId,
163 ilm_layerSetDestinationRectangle(newLayerId,
172 t_ilm_layer WindowManager::getAppLayerID(pid_t pid)
174 t_ilm_layer layer_id;
176 // layer_id = pid + (WINDOWMANAGER_LAYER_APPLICATIONS << WINDOWMANAGER_LAYER_ID_SHIFT);
177 layer_id = pid + (WINDOWMANAGER_LAYER_APPLICATIONS * 100000); /* for debug */
182 void WindowManager::addSurfaceToAppLayer(int surfaceId)
184 struct ilmSurfaceProperties surfaceProperties;
185 t_ilm_layer layer_id;
189 qDebug("-=[addSurfaceToAppLayer]=-");
190 qDebug(" surfaceId %d", surfaceId);
192 ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties);
193 pid = surfaceProperties.creatorPid;
197 qDebug("addSurfaceToAppLayer(%d) got pid == -1", surfaceId);
201 QMap<pid_t, t_ilm_layer>::const_iterator i = m_appLayers.find(pid);
202 if (i == m_appLayers.end()) {
203 qDebug("No layer found, create new for app(pid=%d)", pid);
205 /* not found, create new one */
206 t_ilm_layer layer_id = getAppLayerID(pid);
208 createNewLayer(layer_id);
209 m_appLayers.insert(pid, layer_id);
213 void WindowManager::addSurfaceToLayer(int surfaceId, int layerId)
215 qDebug("-=[addSurfaceToLayer]=-");
216 qDebug(" surfaceId %d", surfaceId);
217 qDebug(" layerId %d", layerId);
219 if (layerId == WINDOWMANAGER_LAYER_HOMESCREEN)
221 struct ilmSurfaceProperties surfaceProperties;
222 ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties);
224 // homescreen app always fullscreen in the back
225 ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, m_screenWidth, m_screenHeight);
226 //ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, m_screenWidth, m_screenHeight);
227 ilm_surfaceSetOpacity(surfaceId, 1.0);
228 ilm_surfaceSetVisibility(surfaceId, ILM_TRUE);
230 ilm_layerAddSurface(layerId, surfaceId);
233 if (layerId == WINDOWMANAGER_LAYER_APPLICATIONS)
235 struct ilmSurfaceProperties surfaceProperties;
236 ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties);
238 //ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
239 //ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
240 //ilm_surfaceSetOpacity(surfaceId, 0.0);
241 //ilm_surfaceSetVisibility(surfaceId, ILM_FALSE);
243 ilm_layerAddSurface(layerId, surfaceId);
246 if (layerId == WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY)
248 struct ilmSurfaceProperties surfaceProperties;
249 ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties);
251 //ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
252 //ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
253 //ilm_surfaceSetOpacity(surfaceId, 0.5);
254 //ilm_surfaceSetVisibility(surfaceId, ILM_TRUE);
256 ilm_layerAddSurface(layerId, surfaceId);
259 if (layerId == WINDOWMANAGER_LAYER_POPUP)
261 struct ilmSurfaceProperties surfaceProperties;
262 ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties);
264 //ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
265 //ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
266 //ilm_surfaceSetOpacity(surfaceId, 0.0);
267 //ilm_surfaceSetVisibility(surfaceId, ILM_FALSE);
269 ilm_layerAddSurface(layerId, surfaceId);
277 void WindowManager::updateScreen()
279 qDebug("-=[updateScreen]=-");
282 //#ifdef HAVE_IVI_LAYERMANAGEMENT_API
283 if (-1 != m_currentLayout)
286 for (int i = 0; i < m_appSurfaces.size(); ++i)
288 ilm_layerRemoveSurface(WINDOWMANAGER_LAYER_APPLICATIONS, m_appSurfaces.at(i));
289 //ilm_surfaceSetVisibility(m_appSurfaces.at(i), ILM_FALSE);
290 //ilm_surfaceSetOpacity(m_appSurfaces.at(i), 0.0);
294 // find the current used layout
295 QList<Layout>::const_iterator ci = m_layouts.begin();
297 Layout currentLayout;
298 while (ci != m_layouts.constEnd())
300 if (ci->id == m_currentLayout)
308 qDebug("show %d apps", mp_layoutAreaToSurfaceIdAssignment->size());
309 for (int j = 0; j < mp_layoutAreaToSurfaceIdAssignment->size(); ++j)
311 int surfaceToShow = mp_layoutAreaToSurfaceIdAssignment->find(j).value();
312 qDebug(" surface no. %d: %d", j, surfaceToShow);
314 addSurfaceToLayer(surfaceToShow, WINDOWMANAGER_LAYER_APPLICATIONS);
316 ilm_surfaceSetVisibility(surfaceToShow, ILM_TRUE);
317 ilm_surfaceSetOpacity(surfaceToShow, 1.0);
319 qDebug(" layout area %d", j);
320 qDebug(" x: %d", currentLayout.layoutAreas[j].x);
321 qDebug(" y: %d", currentLayout.layoutAreas[j].y);
322 qDebug(" w: %d", currentLayout.layoutAreas[j].width);
323 qDebug(" h: %d", currentLayout.layoutAreas[j].height);
325 ilm_surfaceSetDestinationRectangle(surfaceToShow,
326 currentLayout.layoutAreas[j].x,
327 currentLayout.layoutAreas[j].y,
328 currentLayout.layoutAreas[j].width,
329 currentLayout.layoutAreas[j].height);
334 // layer surface render order
336 t_ilm_surface* pArray;
337 ilm_getSurfaceIDsOnLayer(WINDOWMANAGER_LAYER_HOMESCREEN, &length, &pArray);
338 ilm_layerSetRenderOrder(WINDOWMANAGER_LAYER_HOMESCREEN, pArray, length);
340 ilm_getSurfaceIDsOnLayer(WINDOWMANAGER_LAYER_APPLICATIONS, &length, &pArray);
341 ilm_layerSetRenderOrder(WINDOWMANAGER_LAYER_APPLICATIONS, pArray, length);
343 ilm_getSurfaceIDsOnLayer(WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY, &length, &pArray);
344 ilm_layerSetRenderOrder(WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY, pArray, length);
346 ilm_getSurfaceIDsOnLayer(WINDOWMANAGER_LAYER_POPUP, &length, &pArray);
347 ilm_layerSetRenderOrder(WINDOWMANAGER_LAYER_POPUP, pArray, length);
350 if (m_pending_to_show != -1) {
351 showAppLayer(m_pending_to_show);
353 // display layer render order
354 t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
355 int num_layers = getLayerRenderOrder(renderOrder);
356 ilm_displaySetRenderOrder(m_screenId, renderOrder, num_layers);
361 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
362 void WindowManager::notificationFunc_non_static(ilmObjectType object,
366 qDebug("-=[notificationFunc_non_static]=-");
367 qDebug("Notification from weston!");
368 if (ILM_SURFACE == object)
370 struct ilmSurfaceProperties surfaceProperties;
374 qDebug("Surface created, ID: %d", id);
375 ilm_getPropertiesOfSurface(id, &surfaceProperties);
376 qDebug(" origSourceWidth : %d", surfaceProperties.origSourceWidth);
377 qDebug(" origSourceHeight: %d", surfaceProperties.origSourceHeight);
379 if (WINDOWMANAGER_HOMESCREEN_MAIN_SURFACE_ID == id)
381 qDebug("HomeScreen app detected");
382 addSurfaceToLayer(id, WINDOWMANAGER_LAYER_HOMESCREEN);
387 addSurfaceToAppLayer(id);
388 //addSurfaceToLayer(id, WINDOWMANAGER_LAYER_APPLICATIONS);
389 //m_appSurfaces.append(id);
391 ilm_surfaceAddNotification(id, surfaceCallbackFunction_static);
397 qDebug("Surface destroyed, ID: %d", id);
399 m_appSurfaces.removeAt(m_appSurfaces.indexOf(id));
400 ilm_surfaceRemoveNotification(id);
406 if (ILM_LAYER == object)
408 //qDebug("Layer.. we don't care...");
412 void WindowManager::notificationFunc_static(ilmObjectType object,
417 static_cast<WindowManager*>(WindowManager::myThis)->notificationFunc_non_static(object, id, created);
420 void WindowManager::surfaceCallbackFunction_non_static(t_ilm_surface surface,
421 struct ilmSurfaceProperties* surfaceProperties,
422 t_ilm_notification_mask mask)
424 qDebug("-=[surfaceCallbackFunction_non_static]=-");
425 qDebug("surfaceCallbackFunction_non_static changes for surface %d", surface);
426 if (ILM_NOTIFICATION_VISIBILITY & mask)
428 qDebug("ILM_NOTIFICATION_VISIBILITY");
429 surfaceVisibilityChanged(surface, surfaceProperties->visibility);
431 if (ILM_NOTIFICATION_OPACITY & mask)
433 qDebug("ILM_NOTIFICATION_OPACITY");
435 if (ILM_NOTIFICATION_ORIENTATION & mask)
437 qDebug("ILM_NOTIFICATION_ORIENTATION");
439 if (ILM_NOTIFICATION_SOURCE_RECT & mask)
441 qDebug("ILM_NOTIFICATION_SOURCE_RECT");
443 if (ILM_NOTIFICATION_DEST_RECT & mask)
445 qDebug("ILM_NOTIFICATION_DEST_RECT");
447 if (ILM_NOTIFICATION_CONTENT_AVAILABLE & mask)
449 qDebug("ILM_NOTIFICATION_CONTENT_AVAILABLE");
450 /* add surface to layer for the application */
452 ilmErrorTypes result;
453 pid_t pid = surfaceProperties->creatorPid;
455 QMap<pid_t, t_ilm_layer>::const_iterator i = m_appLayers.find(pid);
456 if (i != m_appLayers.end()) {
457 t_ilm_layer layer_id = m_appLayers.value(pid);
459 result = ilm_layerAddSurface(layer_id, surface);
461 if (result != ILM_SUCCESS) {
462 qDebug("ilm_layerAddSurface(%d,%d) failed.", layer_id, surface);
465 /* Dirty hack! cut & paste from HomeScreen/src/layouthandler.cpp */
466 const int SCREEN_WIDTH = 1080;
467 const int SCREEN_HEIGHT = 1920;
469 const int TOPAREA_HEIGHT = 218;
470 const int TOPAREA_WIDTH = SCREEN_WIDTH;
471 const int TOPAREA_X = 0;
472 const int TOPAREA_Y = 0;
473 const int MEDIAAREA_HEIGHT = 215;
474 const int MEDIAAREA_WIDTH = SCREEN_WIDTH;
475 const int MEDIAAREA_X = 0;
476 const int MEDIAAREA_Y = SCREEN_HEIGHT - MEDIAAREA_HEIGHT;
478 ilm_surfaceSetDestinationRectangle(surface,
482 SCREEN_HEIGHT - TOPAREA_HEIGHT - MEDIAAREA_HEIGHT);
486 qDebug("No layer for application(pid=%d)", surfaceProperties->creatorPid);
489 if (ILM_NOTIFICATION_CONTENT_REMOVED & mask)
491 qDebug("ILM_NOTIFICATION_CONTENT_REMOVED");
493 /* application being down */
494 m_appLayers.remove(surfaceProperties->creatorPid);
498 if (ILM_NOTIFICATION_CONFIGURED & mask)
500 qDebug("ILM_NOTIFICATION_CONFIGURED");
501 qDebug(" surfaceProperties %d", surface);
502 qDebug(" surfaceProperties.origSourceWidth: %d", surfaceProperties->origSourceWidth);
503 qDebug(" surfaceProperties.origSourceHeight: %d", surfaceProperties->origSourceHeight);
505 ilm_surfaceSetSourceRectangle(surface,
508 surfaceProperties->origSourceWidth,
509 surfaceProperties->origSourceHeight);
511 ilm_surfaceSetVisibility(surface, ILM_TRUE);
517 void WindowManager::surfaceCallbackFunction_static(t_ilm_surface surface,
518 struct ilmSurfaceProperties* surfaceProperties,
519 t_ilm_notification_mask mask)
522 static_cast<WindowManager*>(WindowManager::myThis)->surfaceCallbackFunction_non_static(surface, surfaceProperties, mask);
526 int WindowManager::layoutId() const
528 return m_currentLayout;
531 QString WindowManager::layoutName() const
533 QList<Layout>::const_iterator i = m_layouts.begin();
535 QString result = "not found";
536 while (i != m_layouts.constEnd())
538 if (i->id == m_currentLayout)
550 int WindowManager::addLayout(int layoutId, const QString &layoutName, const QList<LayoutArea> &surfaceAreas)
552 qDebug("-=[addLayout]=-");
553 m_layouts.append(Layout(layoutId, layoutName, surfaceAreas));
555 qDebug("addLayout %d %s, size %d",
557 layoutName.toStdString().c_str(),
558 surfaceAreas.size());
562 return WINDOWMANAGER_NO_ERROR;
565 int WindowManager::deleteLayoutById(int layoutId)
567 qDebug("-=[deleteLayoutById]=-");
568 qDebug("layoutId: %d", layoutId);
569 int result = WINDOWMANAGER_NO_ERROR;
571 if (m_currentLayout == layoutId)
573 result = WINDOWMANAGER_ERROR_ID_IN_USE;
577 QList<Layout>::iterator i = m_layouts.begin();
578 result = WINDOWMANAGER_ERROR_ID_IN_USE;
579 while (i != m_layouts.constEnd())
581 if (i->id == layoutId)
584 result = WINDOWMANAGER_NO_ERROR;
596 QList<Layout> WindowManager::getAllLayouts()
598 qDebug("-=[getAllLayouts]=-");
604 QList<int> WindowManager::getAllSurfacesOfProcess(int pid)
607 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
608 struct ilmSurfaceProperties surfaceProperties;
610 for (int i = 0; i < m_appSurfaces.size(); ++i)
612 ilm_getPropertiesOfSurface(m_appSurfaces.at(i), &surfaceProperties);
613 if (pid == surfaceProperties.creatorPid)
615 result.append(m_appSurfaces.at(i));
623 QList<int> WindowManager::getAvailableLayouts(int numberOfAppSurfaces)
625 qDebug("-=[getAvailableLayouts]=-");
626 QList<Layout>::const_iterator i = m_layouts.begin();
629 while (i != m_layouts.constEnd())
631 if (i->layoutAreas.size() == numberOfAppSurfaces)
633 result.append(i->id);
643 QList<int> WindowManager::getAvailableSurfaces()
645 qDebug("-=[getAvailableSurfaces]=-");
647 return m_appSurfaces;
651 QString WindowManager::getLayoutName(int layoutId)
653 qDebug("-=[getLayoutName]=-");
654 QList<Layout>::const_iterator i = m_layouts.begin();
656 QString result = "not found";
657 while (i != m_layouts.constEnd())
659 if (i->id == layoutId)
670 void WindowManager::hideLayer(int layer)
672 qDebug("-=[hideLayer]=-");
673 qDebug("layer %d", layer);
675 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
676 // POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
677 if (layer >= 0 && layer < WINDOWMANAGER_LAYER_NUM) {
678 /* hide target layer */
679 m_showLayers[layer] = 0;
681 if (layer == WINDOWMANAGER_LAYER_APPLICATIONS) {
682 /* clear pending flag */
683 m_pending_to_show = -1;
684 } else if (m_pending_to_show != -1) {
685 /* there is a pending application to show */
686 showAppLayer(m_pending_to_show);
690 t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
691 int num_layers = getLayerRenderOrder(renderOrder);
692 ilm_displaySetRenderOrder(m_screenId, renderOrder, num_layers);
698 int WindowManager::setLayoutById(int layoutId)
700 qDebug("-=[setLayoutById]=-");
701 int result = WINDOWMANAGER_NO_ERROR;
702 m_currentLayout = layoutId;
704 mp_layoutAreaToSurfaceIdAssignment->clear();
711 int WindowManager::setLayoutByName(const QString &layoutName)
713 qDebug("-=[setLayoutByName]=-");
714 int result = WINDOWMANAGER_NO_ERROR;
716 QList<Layout>::const_iterator i = m_layouts.begin();
718 while (i != m_layouts.constEnd())
720 if (i->name == layoutName)
722 m_currentLayout = i->id;
724 mp_layoutAreaToSurfaceIdAssignment->clear();
735 int WindowManager::setSurfaceToLayoutArea(int surfaceId, int layoutAreaId)
737 qDebug("-=[setSurfaceToLayoutArea]=-");
738 int result = WINDOWMANAGER_NO_ERROR;
740 qDebug("surfaceId %d", surfaceId);
741 qDebug("layoutAreaId %d", layoutAreaId);
742 mp_layoutAreaToSurfaceIdAssignment->insert(layoutAreaId, surfaceId);
751 void WindowManager::showLayer(int layer)
753 qDebug("-=[showLayer]=-");
754 qDebug("layer %d", layer);
756 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
757 // POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
758 if (layer >= 0 && layer < WINDOWMANAGER_LAYER_NUM) {
759 static const int layer_id_array[] = {
760 WINDOWMANAGER_LAYER_POPUP,
761 WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY,
762 WINDOWMANAGER_LAYER_APPLICATIONS,
763 WINDOWMANAGER_LAYER_HOMESCREEN,
766 m_showLayers[layer] = layer_id_array[layer];
768 t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
769 int num_layers = getLayerRenderOrder(renderOrder);
770 ilm_displaySetRenderOrder(m_screenId, renderOrder, num_layers);
776 void WindowManager::showAppLayer(int pid)
778 qDebug("-=[showAppLayer]=-");
779 qDebug("pid %d", pid);
782 /* nothing to show */
786 /* clear pending flag */
787 m_pending_to_show = -1;
789 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
790 /* search layer id for application to show */
791 QMap<pid_t, t_ilm_layer>::const_iterator i = m_appLayers.find(pid);
793 if (i != m_appLayers.end()) {
794 m_showLayers[2] = m_appLayers.value(pid);
795 qDebug("Found layer(%d) to show for app(pid=%d)", m_showLayers[2], pid);
797 /* Probably app layer hasn't been made yet */
798 m_pending_to_show = pid;
799 /* hide current app once, back to default screen */
802 qDebug("No layer to show for app(pid=%d)", pid);
804 t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
806 int num_layers = getLayerRenderOrder(renderOrder);
807 ilm_displaySetRenderOrder(m_screenId, renderOrder, num_layers);