Skip to content

Settle a released record, fit a tile off the pixel grid, and compare frame sizes in pixels - #28

Merged
archledger merged 10 commits into
plasma-fusionfrom
fix/issue115-limits
Nov 14, 2026
Merged

archledger merged 10 commits into
plasma-fusionfrom
fix/issue115-limits

Conversation

@archledger

@archledger archledger commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

What

Corrections to the transient tiling path, from the re-entry tests of archledger/plasma-fusion#115 on the ThinkPad (output scale 4/3) and from the limits the previous round left documented. Ten commits; the fifth to seventh came out of the review of the first four, the eighth out of the re-entry matrix on packages built from the first seven, the ninth and tenth out of the review of the eighth.

Seen Cause Change
After a desktop removal the master stays at the tile's size (4,38 714x858) and every later toggle on it is Busy (3) until it closes. The same after a second window of its app, a move of the master or a re-check of the work area. A release that is not the explicit restore is detach-only: the window stays where it stands and its record stays in Restoring. Nothing ever ended that record; the explicit restore claims an owned record only. Window::settleReleasedTransientOwnership, facade settleWindow(window, token). The policy that admitted the window moves it with an ordinary request, or leaves it where the user put it, and asks. The native layer settles only for the admitting provider, with no live restoration, in an ordinary mode outside every tile, with nothing of the native geometry in flight, and with the window on a frame that is known not to be automatic: its floating frame, or where the user's own interactive move or resize left it. Any other answer changes nothing. Generic revocation stays detach-only and the native layer still requests nothing for a released record.
(review) The first version of that operation refused only the rectangle recorded at the admission. A released window can stand on another automatic rectangle. checkWorkspacePosition asks a tiled window for its tile's rectangle with a public request, which releases the master and puts it on that rectangle; sendToOutput carries the tile's size to another output. Positive evidence only, as above. TransientOwnership::placedByUser is set when an interactive move or resize of a released window ends without being cancelled; it holds the window's geometry request generation at that moment and counts only while no later request has moved the window. Facade floatingFrame(window) gives the record's floating frame, which follows the window's screen on a transfer and now also when the re-check moves the window off a removed or resized output.
A tile whose rectangle is off the window's pixel grid is refused: Ineligible (7). At 133% only every third whole pixel is on the grid; the ThinkPad's 714x858 column happens to be. The request's target had to be the tile's rectangle exactly, and reachable. Window::transientTileFrame: the window takes the tile's corner and the largest size it reaches inside the tile. That frame is the request's target, the admission's, and what an owned maximize or full screen returns to. A rectangle with nothing reachable inside (the client's limits) is still refused. masterWindowRect() stays the tile's rectangle. A request stays current when a decoration changes its borders mid-admission, as long as its frame is at the tile's corner, inside the tile by no more than a fit is, and reachable (isTransientTileFrame).
Found while writing the fit, present in the merged code: at 110%, 125%, 150% and 175% a window with a fractional frame is admitted to a tile and its restoration is then refused. isTransientRestoreFrameFeasible compared sizes number by number. RectF stores corners, so a size read back from a rectangle differs in its last bit from the pixel grid's number wherever the output's pixel is not a binary fraction (0.8 at 125%, two thirds at 150%). 133% and 200% are binary fractions. Sizes are compared as counts of the output's pixels (samePixels, tolerance 1/1024 of a pixel), also in ownedMaximizeFeasible and the restore's minimum check.
(review) A restoration from a tile away from the output's origin comes back a last bit off: 200.79999999999995 wide for a floating frame of 200.8 at 125%. A frame that answers a configure is put together where the window stands and then moved to the configure's place. Where that frame is the configure's rectangle on the output's pixels, the configure's own rectangle is published.
With two outputs, a window centered within a fraction of a pixel of their boundary cannot be admitted until its next commit. A request that needs no configure publishes its image on the output's pixels; where the image's center fell on another output, the requested geometry was left as asked so that no output changed under the request, and the window read as unsettled. The request goes through synchronizeConfigureGeometry, the synchronization a configure's commit uses: it takes the output and its scale, transform and color along under the same fences.
A master sent to an output of another scale (133% to 100%) arrives at its floating size, its record is held, and it cannot be admitted again until it is moved by hand. The record's floating frame goes along with its size as it was, and that size is not on the other output's pixels (560.25x521.25 on whole pixels). The policy's request for it ends with the frame and the requested geometry both on 560x521, which is not the floating frame: the settle operation answers AtManagedRectangle however often the window is asked back. Window::transientFloatingImage: the frame a request for the floating frame gives the window on the output it is on - the frame itself where the window reaches it, otherwise its corner with the size taken to the output's pixels and the client's grid and back. For a released record floatingFrame() answers with it and the settle operation takes a window on it as on its floating frame; an owned record's answer stays the exact frame the explicit restoration targets. The record keeps the size it was taken with. Nothing changes on the output the frame was taken on.
(review) A press on the title bar that is held and released, or the keyboard move ended at once, settles a released window on an automatic rectangle. The user-placement mark was set when an interactive operation ended without being cancelled, whether or not it had moved anything. The mark is set only when the operation has stepped: it moved or resized the window at least once.
A restored owner's own frame could replace a sibling's manual update that was deferred while the key was reserved. TransientPlacementWriter::record let the owner's record of the reservation's frame take the deferred slot. During Restoring, the owner's record of the reservation's own frame is suppressed when another window's deferred update holds the slot. A frame the owner was moved to by hand still takes it.

