diff --git a/multiscreen-compositor/qml/main.qml b/multiscreen-compositor/qml/main.qml index 294435726b344ba46d79805af0f9f1fc77ddd784..ddecf050f389ee8bc889bb9737592b84359a9b26 100644 --- a/multiscreen-compositor/qml/main.qml +++ b/multiscreen-compositor/qml/main.qml @@ -271,8 +271,10 @@ WaylandCompositor { // ============================================= // Remove destroyed surface from the suface list + // ----------!!!! HEADS UP !!!!------------ + // Evil hook! Do not use this hook! Just don't! // ============================================= - onSurfaceAboutToBeDestroyed: { + //onSurfaceAboutToBeDestroyed: { // // ----------!!!! HEADS UP !!!!------------ // @@ -286,8 +288,16 @@ WaylandCompositor { // // ----------!!!! HEADS UP !!!!------------ // - cleanUpApplist(); - } + // It gets worse: + // + // With the new way of hiding surfaces (via QWidget's hide() and + // show() methods) any delay AT ALL at this point will crash the + // compositor! So even cleaning up the app list is off the table. + // + // ----------!!!! HEADS UP !!!!------------ + // + //cleanUpApplist(); + //} onSurfaceCreated: { console.log("surface created: ", surface); @@ -403,7 +413,7 @@ WaylandCompositor { } var affectedSurfaces = getActiveSurfaces(getPidFromIviId(windowid)); - if (affectedSurfaces.length === 0) + if ((affectedSurfaces.length === 0) && (getScreenFromIviId(windowid) < 0)) { console.log("no screens found for IVI ID", windowid); server.returnStatus(-1); @@ -417,14 +427,18 @@ WaylandCompositor { { console.log("Move", surface, "to screen", screenid) surface.parent = screens.objectAt(screenid).surfaceArea; - updateScreenAssignment(getPidFromIviId(windowid), screenid); + //updateScreenAssignment(getPidFromIviId(windowid), screenid); } } + updateScreenAssignment(getPidFromIviId(windowid), screenid); + server.returnStatus(0); 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) @@ -444,9 +458,10 @@ WaylandCompositor { ret++; } } - - server.returnStatus(ret); + */ + server.returnStatus(0); server.sendMessage(show ? "Show" : "Hide", windowid, getScreenFromIviId(windowid)); + //server.sendMessage(show ? "Show" : "Hide", windowid, 0); } function onHideWindow(windowid){ @@ -490,6 +505,11 @@ WaylandCompositor { { console.log("setting active screen", screenId); active_screen = screenId; + server.returnStatus(0); + } + else + { + server.returnStatus(-1); } } }