restore every window the drag posed, not the ones the poll names
Going home from a pull left the app scaled down until the pill was dragged back to clear it. clearPose walked ViewtopControl.windows, which is the 2 s poll's list, so a window that list no longer named never got its 1.0 back. Track the ids actually posed and clear those too.
This commit is contained in:
parent
f699f57235
commit
452acea0ad
1 changed files with 18 additions and 2 deletions
|
|
@ -355,23 +355,39 @@ Singleton {
|
|||
// smaller than a percent of scale is invisible and not worth a write.
|
||||
property real _lastPose: 1.0
|
||||
|
||||
// Every id this has actually posed, so the restore is not at the mercy of
|
||||
// what the 2 s poll happens to be reporting when the drag ends.
|
||||
property var _posed: ({})
|
||||
|
||||
function poseActiveZone(scale) {
|
||||
if (Math.abs(scale - root._lastPose) < 0.01)
|
||||
return;
|
||||
root._lastPose = scale;
|
||||
for (const w of root.windows) {
|
||||
if (w.workspace === root.activeZone)
|
||||
if (w.workspace === root.activeZone) {
|
||||
root.pose(w.id, scale, 0.0, 0.5, 0.5);
|
||||
root._posed[w.id] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Put them back. Called on every path out of a drag — commit, abandon and
|
||||
// cancel — because a window left posed by a gesture that ended is a window
|
||||
// the user cannot restore without knowing a verb exists.
|
||||
// Restore what was posed, plus whatever is currently known. Going home from
|
||||
// a pull left the app shrunk until the pill was dragged back down: the zone
|
||||
// change moves the strip, and a window the poll no longer names was never
|
||||
// sent its 1.0 — a window nobody can restore without knowing a verb exists.
|
||||
function clearPose() {
|
||||
root._lastPose = 1.0;
|
||||
const ids = new Set();
|
||||
for (const id of Object.keys(root._posed))
|
||||
ids.add(Number(id));
|
||||
for (const w of root.windows)
|
||||
root.pose(w.id, 1.0, 0.0, 0.5, 0.5);
|
||||
ids.add(w.id);
|
||||
for (const id of ids)
|
||||
root.pose(id, 1.0, 0.0, 0.5, 0.5);
|
||||
root._posed = ({});
|
||||
}
|
||||
|
||||
function raise(id) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue