aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-04-03 12:13:50 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-04-03 12:13:50 +0200
commitbb33696c8ef16e75a9c081d9c434badd8a153990 (patch)
tree63b79d7665b279469a27c444deb2915f00396247
parent4cb274ba6a22e925425e091c46d0b63f137e736d (diff)
Record surfaces without application
Recording surfaces even for unknown applications improves the system by eliminating possible race conditions and by allowing applications to be started in background. AGL-Issue: SPEC-520 Change-Id: I7ee77d0c2fe419fa2dfaa48b1590e7ef4e82f8e6 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--windowmanager/src/windowmanager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/windowmanager/src/windowmanager.cpp b/windowmanager/src/windowmanager.cpp
index 2768816..08dac72 100644
--- a/windowmanager/src/windowmanager.cpp
+++ b/windowmanager/src/windowmanager.cpp
@@ -218,7 +218,7 @@ void WindowManager::addSurface(t_ilm_surface surfaceId)
#endif
QMap<pid_t, t_ilm_surface>::const_iterator i = m_appSurfaces.find(pid);
- if (i != m_appSurfaces.end() && i.value() == 0) {
+ if (i == m_appSurfaces.end() || i.value() == 0) {
/* Only the 1st surface is handled by Window Manager */
qDebug("This surface (%d) is 1st one for app (%d)", surfaceId, pid);
/* update surface id */
@@ -242,9 +242,6 @@ t_ilm_layer WindowManager::addSurfaceToAppLayer(pid_t pid, int surfaceId)
if (pid < 0)
return 0;
-#if !defined(NO_PROCESS_GROUP) || !defined(NO_PROCESS_SESSION)
- pid = surfPid2AppPid(pid);
-#endif
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);
@@ -478,6 +475,10 @@ void WindowManager::surfaceCallbackFunction_non_static(t_ilm_surface surface,
struct ilmSurfaceProperties* surfaceProperties,
t_ilm_notification_mask mask)
{
+ pid_t pid = surfaceProperties->creatorPid;
+#if !defined(NO_PROCESS_GROUP) || !defined(NO_PROCESS_SESSION)
+ pid = surfPid2AppPid(pid);
+#endif
qDebug("-=[surfaceCallbackFunction_non_static]=-");
qDebug("surfaceCallbackFunction_non_static changes for surface %d", surface);
if (ILM_NOTIFICATION_VISIBILITY & mask)
@@ -511,7 +512,7 @@ void WindowManager::surfaceCallbackFunction_non_static(t_ilm_surface surface,
qDebug("ILM_NOTIFICATION_CONTENT_REMOVED");
/* application being down */
- m_appLayers.remove(surfaceProperties->creatorPid);
+ m_appLayers.remove(pid);
}
if (ILM_NOTIFICATION_CONFIGURED & mask)
{
@@ -525,7 +526,6 @@ void WindowManager::surfaceCallbackFunction_non_static(t_ilm_surface surface,
configureHomeScreenMainSurface(surface, surfaceProperties->origSourceWidth, surfaceProperties->origSourceHeight);
} else {
ilmErrorTypes result;
- pid_t pid = surfaceProperties->creatorPid;
t_ilm_layer layer = addSurfaceToAppLayer(pid, surface);
if (layer != 0) {