diff --git a/multiscreen-compositor/qml/main.qml b/multiscreen-compositor/qml/main.qml index ddecf050f389ee8bc889bb9737592b84359a9b26..22c398958b607b6bcc38230b20ed4e6f90b09fa2 100644 --- a/multiscreen-compositor/qml/main.qml +++ b/multiscreen-compositor/qml/main.qml @@ -369,6 +369,9 @@ WaylandCompositor { } } + // ======================================================== + // Returns the Screen that is associated with a given IviId + // ======================================================== function getScreenFromIviId(windowid) { var item = {}; @@ -404,6 +407,7 @@ WaylandCompositor { Connections { target: commands function onMoveWindowToScreen(windowid, screenid) { + cleanUpApplist(); console.log("Received a moveWindowToOutput Signal", windowid, screenid) if( screenid >= screens.count || screenid < 0){ @@ -436,32 +440,18 @@ WaylandCompositor { server.sendMessage("Move", windowid, screenid); } - function windowVisibility(windowid, show) + function windowVisibility(windowid, show){ // window visibility is now handled by the app via QWidget's hide() and show() methods. - /* - var ret = 0; - var affectedSurfaces = getActiveSurfaces(getPidFromIviId(windowid)); - if (affectedSurfaces.length === 0) + // We only send a broadcast message, so the app can do its thing. + cleanUpApplist(); + if (getScreenFromIviId(windowid) < 0) { + console.log("no screens found for IVI ID", windowid); server.returnStatus(-1); return; } - - for (var i=0; i < affectedSurfaces.length; i++) - { - var surface = affectedSurfaces[i]; - if( surface ) - { - - console.log("Set visible to", show,"for", surface) - surface.visible = show - ret++; - } - } - */ server.returnStatus(0); server.sendMessage(show ? "Show" : "Hide", windowid, getScreenFromIviId(windowid)); - //server.sendMessage(show ? "Show" : "Hide", windowid, 0); } function onHideWindow(windowid){ @@ -475,6 +465,7 @@ WaylandCompositor { } function onLogWindows(){ + cleanUpApplist(); var item = {}; var i = 0; console.log("Active surfaces:") @@ -495,12 +486,15 @@ WaylandCompositor { } function onGetScreen(windowid){ + cleanUpApplist(); console.log("Received a getScreen Signal for window ID: ", windowid) server.returnStatus(getScreenFromIviId(windowid)) } + // This seems to be unused. function onSetActiveScreen(screenId) { + cleanUpApplist(); if (screenId <= screens.count) { console.log("setting active screen", screenId);