Set preview x,y when not yet animating

Setting it on every `showPreview` invocation leads to flickering,
since the function is called multiple times for each animation.
This commit is contained in:
Gonçalo Silva
2021-02-17 01:55:17 +00:00
committed by GitHub
parent 841d49ebbf
commit 80a0addf35

View File

@@ -693,10 +693,12 @@ var preview = new St.BoxLayout({
Main.uiGroup.add_actor(preview);
function showPreview(loc, _x, _y, _w, _h) {
if (Tweener.getTweenCount(preview) == 0) {
let [x, y, _] = global.get_pointer();
preview.x = x;
preview.y = y;
}
Tweener.removeTweens(preview);
let [x, y, _] = global.get_pointer();
preview.x = x;
preview.y = y;
preview.visible = true;
preview.loc = loc;
Tweener.addTween(preview, {