summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) {