From b91c1462ff6638a63e22db9247361dfa8c87d15f Mon Sep 17 00:00:00 2001 From: Alexander Tuxen <tuxen@silpion.de> Date: Mon, 24 Oct 2022 14:34:50 +0200 Subject: [PATCH] cleaned up unused code. --- multiscreen-compositor/qml/main.qml | 112 ---------------------------- 1 file changed, 112 deletions(-) diff --git a/multiscreen-compositor/qml/main.qml b/multiscreen-compositor/qml/main.qml index ff88363..bcef4ba 100644 --- a/multiscreen-compositor/qml/main.qml +++ b/multiscreen-compositor/qml/main.qml @@ -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() -- GitLab