Skip to content
Snippets Groups Projects
Commit b91c1462 authored by Alexander Tuxen's avatar Alexander Tuxen Committed by Felix Gerking
Browse files

cleaned up unused code.

parent d0bd0507
No related branches found
No related tags found
1 merge request!48Rework Compositor
......@@ -244,118 +244,6 @@ WaylandCompositor {
console.log("Created IVI surface: ", item, "id", iviSurface.iviId, "screen", screenId);
activeSurfaces.push({ 'surface': item, 'screen': screenId, 'iviId': iviSurface.iviId, 'pid': pid, 'master': newPid });
//cleanOutFreezer();
}
function pidIsAlive(pid)
{
var ret = false;
var i = 0;
var frozenPids = 0;
for (i=0; i < frozenSurfaceIds.length; i++)
{
if (pid === frozenSurfaceIds[i].pid)
{
frozenPids++;
}
}
// If this pid has more than one iviId in the freezer, we assume it's alive.
if (frozenPids > 1)
{
console.log("more than one iviId found for pid:", pid);
ret = true;
}
// If it has an active surface it is most certainly alive!
for (i=0; i < activeSurfaces.length; i++)
{
if (pid === activeSurfaces[i].surface.shellSurface.surface.client.processId)
{
console.log("active surface found for pid:", pid);
ret = true;
}
}
// This is probably redundant.
/*
for (i=0; i < this.defaultOutput.surfaceArea.visibleChildren.length; i++)
{
if (pid === this.defaultOutput.surfaceArea.visibleChildren[i].shellSurface.surface.client.processId)
{
ret = true;
}
}
*/
return ret;
}
//onActiveSurfacesChanged: cleanOutFreezer()
function cleanOutFreezer()
{
var ids = [];
for (var i=0; i < frozenSurfaceIds.length; i++)
{
var item = frozenSurfaceIds[i];
var pidSeen = false;
var iviIdSeen = false;
var lowestIviId = item.iviId;
console.log("examining pid:", item.pid, "iviId", item.iviId);
for (var j=0; j < ids.length; j++)
{
if (ids[j].pid === item.pid)
{
pidSeen = true;
if (ids[j].iviId < lowestIviId)
lowestIviId = ids[j].iviId;
}
if (ids[j].iviId === item.iviId)
{
iviIdSeen = true;
}
}
/*
if ((pidSeen) && (iviIdSeen))
{
// remove all entries that are completely identical to an already seen one
console.log("throwing out duplicate entry pid:", item.pid, "iviId", item.iviId);
frozenSurfaceIds = Array.from(frozenSurfaceIds).filter((e, idx) => idx !== i)
}
if ((pidSeen) && (item.iviId > lowestIviId))
{
// remove all but the lowest iviId if the pid has any active surfaces.
console.log("throwing out active pid:", item.pid, "iviId", item.iviId);
frozenSurfaceIds = Array.from(frozenSurfaceIds).filter((e, idx) => idx !== i)
}
*/
if (iviIdSeen)
{
for (var k=0; k < frozenSurfaceIds.length; k++)
{
// Also remove frozen Ids if there are no active surfaces for this pid.
// ^^ no more!
//if (!pidIsAlive(frozenSurfaceIds[k].pid))
if (item.iviId === frozenSurfaceIds[k].iviId)
{
// Throw out the *first* entry with this iviId!
console.log("throwing out dead pid:", frozenSurfaceIds[k].pid, "iviId", frozenSurfaceIds[k].iviId);
frozenSurfaceIds = Array.from(frozenSurfaceIds).filter((e, idx) => idx !== k)
break;
}
}
}
ids.push({ 'pid': item.pid, 'iviId': item.iviId});
}
}
function cleanUpApplist()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment