diff --git a/multiscreen-compositor/qml/main.qml b/multiscreen-compositor/qml/main.qml index 05e0b708efff36a12132b6b0805075123293d57c..8c212ac11b9afac8723dbec832da42b3e51735ae 100644 --- a/multiscreen-compositor/qml/main.qml +++ b/multiscreen-compositor/qml/main.qml @@ -255,7 +255,7 @@ WaylandCompositor { { if (!commands.isPidAlive(frozenSurfaceIds[k].pid)) { - console.log("throwing out dead pid:", frozenSurfaceIds[k].pid, "iviId", frozenSurfaceIds[k].iviId); + //console.log("throwing out dead pid:", frozenSurfaceIds[k].pid, "iviId", frozenSurfaceIds[k].iviId); frozenSurfaceIds = Array.from(frozenSurfaceIds).filter((e, idx) => idx !== k) } } @@ -359,6 +359,34 @@ WaylandCompositor { } } + function getScreenFromIviId(windowid) + { + var item = {}; + var i = 0; + var screenId = -1; + + var pid = getPidFromIviId(windowid); + + for (i=0; i < activeSurfaces.length; i++) { + item = activeSurfaces[i]; + if (item.pid === pid) + { + screenId = item.screen; + console.log("found active surface with iviId", windowid, "pid", pid, "on screen", screenId); + } + } + for (i=0; i < frozenSurfaceIds.length; i++) { + item = frozenSurfaceIds[i]; + if (item.pid === pid) + { + screenId = item.screen; + console.log("found frozen surface with iviId", windowid, "pid", pid, "on screen", screenId); + } + } + //commands.screenInfoReceived(screenId) + return screenId; + } + // ============================================= // Handle the signals emmitted by the external // compositor commands class @@ -417,7 +445,7 @@ WaylandCompositor { } } - server.returnStatus(0); + server.returnStatus(ret); server.sendMessage(show ? "Show" : "Hide", windowid, getScreenFromIviId(windowid)); } @@ -453,29 +481,7 @@ WaylandCompositor { function onGetScreen(windowid){ console.log("Received a getScreen Signal for window ID: ", windowid) - var item = {}; - var i = 0; - var screenId = -1; - - var pid = getPidFromIviId(windowid); - - for (i=0; i < activeSurfaces.length; i++) { - item = activeSurfaces[i]; - if (item.pid === pid) - { - screenId = item.screen; - console.log("found active surface with iviId", windowid, "pid", pid, "on screen", screenId); - } - } - for (i=0; i < frozenSurfaceIds.length; i++) { - item = frozenSurfaceIds[i]; - if (item.pid === pid) - { - screenId = item.screen; - console.log("found frozen surface with iviId", windowid, "pid", pid, "on screen", screenId); - } - } - commands.screenInfoReceived(screenId) + server.returnStatus(getScreenFromIviId(windowid)) } function onSetActiveScreen(screenId)