Why CI never saw the scale defect

Every facade session in the suite ran at 100% or 133%, with the tile at the output's origin. At those scales each size on the pixel grid is an exact binary number, so the read-back size and the grid's number are the same double.

Tests

  • testTransientTilingFacadeReleasedMaster, 14 rows: the master released by a desktop removal, a key conflict, the user's interactive move (unsettled while it lasts), the user's move followed by a request that is not the user's, a script's request, a script's request followed by an interactive move that moves nothing (without the tenth commit it settles there), the workspace's re-check (at 100% and at 125%, where it lands off the fit), a transfer to another output, a transfer to an output of another scale (125% to 100%; the record keeps 200.8x100.8, the policy is given 201x101 at the record's corner), the removal of its output, and a maximize after the release, plus rows at 125%. Only the user's move settles where the window stands; every other row answers AtManagedRectangle until the window is back on the record's floating frame. With the first version's check three rows settle on an automatic rectangle. A live restoration answers NotReleased.
  • testTransientFloatingFrameOnAnotherScale, 8 rows: plain and server-decorated windows from 125% and 133% to 100%, to 150% from 100% and from 125%, from 150% to 175%, and the same scale on both outputs. Each checks that an owned record answers the exact floating frame, that the released record keeps its size and the corner it was moved to, that the policy is given a frame the window takes (asked for again, it is itself), that the window then stands on it with its requested geometry, that the record settles, and that a new session restores to that frame. With the image left out of the settle operation the six rows that change scale answer AtManagedRectangle.
  • testTransientTilingFacadeScales, 23 rows: two whole sessions (admit, maximize and back, restore to the exact floating frame, admit again) at 75%, 100%, 110%, 125%, 133%, 150%, 175% and 200%, plain and decorated, with the tile on and off the pixel grid and at and away from the output's origin. Before the pixel comparison 9 of the first 13 rows fail; before the landing change 6 of the off-origin rows fail.
  • testTransientTilingFacadeBordersChangeWhenTiled: a decoration that puts its own title bar back as the window is tiled, with a tile off the grid. The admission keeps the frame it was made for.
  • testTransientRequestFractional: the fit (one or both axes off the grid, a client size whose image is over the tile), the refusal below the client's minimum and above its maximum, and the currency rule.
  • testTransientTilingFacadeFractionalScale: a row whose tile is off the grid.
  • testConfigurelessRequestSynchronizesRequestedGeometry: the boundary row now ends with the request on its image and on the image's output; a row with a second output of another scale.
  • testTransientPlacementWriter: the sibling's deferred update survives the owner's re-record.

Each change was written against a failing test first.

Verification

  • The CI campaign's 27 suites pass locally on the ninth commit (Fedora 44 image, the CI's target list), and the new and changed integration tests 25 consecutive times, the writer suite 25 times. On the tenth: the XdgShellWindow, Tiles, MoveResize, QuickTiling and writer suites pass; the row it adds fails without it.
  • git clang-format over the changed lines: no changes.
  • Hardware, with all ten commits picked onto the 6.8.2 line (packages kwin-6.8.2-3.fc44.pf3 built from that trial line) and the script of Return a released master to its float, and keep the floats and the app's place through a session's end plasma-fusion#170: the whole re-entry matrix of Track safe native ownership for dynamic tiling plasma-fusion#115 on the ThinkPad X13 Yoga (133%, a virtual 100% second output where a scenario needs one), three views per step. Among others: a desktop and an output removed while tiling (1a, 1b), a second window of the master's app (1d), the master moved and resized by hand through KWin's keyboard move and resize (1e; the tenth commit's mark comes from those steps), a panel's thickness changed (1f), the master sent to the output of another scale (1g), a toggle on the other output (2l), presses a few milliseconds apart (2m, 2n), master fractions that put the tile off the pixels (6a). After each the master is back on its floating frame or where the user put it, its record is settled and the next toggle on it is admitted. No compositor fault, no script error.
  • The same in a Fedora 44 virtual machine (133%), with 125%, 150% and 175% for the scale scenario (6b): the whole matrix on the first eight commits, the scenarios the last two touch (1d to 1g, 2m, 2n, 6a, 6b, the key conflict and the master's move) on all ten.
  • The matrix runs once more on the packages built from the 6.8.2 line after the merge, before the tag.

Not changed

  • A window whose maximum size is below the tile is refused, as before: the fit is the tile's size on the window's pixels, not a smaller window in a corner of the tile.
  • A released master that is maximized, full screen or quick-tiled keeps its record until it is back in an ordinary state and the policy asks again.
  • A released window that the user moves with a keyboard shortcut that is not an interactive move (pack, move to an edge) is not "placed by the user" for the record: the policy returns it to its floating frame.
  • A guarded request that needs no configure keeps the rectangle it was asked for, as its callers compare against it.

While a key's owner restores, the writer holds one deferred update
for the key and the latest sequence takes it, whoever sent it. The
provider records the owner's restored frame when it lands, so that
record replaced a sibling's manual update made during the restore,
and the completion then persisted the owner's frame over the user's
newer placement. The contract has the sibling's update win: the
restored owner's own frame must not overwrite it.

The owner's record of the reservation's own frame no longer takes
the slot from another window's update; it is suppressed. A frame the
released owner was moved to by hand differs from the reservation's
and is a manual update like any other, so the latest still wins
there, and a sibling's update after the owner's still replaces it.

restoredFrameDoesNotReplaceASiblingsUpdate covers the three orders,
at the completion and at the owner's destruction.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
A request that needs no configure publishes its image on the
output's pixels and takes the requested geometry with it. Where the
image's center fell on another output than the request's, that
synchronization was skipped so that no output changed under the
request, and the window stayed unsettled until its next commit: with
two outputs, a window centered within a fraction of a pixel of their
boundary could not be admitted to a transient tile.

The request now goes through synchronizeConfigureGeometry, the
synchronization a configure's commit uses. It writes the requested
geometry and, when the center has moved to another output, takes
that output and its scale, transform and color with it under the
same fences, as it does for a committed frame. A newer request made
by one of its callbacks ends this one.

testConfigurelessRequestSynchronizesRequestedGeometry: the boundary
row now ends with the request on its image and on the image's
output; a row with a second output of another scale follows the
configure that scale change brings.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
A release that is not the explicit restore is detach-only: the
window stays where it stands and its record (Restoring) keeps the
automatic rectangle out of the placement memory. Nothing ever ended
that record. The explicit restore claims an owned record only, so
after a removed desktop or output, a second window of the app or a
move of the master, the window kept the tile's size and could not be
admitted again until it closed. On the ThinkPad the desktop-removal
scenario of the re-entry tests left the master at 4,38 714x858 and
every later toggle on it was Busy.

Generic revocation stays detach-only and the native layer still
never requests the floating frame for a released record. What is new
is the record's end: Window::settleReleasedTransientOwnership, the
facade's settleWindow(window, token). The policy that admitted the
window gives it its floating frame back with an ordinary request, or
leaves it where the user put it, and asks for the record to be
settled. The native layer does it only for the provider that
admitted the window, with no live restoration, in an ordinary mode
outside every tile, with nothing of the native geometry in flight
and the frame the requested geometry, and with the window off the
automatic rectangle. Every other answer changes nothing, so the
rectangle still cannot reach the memory, and a policy that never
asks leaves the record until the window closes, as before. The
writer finalizes as for a completed restoration: a deferred update
for the key is applied, else the entry stays.

testTransientTilingFacadeReleasedMaster releases the master by a
desktop removal, a key conflict and a move by hand. It pins the
refusals (another provider, an unanswered configure, the automatic
rectangle), the settlement, the memory's entry and a second session
on the same window. testTransientTilingFacadeKeyConflict still pins
that the release alone restores nothing.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
A transient tile's rectangle is whole logical pixels. A frame is on
the output's device pixels over a client size on the client's own
grid, and at a fractional scale most whole rectangles are neither: at
133% only every third pixel is. Such a tile was refused (Ineligible),
so tiling worked on the ThinkPad only because its master column,
714x858, happens to be on the grid; another master fraction or panel
size would not be.

The window now takes the tile's top-left corner and the largest size
it reaches inside the tile (Window::transientTileFrame): the tile's
rectangle where that is reachable, else the image of a size asked one
device pixel smaller for as long as the image is larger than the
tile. That frame is the request's target, the admission's and the
rectangle an owned maximize or full screen returns to. A rectangle
with nothing reachable inside it (the client's size limits) is still
refused. The facade's masterWindowRect stays the tile's rectangle,
the layout's boundary.

A decoration that changes its borders when its window is tiled
changes, in the middle of the admission, which sizes the client
reaches. The request's frame stays current while it is at the tile's
corner, inside the tile, short of it by no more than a fit is, and
still reachable (isTransientTileFrame).

The feasibility check compared sizes number by number. A size read
back from a rectangle is the difference of two corners, and a frame's
is a client size plus borders; where the output's pixel is not a
binary fraction (0.8 at 125%, two thirds at 150%) either differs in
its last bits from the number the grid gives. At 110%, 125%, 150% and
175% a window with a fractional frame was admitted to a tile and then
refused its restoration, as its own floating frame read as
unreachable; 133% and 200% are binary fractions and never showed it.
Sizes are now compared as counts of the output's pixels. The settle
operation's test for the automatic rectangle allows for the same last
bits.

testTransientRequestFractional pins the fit, its refusal below the
client's minimum and the currency rule. A row of
testTransientTilingFacadeFractionalScale tiles into a column that is
off the grid. testTransientTilingFacadeScales runs two whole sessions
at 100% to 200%, plain and decorated, on and off the grid.
testTransientTilingFacadeReleasedMaster gains rows at 125%.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
The settle operation refused only the rectangle recorded at the
admission. A released window can stand on another automatic one. The
workspace's re-check of a window's position (a panel, a strut, an
output's size) asks a tiled window for its tile's rectangle with a
public request, which releases the master and then puts it on the
tile's rectangle as it is then; where the tile is off the pixel grid
that is not the fit the window was admitted to. A transfer to another
output carries the tile's size along. In each case the record would
have been settled with the window on an automatic rectangle, and the
next admission's reservation asks the provider to record that frame.

The record now ends on positive evidence only: the window is on its
floating frame, or the user's own interactive move or resize left it
where it stands (a mark the record gets when such an operation ends
without being cancelled). Any other frame answers AtManagedRectangle.
The facade's floatingFrame(window) gives the record's floating frame,
which follows the window to another output: where the policy returns
a released master.

A frame that answers a configure is put together where the window
stands and then moved to the configure's place. On an output whose
pixel is not a binary fraction its corners can be a last bit away
from the rectangle the configure was sent for: a restoration from a
tile at 542,362 came back 200.79999999999995 wide for a floating
frame of 200.8 at 125%. The configure's own rectangle is published
where the frame is that rectangle on the output's pixels.

ownedMaximizeFeasible and the minimum check of the restore from a
maximized or full-screen state compared sizes number by number, as
the feasibility check did: an owned unmaximize could fall to the
legacy path and release the window on such an output. Both compare
pixels now. The fit's step count is bounded whatever the scales are.

testTransientTilingFacadeReleasedMaster: the user's move is a real
interactive one (unsettled while it lasts), and new rows release the
master by a script's request, the workspace's re-check (also at
125%, where it lands off the fit), a transfer to another output and
a maximize after the release; none settles before the window is back
on its floating frame. With the previous check three of them settle.
A live restoration answers NotReleased.
testTransientTilingFacadeScales: rows at 75% and with the tile away
from the output's origin (six fail without the landing change), and
a maximize round trip in the tile.
testTransientTilingFacadeBordersChangeWhenTiled: a decoration that
puts its own title bar back as the window is tiled, with a tile off
the grid; the admission keeps the frame it was made for.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
When the output a tiled window is on is removed, the window is
released and the workspace's re-check of its position puts it on
another output. The record's floating frame stayed on the removed
output's coordinates. The record now ends only with the window on
that frame (or where the user's own move left it), so the policy had
nowhere to return such a window and its record lasted until it
closed.

checkWorkspacePosition moves the floating frame with the window's
screen area, as it moves the maximize and full-screen restore fields
and as sendToOutput does on a transfer. Nothing changes while the
screen area is the same.

testTransientTilingFacadeReleasedMaster, row output-removed: the
window's output is unplugged; the record's floating frame is on the
remaining output, the window is returned to it and the record is
settled. Without the change the floating frame is unchanged, on
coordinates that are gone.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 18:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T23:01:53.521158Z 30bf729 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

rebaseTransientFloatingOnOutputTransfer(oldScreenArea, screenArea);

P2 Badge Rebase the floating frame after a released window moves outputs

When a record has already been released, detachTransientAssociation() clears m_requestedTile; with the usual destination tile manager present, sendToOutput() then skips this branch and the rebase. The window geometry still moves to the destination below, but the saved floating frame remains in the old output’s coordinates, so floatingFrame() can direct the tiler to return the window to the wrong output. Rebase the frame for any live transient ownership on output transfer, not only while the quick-tile association remains.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/window.cpp Resolved
Comment thread src/xdgshellwindow.cpp Resolved
The record of a released window is marked when the user's own
interactive move or resize of it ends, and the settle operation takes
that as evidence that the frame the window stands on is the user's
choice. The mark lasted for the record's lifetime: a request after
the user's hand had let go (the workspace's re-check of the window's
position, a script's) moved the window somewhere nobody chose, and
the record was still settled there.

The mark is now the window's geometry request generation at the end
of the user's operation, and it counts only while that is still the
window's last request.

testTransientTilingFacadeReleasedMaster, row
moved-by-hand-then-by-a-request: after the user's move and a public
request the settle answers AtManagedRectangle until the window is
back on its floating frame.

A window whose maximum size is below the tile is refused, as it was
before the fit: the fit is the tile's size on the window's pixels,
not a smaller window in a corner of the tile, and a request's frame
is checked against its tile by that nearness.
testTransientRequestFractional pins it (row above-the-maximum).

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
A transient record's floating frame goes along when its window is
sent to another output, or when its output is removed: the corner is
moved to the new area, the size stays. The size was on the pixels of
the output the frame was taken on. On an output of another scale it
is not: 200.8x100.8 from an output whose pixel is 0.8 is no size a
window has on whole pixels.

The policy returns a released window to floatingFrame(). The request
then lands on 201x101, the frame is never the request, the window's
geometry never settles, and settleWindow answers Unsettled for as
long as the window lives. Seen with a 133% output and a 100% one: the
master sent across with Window to Next Screen arrived at its floating
size, its record was held, and it could not be admitted again until
it was moved by hand. Brought back, the record's frame had drifted by
the two translations.

Window::transientFloatingImage() is the frame a request for the
floating frame gives the window on the output it is on: the frame
itself where the window reaches it, otherwise its corner with the
size taken to the output's pixels and the client's grid and back, as
dispatchMoveResize and the commit take it. floatingFrame() answers
with it, and the settle operation takes a window that stands on it
as standing on its floating frame.

Nothing changes on the output the frame was taken on, or on any
output whose pixels it is on.

testTransientTilingFacadeReleasedMaster gains the row
sent-to-an-output-of-another-scale (125% to 100%). Without the change
floatingFrame() answers 200.8x100.8 there.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
After bdb46ac.

floatingFrame() answered with the image for an owned record too. An
owned record's frame is the explicit restoration's exact target; the
image is for the policy's own request, which returns a released
window. It is now given for a released record only, and the two
doc comments say which is which.

The comment and the commit message said the window's geometry never
settled. It does: the request ends with the frame and the requested
geometry both on the image, and the settle answered
AtManagedRectangle, not Unsettled, however often the window was
asked back. The comments say that now.

testTransientFloatingFrameOnAnotherScale, eight rows: plain and
server-decorated windows from 125% and 133% to 100%, to 150% from
100% and from 125%, from 150% to 175%, and the same scale on both
outputs. Each checks that the record keeps the size it was taken
with and the corner it was moved to, that the policy is given a frame
the window takes (asked for again, it is itself), that the window
then stands on it with its requested geometry, that the record
settles, and that a new session restores to that frame. With the
image left out of the settle operation the six rows that change scale
answer AtManagedRectangle.

The row in testTransientTilingFacadeReleasedMaster checks the corner
against the record's and that the record keeps 200.8x100.8.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b961ff80c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/window.cpp Resolved
A released record settles where the user's own interactive move or
resize left the window. The mark was set when such an operation ended
without being cancelled, whether or not it had moved anything.

A press on the title bar that is held and released, or the keyboard
move ended at once, starts and ends an interactive move without a
step. On a window an earlier release had left on an automatic
rectangle (a script's request, the workspace's re-check, the tile's
size on another output) that marked the rectangle as the user's
choice, and the settle operation completed the record there: the
floating frame was lost and the policy recorded the rectangle.

The mark is now set only when the operation has stepped: the window
was moved or resized by it at least once.

testTransientTilingFacadeReleasedMaster gains the row
moved-by-a-request-then-held-still. Without the change the settle
operation answers Settled there instead of AtManagedRectangle.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
archledger added a commit to archledger/plasma-fusion that referenced this pull request Nov 13, 2026
The fork answers floatingFrame() with the frame as the window takes
it on the output it is on (archledger/kwin#28, its eighth commit): on
an output of another scale the record's floating size is not on the
pixels, a request for it never settled, and a master sent from a 133%
output to a 100% one kept its record.

NT03's settle section, the tiler's notes and scenario 1g say so.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
@archledger
archledger merged commit 3d69a51 into plasma-fusion Nov 14, 2026
2 checks passed
@archledger
archledger deleted the fix/issue115-limits branch November 14, 2026 01:16
archledger added a commit to archledger/plasma-fusion that referenced this pull request Nov 14, 2026
…p's place through a session's end (#170)

* Return a released master to its float and settle its record

The re-entry tests for #115 found the desktop-removal scenario
failing on the ThinkPad: the stack went back to its floats, the
master stayed at the tile's size (4,38 714x858), and every later
toggle on it was refused as busy until it closed. A release that is
not the explicit restore is detach-only in the fork, and nothing
ever ended the record it leaves. A second window of the master's
app, a move of the master and a re-check of the work area leave the
same record.

After a native teardown the tiler now asks the fork to settle the
master's record (settleWindow) and acts on the answer. Nothing to
settle: the explicit restore is returning the master by itself, and
the tiler touches nothing. Neither on its floating frame nor placed
by the user: the master goes back to its floating frame by an
ordinary request, under the placing guard and the restore's quiet
second, as the stack does. The frame is the native record's own
(floatingFrame, which follows the window to another output and off
an unplugged one), never one on a display that is gone. Not settled
yet: a master still on its tile is returned at once, unless the user
is moving or resizing it or it is maximized, full screen or
quick-tiled. Settled: the frame the master stands on is recorded.
The fork settles only on the floating frame or where the user's own
interactive move or resize left the window, so no automatic
rectangle can be recorded.

The question is asked again every 100 ms, at most 30 times. A record
that has not settled by then is held; the window's next geometry
change asks again, and so do the end of a drag and a toggle on the
window. Until its record is settled nothing of a released master is
recorded and a new session leaves it out of its stack. A fork build
without settleWindow leaves the master as before.

The placement memory counts a window the tiler holds where it
floats, not on its tile or cell. A second window of the master's app
ends the session and the master returns to the app's remembered
place; the new window was restored onto that same place because the
master still stood on its tile when it opened.

An admission refused as busy (3) or ineligible (7) is tried again
every 50 ms, at most 8 times, for the view the shortcut was invoked
on. With two outputs a toggle on the second one was refused (7): the
previous session's restore had just taken the focus, and the new
master had not answered that configure yet. Pressing the shortcut
again drops a start that is still being retried.

The lifecycle test gains a run against a mock of settleWindow and
floatingFrame that answers as the fork does; its steps wait for the
condition they check, not for a fixed time. Each of fifteen
mutations of the script fails it.

docs: the tiler's notes, the NT03 rule (a released record now has an
end, the settle operation, and what it accepts), the contract and
the re-entry matrix (1a and 1b as they behave; 1d to 1g, 6a, 6b).

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>

* Disconnect the tiler when the script goes

A released master whose record is still held has the tiler's
callback on its interactiveMoveResizeFinished signal, and the facade
has onTreeChanged on treeChanged. Component.onDestruction
disconnected the handlers in `watched` only. A window and the facade
outlive the script: after a disable or a reload, the end of a drag or
of a tree called into a script that was gone (TypeError: Cannot read
property 'settleSoon' of null), and every reload left one more
connection on the window.

The teardown now stops the two retry timers, drops a pending start,
and disconnects from every held master and from the facade.

The lifecycle test destroys the script with a record held, then ends
the master's drag and a tree; without the change both callbacks fail
in the destroyed context.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>

* Drop a released master's entry when its window closes

A script's reference to a destroyed window is neither null nor
falsy: every property of it reads undefined, so `!w.deleted` is true
of it, and handing it to the facade throws ("Could not convert
argument 0 ... to KWin::Window*"). The tiler kept such a reference
in two cases:

- a released master whose record was still held closed: its entry
  stayed, and every later settle step threw on it before reaching any
  other entry, also the one a toggle makes before it admits;
- the master closed while tiling and was destroyed before the tree's
  end arrived: the teardown made an entry for it.

Seen in a virtual machine whose display had switched off, where no
record could settle and the held windows were then closed.

Tiling.alive(w) is true only of a window whose `deleted` is the
boolean false. The teardown and the settle step use it, a closing
window takes its entry along (found by identity), and its close
records nothing: it may stand on its tile.

The lifecycle test's mock now refuses a destroyed window as the
compositor's argument conversion does, and the run fails on any
TypeError. New cases: a released master that cannot be returned
closes on its tile and is destroyed, then another master is released
and settles; a tiled master closes and is destroyed before the
tree's end.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>

* Keep the stack's floats and the app's place through a session's end

Three faults of the tiler around the end of a session, found on the
ThinkPad and in a virtual machine with the fork's KWin 6.8.2.

A second window of the master's app. The writer reports the key's
second window and the master is released at once; the facade ends the
tree in a queued call. In between the session still read active, so
the window that had just opened joined the stack and was given a
cell. The teardown gave its float back an instant later, but the
window had not resized yet: KWin applies a request for the size a
window already has at once, without a configure. The client's answer
to the cell landed 60 ms later, KWin took it as the window's request,
and the settle pass recorded the cell as the app's place. Every later
toggle on the master was then refused (8), because the native layer
admits a window only from the place the memory has for its app.
A session whose master has no tile now takes no new member
(tiler.vacated); the window keeps the place KWin gave it and records
nothing when it opens.

A float given back while the cell's configure is in flight. The same
lost restore needs no second window: two presses of the shortcut 15 ms
apart left the stack window on its cell, three times out of three.
This one is older than the released-master work. For five seconds
after a float restore the tiler remembers the cell the window had
last been given; when that cell lands and KWin is not still asking
for the float, the float is asked for once more (returnFromStaleCell,
Tiling.staleCellLanding). Once per window and restore, and not for a
window a new session manages or one in the user's hand.

The app's remembered place being another window's. After the second
window is closed where it stood, its place is the app's, and the
remaining window could not become the master until it was moved: the
shortcut did nothing. The toggle now records the window's own
floating frame as its app's place first, by the memory's ordinary
record and its rules. Not in the window's quiet second, not while
another window of the app is open (the native layer refuses that
pair anyway), and not a window that stands on the tile's rectangle.

Tests. The lifecycle mock's writer reports a key's second window as
the fork's does (the owner released at once, the tree's end queued, a
window tracked once), marks the owned window's tile, and can hold an
admission to the app's entry. New cases cover the three faults and
the guards; nine mutations of the new code each fail the test. The
driver now ends each harness run before the next: the earlier runs'
scripts stayed alive and answered the next run's windows through the
shared Workspace stand-in.

The scenario document gains 2m (two presses a few milliseconds apart)
and states 1d as it behaves. Its harness compared the wrong pair of
placement snapshots in every scenario with one labelled "after"; the
note says how the earlier runs were evaluated again.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>

* Tile the screen the active window is on

A press of the shortcut tiled KWin's active screen. That is the screen
the active window stood on when it was activated: a window moved to
another screen since then (a script's move, a rule's) leaves it
behind. The tile was then made on the screen the window had left,
and the native layer admits no window of another screen, so the
press did nothing (7).

Seen on the ThinkPad in the re-entry scenario that removes the
session's own output: the harness moves the active window to the
second screen, and no session ever started there. Confirmed with the
window on Virtual-pfq2 and the active screen still eDP-1 (refused),
and again after another window had been activated in between
(accepted).

The view a press tiles is now the active window's own output, also
for the view captured when a press moves a live session.

The lifecycle mock records the output a tile is made for; a new case
presses with the master on a screen other than the active one. The
mutation that tiles the active screen fails it.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>

* Describe a floating frame on an output of another scale

The fork answers floatingFrame() with the frame as the window takes
it on the output it is on (archledger/kwin#28, its eighth commit): on
an output of another scale the record's floating size is not on the
pixels, a request for it never settled, and a master sent from a 133%
output to a 100% one kept its record.

NT03's settle section, the tiler's notes and scenario 1g say so.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>

* Keep a cell the tiler took back out of the memory and the next session

After d36e5db and 29434da.

A cell that lands late is no placement. The float was asked for once
more when the answer to a cell the tiler had taken back landed, but
nothing covered the window that stayed on the cell: an answer after
the five seconds, one the float did not follow, a window in the
user's hand. After the quiet second its next geometry change, or its
close, recorded the cell. For as long as a window stands on a cell
the tiler took back, nothing of it is recorded (onStaleCell): by a
change, the settle pass, a toggle's record or the close. The entry
goes when the window stands somewhere else, once the float has been
asked again or the bound is over and the window has settled. A window
in the user's hand is asked when the hand lets go.

The float a member brings into a session. An off and an on in quick
succession found the stack window still on its cell, the float's
configure in flight, and saved the cell as its float: every later
untoggle put it there. A member's float is where the window is going
(floatEntering): the last session's float while it stands on that
session's cell, KWin's request while the frame is not there yet, its
frame otherwise. A new session drops the entries of the windows it
takes, not all of them.

A press between the master's release and the tree's end. The
untoggle's explicit restore found no record it owned, and nobody
settled the one the release had left: the master stayed at the tile's
size and answered busy. That press, or the script going in that
moment, is the native teardown taken now (nativeTeardown), and the
vacated tree is released.

The toggle's record. A window on the last session's tile is not
recorded there when the new tree's tile is another rectangle, and
nothing is recorded where the native layer does not say where the
tile is. A window the writer holds under the app's key counts as the
app's, whatever it calls itself now.

Tests. The mock refuses a key two tracked windows share and a window
of another output, and forgets a window when it is destroyed. New
steps: the request alone bringing the float back, the hand, the
bound, the cell unrecorded by a change, a toggle and the close, a
member of a new session left on its cell, the floats a window brings,
a window opening after the master closed, the press in the gap, the
last session's tile, a silent tile, a renamed sibling. The driver
reads the lines of each harness run's end for a throw. Of 26
mutations of the new and the earlier code, 25 fail the test; the one
that does not replaces a check that only a live master reaches.

staleCellMillis is a property of the script like its other bounds.
The docs say what a toggle may change in the placement file.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>

* Record a toggle's window by what the native layer keeps of it

After 4f859cb.

The toggle records the window's own floating frame as its app's place
before the native admission. It skipped a window that stood on the
tile's rectangle, this tree's or the last session's, on the ground
that a release had left it there. A rectangle is no such evidence: a
window the user sized to that rectangle floats there, was not
recorded, and its toggle was refused (8) whenever the app's place was
another window's.

The native layer says it: floatingFrame(window) answers for a window
it still has a record for. Such a window was left where it stands by
a release nobody has returned it from (this script was not loaded, or
could not), its admission answers busy, and nothing of it is recorded,
by the first attempt or a retry. Every other window is recorded where
it floats. On a fork build without floatingFrame the toggle records
nothing.

A late cell after the user's move. For five seconds after a float
restore the answer to the cell the window had last been given is
taken back to that float. A slow client's answer can land after the
user has moved the window, and the float then went over the place the
user chose. The place a late cell is taken back to follows the
window: the frame it has settled on since. A frame KWin's request has
not reached yet is no such place.

The lifecycle mock's restoreWindow returns the window to its floating
frame, as the fork's does; it used to leave the window on the tile,
which the rectangle guard hid. New steps: a window the user put on
the tile's rectangle (recorded there, admitted), one the native layer
keeps a record of that the script knows nothing of (nothing recorded
through the busy retries), a cell that lands after a move and after a
frame in flight; a fourth harness run against a facade with
restoreWindow but without floatingFrame and settleWindow. Of 29
mutations, 28 fail the test; the one that does not replaces a check
that only a live master reaches.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>

* Leave a window the native layer keeps a record of out of the stack

After 50f5159.

A window the native layer still has a record for was kept out of the
toggle's record but not out of the stack. With the script loaded
again while a released master's record was held, the new tiler holds
nothing of that window: a later session took it as a stack member,
gave it a cell, saved the frame it stood on as its float, and its
record stayed as it was. Only the provider that admitted a window can
end its record, so such a window is left as it is until it closes: no
master (its admission answers busy), no stack member, awake or
minimized at the toggle (nativeKeeps).

A window on its way back counts where it is going. The placement
memory does not restore a new window of an app onto a spot one of the
app's windows holds, and counts a window the tiler holds where it
floats. A stack window that had been given its float back but still
stood on its cell counted on the cell: a new window of its app was
restored onto the float it was returning to. floatOf() answers with
that float for as long as the window's return is pending.

The lifecycle test: a window with a native record the script knows
nothing of stays where it stands through a session, and joins no
stack when restored from minimized; a new window of the app keeps
its place while the first is still on its cell. Without the changes
those three checks fail. Of 32 mutations, 31 fail the test; the one
that does not replaces a check that only a live master reaches.

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>

---------

Signed-off-by: Wisbendji Fimerlus <archledger236@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants