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

Hide/Show broadcast messages now contain the screen the window is on.

parent ca91953e
No related branches found
No related tags found
1 merge request!48Rework Compositor
...@@ -255,7 +255,7 @@ WaylandCompositor { ...@@ -255,7 +255,7 @@ WaylandCompositor {
{ {
if (!commands.isPidAlive(frozenSurfaceIds[k].pid)) 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) frozenSurfaceIds = Array.from(frozenSurfaceIds).filter((e, idx) => idx !== k)
} }
} }
...@@ -359,6 +359,34 @@ WaylandCompositor { ...@@ -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 // Handle the signals emmitted by the external
// compositor commands class // compositor commands class
...@@ -417,7 +445,7 @@ WaylandCompositor { ...@@ -417,7 +445,7 @@ WaylandCompositor {
} }
} }
server.returnStatus(0); server.returnStatus(ret);
server.sendMessage(show ? "Show" : "Hide", windowid, getScreenFromIviId(windowid)); server.sendMessage(show ? "Show" : "Hide", windowid, getScreenFromIviId(windowid));
} }
...@@ -453,29 +481,7 @@ WaylandCompositor { ...@@ -453,29 +481,7 @@ WaylandCompositor {
function onGetScreen(windowid){ function onGetScreen(windowid){
console.log("Received a getScreen Signal for window ID: ", windowid) console.log("Received a getScreen Signal for window ID: ", windowid)
var item = {}; server.returnStatus(getScreenFromIviId(windowid))
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)
} }
function onSetActiveScreen(screenId) function onSetActiveScreen(screenId)
......
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