plugins/eyeonscreen: Animate towards window's screen's center

This looks better on multi screen setups.
This commit is contained in:
Vlad Zahorodnii 2023-05-30 13:47:15 +03:00
parent a7f41f26bb
commit aedd67ef4b

View file

@ -17,14 +17,14 @@ var eyeOnScreenEffect = {
},
slurp: function (showing) {
var stackingOrder = effects.stackingOrder;
var screenGeo = effects.virtualScreenGeometry;
var center = { value1: screenGeo.x + screenGeo.width/2,
value2: screenGeo.y + screenGeo.height/2 };
for (var i = 0; i < stackingOrder.length; ++i) {
var w = stackingOrder[i];
if (!w.visible || !(showing || w.slurpedByEyeOnScreen)) {
continue;
}
const screenGeo = w.screen.geometry;
const center = { value1: screenGeo.x + screenGeo.width / 2,
value2: screenGeo.y + screenGeo.height / 2 };
w.slurpedByEyeOnScreen = showing;
if (w.desktopWindow) {
// causes "seizures" because of opposing movements