aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2016-12-13 14:35:25 +0900
committerTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2016-12-14 14:41:46 +0900
commit57e18aeaf2a9ae292af7559580f8154527fc04f5 (patch)
treec1071a6288a30d3743bcbfbdc6d96cc96e1a4abc
parentb9f0e1049e70e9553a752d13de5d4023e85cc662 (diff)
Fix and improve switching applications
v2: (Tadao Tanikawa) Minor fixed pointed by reveiw and organize debug message v1: (Tadao Tanikawa) Quick hack to fix and improve switching applications. Changes: * Improve management of layers and surfaces Previously single layer was shared among all applications, now each application has its own layer. * Improve showing / hiding applications Previously to show/hide application, surfaces are added or removed everytime, but it's slow. Now reordering layers controls showing/hiding applications, it much faster. * Shortcut icons whose application is not installed no longer cause issue to switch apps. Caution: This patch is very quick hack, and many old codes which regarding to management surfaces are disabled, so there may be unnoticed degraded. Change-Id: I69494213b0d1b169558f3d792ebecf414caccacc Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
-rw-r--r--HomeScreen/qml/Home.qml2
-rw-r--r--HomeScreen/qml/ShortcutArea.qml2
-rw-r--r--HomeScreen/src/layouthandler.cpp11
-rw-r--r--HomeScreen/src/layouthandler.h4
-rw-r--r--HomeScreen/src/main.cpp2
-rw-r--r--HomeScreen/src/mainwindow.cpp2
-rw-r--r--HomeScreen/src2/applicationmodel.cpp2
-rw-r--r--WindowManager/src/windowmanager.cpp194
-rw-r--r--WindowManager/src/windowmanager.hpp24
-rw-r--r--interfaces/windowmanager.xml25
10 files changed, 211 insertions, 57 deletions
diff --git a/HomeScreen/qml/Home.qml b/HomeScreen/qml/Home.qml
index 3c8f109..301fdbd 100644
--- a/HomeScreen/qml/Home.qml
+++ b/HomeScreen/qml/Home.qml
@@ -55,7 +55,7 @@ Item {
applicationArea.visible = true
appLauncherAreaLauncher.visible = false
- layoutHandler.showAppLayer()
+ layoutHandler.showAppLayer(pid)
}
else {
console.warn("app cannot be launched!")
diff --git a/HomeScreen/qml/ShortcutArea.qml b/HomeScreen/qml/ShortcutArea.qml
index 684b845..aeaf097 100644
--- a/HomeScreen/qml/ShortcutArea.qml
+++ b/HomeScreen/qml/ShortcutArea.qml
@@ -70,7 +70,7 @@ Item {
applicationArea.visible = true
appLauncherAreaLauncher.visible = false
layoutHandler.makeMeVisible(pid)
- layoutHandler.showAppLayer()
+ layoutHandler.showAppLayer(pid)
}
else {
console.warn("app cannot be launched!")
diff --git a/HomeScreen/src/layouthandler.cpp b/HomeScreen/src/layouthandler.cpp
index 4738f8e..3c6eb5c 100644
--- a/HomeScreen/src/layouthandler.cpp
+++ b/HomeScreen/src/layouthandler.cpp
@@ -70,10 +70,9 @@ LayoutHandler::~LayoutHandler()
delete mp_dBusWindowManagerProxy;
}
-void LayoutHandler::showAppLayer()
+void LayoutHandler::showAppLayer(int pid)
{
- // POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
- mp_dBusWindowManagerProxy->showLayer(2); // TODO: enum
+ mp_dBusWindowManagerProxy->showAppLayer(pid);
}
void LayoutHandler::hideAppLayer()
@@ -86,6 +85,7 @@ void LayoutHandler::makeMeVisible(int pid)
{
qDebug("makeMeVisible %d", pid);
+#if 0
// if app does not request to be visible
if (-1 == m_requestsToBeVisiblePids.indexOf(pid))
{
@@ -103,10 +103,12 @@ void LayoutHandler::makeMeVisible(int pid)
{
checkToDoQueue();
}
+#endif
}
void LayoutHandler::checkToDoQueue()
{
+#if 0
if ((-1 != m_secondsTimerId) && (0 == m_requestsToBeVisiblePids.size()))
{
killTimer(m_secondsTimerId);
@@ -181,14 +183,17 @@ void LayoutHandler::checkToDoQueue()
}
}
}
+#endif
}
+#if 0
QList<int> LayoutHandler::requestGetAllSurfacesOfProcess(int pid)
{
qDebug("requestGetAllSurfacesOfProcess %d", pid);
return mp_dBusWindowManagerProxy->getAllSurfacesOfProcess(pid);
}
+#endif
int LayoutHandler::requestGetSurfaceStatus(int surfaceId)
{
diff --git a/HomeScreen/src/layouthandler.h b/HomeScreen/src/layouthandler.h
index 9ca0a9f..e3c0246 100644
--- a/HomeScreen/src/layouthandler.h
+++ b/HomeScreen/src/layouthandler.h
@@ -15,13 +15,13 @@ public:
signals:
public slots:
- void showAppLayer();
+ void showAppLayer(int pid);
void hideAppLayer();
void makeMeVisible(int pid);
private:
void checkToDoQueue();
public slots:
- QList<int> requestGetAllSurfacesOfProcess(int pid);
+ // QList<int> requestGetAllSurfacesOfProcess(int pid);
int requestGetSurfaceStatus(int surfaceId);
void requestRenderSurfaceToArea(int surfaceId, int layoutArea);
bool requestRenderSurfaceToAreaAllowed(int surfaceId, int layoutArea);
diff --git a/HomeScreen/src/main.cpp b/HomeScreen/src/main.cpp
index 3cf8e8c..c1f951e 100644
--- a/HomeScreen/src/main.cpp
+++ b/HomeScreen/src/main.cpp
@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
LayoutHandler* layoutHandler = new LayoutHandler();
HomeScreenControlInterface* hsci = new HomeScreenControlInterface();
- QObject::connect(hsci, SIGNAL(newRequestGetAllSurfacesOfProcess(int)), layoutHandler, SLOT(requestGetAllSurfacesOfProcess(int)));
+ // QObject::connect(hsci, SIGNAL(newRequestGetAllSurfacesOfProcess(int)), layoutHandler, SLOT(requestGetAllSurfacesOfProcess(int)));
QObject::connect(hsci, SIGNAL(newRequestGetSurfaceStatus(int)), layoutHandler, SLOT(requestGetSurfaceStatus(int)));
QObject::connect(hsci, SIGNAL(newRequestsToBeVisibleApp(int)), layoutHandler, SLOT(makeMeVisible(int)));
QObject::connect(hsci, SIGNAL(newRequestRenderSurfaceToArea(int, int)), layoutHandler, SLOT(requestRenderSurfaceToArea(int,int)));
diff --git a/HomeScreen/src/mainwindow.cpp b/HomeScreen/src/mainwindow.cpp
index 0bf4b5c..6e4ec92 100644
--- a/HomeScreen/src/mainwindow.cpp
+++ b/HomeScreen/src/mainwindow.cpp
@@ -102,7 +102,7 @@ MainWindow::MainWindow(QWidget *parent) :
//mp_layoutHandler->setUpLayouts();
mp_homeScreenControlInterface = new HomeScreenControlInterface(this);
- QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestGetAllSurfacesOfProcess(int)), mp_layoutHandler, SLOT(requestGetAllSurfacesOfProcess(int)));
+ // QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestGetAllSurfacesOfProcess(int)), mp_layoutHandler, SLOT(requestGetAllSurfacesOfProcess(int)));
QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestGetSurfaceStatus(int)), mp_layoutHandler, SLOT(requestGetSurfaceStatus(int)));
QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestsToBeVisibleApp(int)), mp_layoutHandler, SLOT(makeMeVisible(int)));
QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestRenderSurfaceToArea(int, int)), mp_layoutHandler, SLOT(requestRenderSurfaceToArea(int,int)));
diff --git a/HomeScreen/src2/applicationmodel.cpp b/HomeScreen/src2/applicationmodel.cpp
index b8bbb38..2a16ace 100644
--- a/HomeScreen/src2/applicationmodel.cpp
+++ b/HomeScreen/src2/applicationmodel.cpp
@@ -45,7 +45,7 @@ ApplicationModel::Private::Private(ApplicationModel *parent)
data.append(AppInfo(QStringLiteral("Navigation"), QStringLiteral("NAVIGATION"), QStringLiteral("navigation@0.1")));
data.append(AppInfo(QStringLiteral("Phone"), QStringLiteral("PHONE"), QStringLiteral("phone@0.1")));
data.append(AppInfo(QStringLiteral("Radio"), QStringLiteral("RADIO"), QStringLiteral("radio@0.1")));
- data.append(AppInfo(QStringLiteral("Multimedia"), QStringLiteral("MULTIMEDIA"), QStringLiteral("multimedia@0.1")));
+ data.append(AppInfo(QStringLiteral("Multimedia"), QStringLiteral("MULTIMEDIA"), QStringLiteral("mediaplayer@0.1")));
data.append(AppInfo(QStringLiteral("Connectivity"), QStringLiteral("CONNECTIVITY"), QStringLiteral("connectivity@0.1")));
data.append(AppInfo(QStringLiteral("Dashboard"), QStringLiteral("DASHBOARD"), QStringLiteral("dashboard@0.1")));
data.append(AppInfo(QStringLiteral("Settings"), QStringLiteral("SETTINGS"), QStringLiteral("settings@0.1")));
diff --git a/WindowManager/src/windowmanager.cpp b/WindowManager/src/windowmanager.cpp
index 0a2a609..c3080ff 100644
--- a/WindowManager/src/windowmanager.cpp
+++ b/WindowManager/src/windowmanager.cpp
@@ -33,29 +33,26 @@
#define WINDOWMANAGER_LAYER_NUM 4
+#define WINDOWMANAGER_LAYER_ID_SHIFT 22
+
// the HomeScreen app has to have the surface id 1000
#define WINDOWMANAGER_HOMESCREEN_MAIN_SURFACE_ID 1000
void* WindowManager::myThis = 0;
-static const int layer_id_array[] = {
- WINDOWMANAGER_LAYER_POPUP,
- WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY,
- WINDOWMANAGER_LAYER_APPLICATIONS,
- WINDOWMANAGER_LAYER_HOMESCREEN,
-};
-
WindowManager::WindowManager(QObject *parent) :
QObject(parent),
m_layouts(),
- m_appSurfaces(),
+ // m_appSurfaces(),
mp_layoutAreaToSurfaceIdAssignment(0),
m_currentLayout(-1),
m_screenId(0), // use screen "0"
m_screenWidth(0),
- m_screenHeight(0)
+ m_screenHeight(0),
+ m_appLayers(),
+ m_pending_to_show(-1)
{
- m_showLayers = new int[WINDOWMANAGER_LAYER_NUM];
+ m_showLayers = new t_ilm_layer[WINDOWMANAGER_LAYER_NUM];
m_showLayers[0] = 0; /* POPUP is not shown by default */
m_showLayers[1] = 0; /* HOMESCREEN_OVERLAY is not shown by default */
@@ -86,7 +83,7 @@ void WindowManager::start()
createNewLayer(WINDOWMANAGER_LAYER_POPUP);
createNewLayer(WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY);
- createNewLayer(WINDOWMANAGER_LAYER_APPLICATIONS);
+// createNewLayer(WINDOWMANAGER_LAYER_APPLICATIONS);
createNewLayer(WINDOWMANAGER_LAYER_HOMESCREEN);
ilm_registerNotification(WindowManager::notificationFunc_static, this);
@@ -172,6 +169,47 @@ void WindowManager::createNewLayer(int layerId)
ilm_commitChanges();
}
+t_ilm_layer WindowManager::getAppLayerID(pid_t pid)
+{
+ t_ilm_layer layer_id;
+
+// layer_id = pid + (WINDOWMANAGER_LAYER_APPLICATIONS << WINDOWMANAGER_LAYER_ID_SHIFT);
+ layer_id = pid + (WINDOWMANAGER_LAYER_APPLICATIONS * 100000); /* for debug */
+
+ return layer_id;
+}
+
+void WindowManager::addSurfaceToAppLayer(int surfaceId)
+{
+ struct ilmSurfaceProperties surfaceProperties;
+ t_ilm_layer layer_id;
+ int found = 0;
+ pid_t pid;
+
+ qDebug("-=[addSurfaceToAppLayer]=-");
+ qDebug(" surfaceId %d", surfaceId);
+
+ ilm_getPropertiesOfSurface(surfaceId, &surfaceProperties);
+ pid = surfaceProperties.creatorPid;
+
+ if (pid < 0) {
+ /* No process */
+ qDebug("addSurfaceToAppLayer(%d) got pid == -1", surfaceId);
+ return;
+ }
+
+ QMap<pid_t, t_ilm_layer>::const_iterator i = m_appLayers.find(pid);
+ if (i == m_appLayers.end()) {
+ qDebug("No layer found, create new for app(pid=%d)", pid);
+
+ /* not found, create new one */
+ t_ilm_layer layer_id = getAppLayerID(pid);
+
+ createNewLayer(layer_id);
+ m_appLayers.insert(pid, layer_id);
+ }
+}
+
void WindowManager::addSurfaceToLayer(int surfaceId, int layerId)
{
qDebug("-=[addSurfaceToLayer]=-");
@@ -191,7 +229,7 @@ void WindowManager::addSurfaceToLayer(int surfaceId, int layerId)
ilm_layerAddSurface(layerId, surfaceId);
}
-
+#if 0
if (layerId == WINDOWMANAGER_LAYER_APPLICATIONS)
{
struct ilmSurfaceProperties surfaceProperties;
@@ -204,7 +242,7 @@ void WindowManager::addSurfaceToLayer(int surfaceId, int layerId)
ilm_layerAddSurface(layerId, surfaceId);
}
-
+#endif
if (layerId == WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY)
{
struct ilmSurfaceProperties surfaceProperties;
@@ -240,7 +278,8 @@ void WindowManager::updateScreen()
{
qDebug("-=[updateScreen]=-");
-#ifdef HAVE_IVI_LAYERMANAGEMENT_API
+#if 0
+//#ifdef HAVE_IVI_LAYERMANAGEMENT_API
if (-1 != m_currentLayout)
{
// hide all surfaces
@@ -307,14 +346,17 @@ void WindowManager::updateScreen()
ilm_getSurfaceIDsOnLayer(WINDOWMANAGER_LAYER_POPUP, &length, &pArray);
ilm_layerSetRenderOrder(WINDOWMANAGER_LAYER_POPUP, pArray, length);
ilm_commitChanges();
-
- // display layer render order
- t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
- int num_layers = getLayerRenderOrder(renderOrder);
- ilm_displaySetRenderOrder(0, renderOrder, num_layers);
- ilm_displaySetRenderOrder(1, renderOrder, num_layers);
- ilm_commitChanges();
#endif
+ if (m_pending_to_show != -1) {
+ showAppLayer(m_pending_to_show);
+ } else {
+ // display layer render order
+ t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
+ int num_layers = getLayerRenderOrder(renderOrder);
+ ilm_displaySetRenderOrder(0, renderOrder, num_layers);
+ ilm_displaySetRenderOrder(1, renderOrder, num_layers);
+ ilm_commitChanges();
+ }
}
#ifdef HAVE_IVI_LAYERMANAGEMENT_API
@@ -343,9 +385,9 @@ void WindowManager::notificationFunc_non_static(ilmObjectType object,
}
else
{
+ addSurfaceToAppLayer(id);
//addSurfaceToLayer(id, WINDOWMANAGER_LAYER_APPLICATIONS);
-
- m_appSurfaces.append(id);
+ //m_appSurfaces.append(id);
}
ilm_surfaceAddNotification(id, surfaceCallbackFunction_static);
@@ -354,10 +396,12 @@ void WindowManager::notificationFunc_non_static(ilmObjectType object,
else
{
qDebug("Surface destroyed, ID: %d", id);
+#if 0
m_appSurfaces.removeAt(m_appSurfaces.indexOf(id));
ilm_surfaceRemoveNotification(id);
ilm_commitChanges();
+#endif
}
}
if (ILM_LAYER == object)
@@ -404,11 +448,52 @@ void WindowManager::surfaceCallbackFunction_non_static(t_ilm_surface surface,
if (ILM_NOTIFICATION_CONTENT_AVAILABLE & mask)
{
qDebug("ILM_NOTIFICATION_CONTENT_AVAILABLE");
- //updateScreen();
+ /* 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);
+ }
}
if (ILM_NOTIFICATION_CONTENT_REMOVED & mask)
{
qDebug("ILM_NOTIFICATION_CONTENT_REMOVED");
+
+ /* application being down */
+ m_appLayers.remove(surfaceProperties->creatorPid);
+
+ updateScreen();
}
if (ILM_NOTIFICATION_CONFIGURED & mask)
{
@@ -423,7 +508,8 @@ void WindowManager::surfaceCallbackFunction_non_static(t_ilm_surface surface,
surfaceProperties->origSourceWidth,
surfaceProperties->origSourceHeight);
- ilm_commitChanges();
+ ilm_surfaceSetVisibility(surface, ILM_TRUE);
+
updateScreen();
}
}
@@ -514,6 +600,7 @@ QList<Layout> WindowManager::getAllLayouts()
return m_layouts;
}
+#if 0
QList<int> WindowManager::getAllSurfacesOfProcess(int pid)
{
QList<int> result;
@@ -531,6 +618,7 @@ QList<int> WindowManager::getAllSurfacesOfProcess(int pid)
#endif
return result;
}
+#endif
QList<int> WindowManager::getAvailableLayouts(int numberOfAppSurfaces)
{
@@ -551,12 +639,14 @@ QList<int> WindowManager::getAvailableLayouts(int numberOfAppSurfaces)
return result;
}
+#if 0
QList<int> WindowManager::getAvailableSurfaces()
{
qDebug("-=[getAvailableSurfaces]=-");
return m_appSurfaces;
}
+#endif
QString WindowManager::getLayoutName(int layoutId)
{
@@ -585,8 +675,18 @@ void WindowManager::hideLayer(int layer)
#ifdef HAVE_IVI_LAYERMANAGEMENT_API
// POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
if (layer >= 0 && layer < WINDOWMANAGER_LAYER_NUM) {
+ /* hide target layer */
m_showLayers[layer] = 0;
+ if (layer == WINDOWMANAGER_LAYER_APPLICATIONS) {
+ /* clear pending flag */
+ m_pending_to_show = -1;
+ } else if (m_pending_to_show != -1) {
+ /* there is a pending application to show */
+ showAppLayer(m_pending_to_show);
+ return;
+ }
+
t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
int num_layers = getLayerRenderOrder(renderOrder);
ilm_displaySetRenderOrder(0, renderOrder, num_layers);
@@ -657,6 +757,13 @@ void WindowManager::showLayer(int layer)
#ifdef HAVE_IVI_LAYERMANAGEMENT_API
// POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
if (layer >= 0 && layer < WINDOWMANAGER_LAYER_NUM) {
+ static const int layer_id_array[] = {
+ WINDOWMANAGER_LAYER_POPUP,
+ WINDOWMANAGER_LAYER_HOMESCREEN_OVERLAY,
+ WINDOWMANAGER_LAYER_APPLICATIONS,
+ WINDOWMANAGER_LAYER_HOMESCREEN,
+ };
+
m_showLayers[layer] = layer_id_array[layer];
t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
@@ -667,3 +774,40 @@ void WindowManager::showLayer(int layer)
}
#endif
}
+
+void WindowManager::showAppLayer(int pid)
+{
+ qDebug("-=[showAppLayer]=-");
+ qDebug("pid %d", pid);
+
+ if (pid == -1) {
+ /* nothing to show */
+ return;
+ }
+
+ /* clear pending flag */
+ m_pending_to_show = -1;
+
+#ifdef HAVE_IVI_LAYERMANAGEMENT_API
+ /* search layer id for application to show */
+ QMap<pid_t, t_ilm_layer>::const_iterator i = m_appLayers.find(pid);
+
+ if (i != m_appLayers.end()) {
+ m_showLayers[2] = m_appLayers.value(pid);
+ qDebug("Found layer(%d) to show for app(pid=%d)", m_showLayers[2], pid);
+ } else {
+ /* Probably app layer hasn't been made yet */
+ m_pending_to_show = pid;
+ /* hide current app once, back to default screen */
+ m_showLayers[2] = 0;
+
+ qDebug("No layer to show for app(pid=%d)", pid);
+ }
+ t_ilm_layer renderOrder[WINDOWMANAGER_LAYER_NUM];
+
+ int num_layers = getLayerRenderOrder(renderOrder);
+ ilm_displaySetRenderOrder(0, renderOrder, num_layers);
+ ilm_displaySetRenderOrder(1, renderOrder, num_layers);
+ ilm_commitChanges();
+#endif
+}
diff --git a/WindowManager/src/windowmanager.hpp b/WindowManager/src/windowmanager.hpp
index 8c8f63c..5cc536b 100644
--- a/WindowManager/src/windowmanager.hpp
+++ b/WindowManager/src/windowmanager.hpp
@@ -27,7 +27,6 @@
#ifdef HAVE_IVI_LAYERMANAGEMENT_API
#include <ilm/ilm_control.h>
#endif
-
class WindowManager : public QObject
{
Q_OBJECT
@@ -40,7 +39,6 @@ public:
private:
WindowmanagerAdaptor *mp_windowManagerAdaptor;
QList<Layout> m_layouts;
- QList<int> m_appSurfaces;
QMap<int, unsigned int> *mp_layoutAreaToSurfaceIdAssignment;
int m_currentLayout;
@@ -49,14 +47,21 @@ private:
unsigned int m_screenWidth;
unsigned int m_screenHeight;
- int* m_showLayers;
- int getLayerRenderOrder(t_ilm_layer id_array[]);
-
void dumpScene();
#ifdef HAVE_IVI_LAYERMANAGEMENT_API
- void createNewLayer(int layerId);
- void addSurfaceToLayer(int surfaceId, int layerId);
+ t_ilm_layer* m_showLayers;
+ QMap<pid_t, t_ilm_layer> m_appLayers;
+ int getLayerRenderOrder(t_ilm_layer* id_array);
+
+ void createNewLayer(const int layerId);
+
+ t_ilm_layer getAppLayerID(const pid_t pid);
+
+ pid_t m_pending_to_show;
+
+ void addSurfaceToAppLayer(const int surfaceID);
+ void addSurfaceToLayer(const int surfaceId, const int layerId);
#endif
void updateScreen();
@@ -99,15 +104,16 @@ public Q_SLOTS: // METHODS
int addLayout(int layoutId, const QString &layoutName, const QList<LayoutArea> &surfaceAreas);
int deleteLayoutById(int layoutId);
QList<Layout> getAllLayouts();
- QList<int> getAllSurfacesOfProcess(int pid);
+ // QList<int> getAllSurfacesOfProcess(int pid);
QList<int> getAvailableLayouts(int numberOfAppSurfaces);
- QList<int> getAvailableSurfaces();
+ // QList<int> getAvailableSurfaces();
QString getLayoutName(int layoutId);
void hideLayer(int layer);
int setLayoutById(int layoutId);
int setLayoutByName(const QString &layoutName);
int setSurfaceToLayoutArea(int surfaceId, int layoutAreaId);
void showLayer(int layer);
+ void showAppLayer(int pid);
Q_SIGNALS: // SIGNALS
void surfaceVisibilityChanged(int surfaceId, bool visible);
diff --git a/interfaces/windowmanager.xml b/interfaces/windowmanager.xml
index 754c816..8a34611 100644
--- a/interfaces/windowmanager.xml
+++ b/interfaces/windowmanager.xml
@@ -127,6 +127,7 @@
Returns a list of layouts that offer the exact requested ammount of surface render areas.
If the list is empty, no layout fits the exact ammount.
-->
+
<method name="getAvailableLayouts">
<arg name="numberOfAppSurfaces" type="i" direction="in"/>
<arg name="layoutIds" type="ai" direction="out"/>
@@ -134,19 +135,6 @@
</method>
<!--
- getAllSurfacesOfProcess:
- @pid: The PID of the process.
- @surfaceIds: A list of surfaces that were created by the process.
-
- The surface IDs can be used to assign them to a layout render area.
- -->
- <method name="getAllSurfacesOfProcess">
- <arg name="pid" type="i" direction="in"/>
- <arg name="layoutIds" type="ai" direction="out"/>
- <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;int&gt;"/>
- </method>
-
- <!--
setSurfaceToLayoutArea:
@surfaceId: The ID of the surface that shall be positioned.
@layoutAreaId: The ID of the layout area where the surface shall be rendered.
@@ -187,12 +175,23 @@
<!--
showLayer:
@layer: The ID of the layer to show. POPUP=0, HOMESCREEN_OVERLAY=1, APPS=2, HOMESCREEN=3
+ @pid: The PID of the app to show. (used only when layer is APPS=2)
Show complete layers.
By default, all layers are shown.
-->
<method name="showLayer">
<arg name="layer" type="i" direction="in"/>
+ <arg name="pid" type="i" direction="in"/>
+ </method>
+ <!--
+ showAppLayer:
+ @pid: The PID of the app to show.
+
+ Show layer for application .
+ -->
+ <method name="showAppLayer">
+ <arg name="pid" type="i" direction="in"/>
</method>
<!--
hideLayer: