Skip to content

Keep the tiling's places when a workspace switches to floating - #18142

Open
LOLCATATONIA wants to merge 13 commits into
omacom:quattrofrom
LOLCATATONIA:floating-keep-tiled-places
Open

LOLCATATONIA wants to merge 13 commits into
omacom:quattrofrom
LOLCATATONIA:floating-keep-tiled-places

Conversation

@LOLCATATONIA

@LOLCATATONIA LOLCATATONIA commented Nov 8, 2026 •

Copy link
Copy Markdown

What changes

Stacked on #18141 (snapping), so its commits show here too.

Switching a workspace to floating with Super + L resets every window to the same comfortable size and centres them in a cascade, a pile of cards; #17876 and #17971 ask for windows to keep their size and place. With snapping (#18141) in, each window can keep the box tiling gave it:

  • A window near a half or quarter (within 5% of the screen) becomes that snapped tile, titlebar inside it, so a dwindle half and two quarters carry on as snapped windows.
  • Any other box on screen stays as it is.
  • A window off the screen, such as a scrolling column, joins the snapped windows as a new window would, on the half on its side.
  • Dragged away, a kept window takes the mode's comfortable size, as it would have had.
  • A kept window gets room for exactly the titlebar it will have. The height comes from Omarchy's own titlebar setting, since on the first switch of a session the plugin loads only on the next config pass. Apps that draw their own frame (Chromium, Omarchy's browser) get no titlebar, so they are tagged where that rule is made and keep their whole tile; a window placed before that tag applied goes back into its tile once the plugin is in.

workspace-modes.lua reads every window's box before any of them floats and offers each to snapping (o.snap.adopt); a window snapping can't keep is placed as before. This doesn't touch what happens to windows moved between workspaces, only the switch itself.

Verification

  • ./test/all: see Snap windows on floating workspaces #18141 (run on the whole stack).
  • On this PR: the floating-workspaces and workspace-layout tests pass; hyprland-floating-workspaces-test.sh goes from 62 to 66 checks, with a half kept as a tile, its restore size, one restore tag, and a window off the screen joining the half on its side. It fails with the old cascade. Three more: the first switch with the plugin still loading, an app with its own frame keeping its whole tile, and a snapped window whose titlebar changed going back into its tile.
  • In a nested Hyprland 0.57.1 with a real Omarchy config (8 checks): three windows from dwindle keep their tiles; dragged away, one takes the comfortable size; the Super + L cycle dwindle, scrolling, floating brings all three into tiles with none overlapping, the column off the screen joining the half on its side, and each window with one restore size.
  • The first switch of a session where nothing floated, done the way the layout toggle does it (apply, save, reload for the titlebars), with Chromium and a terminal tiled: both keep their halves, the browser with no room for a titlebar it never gets; then a third terminal shares the browser's half, and closing the browser gives its quarter back (7 checks).
  • Merges cleanly with Keep a maximized window maximized when another app opens on floating workspaces #17491, which also changes workspace-modes.lua; the tests pass on the merge.

Screenshots

Not recorded separately: the windows keep the layout tiling gave them, which is what the screen showed before the switch. The snapping PR (#18141) has a recording of what it builds on. Happy to add a screenshot if it helps.

🤖 Generated with Claude Code

QuixoticGitHub and others added 3 commits November 8, 2026 10:39
Super + arrows put the window in that half, then a quarter (KWin's rules), and
towards the edge it is against already they maximize it; anywhere but a
floating workspace they move focus as before. Dragging a window to a side edge
snaps it to that half, near a corner to a quarter, and to the top edge
maximizes, with an outline of the target drawn by a new shell plugin; on an
edge shared with another monitor it snaps only after a pause. A snapped window
dragged away gets its size back, and a window too large for a tile is left as
it is. The drags come from the titlebars plugin's hyprbars.drag_* events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A window the floating mode opens beside snapped ones goes into the one tile
they leave free: the right half beside a left half, the fourth quarter beside
three. With the screen filled exactly, the half used last makes room, keeping
its top (or left) quarter. Closing a window on a quarter gives its space back
to the window sharing its half. Only snapped windows are arranged, never while
one is maximized, and nothing else moves windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Floating a tiled workspace sized every window the same and centred them in a
cascade, a pile of cards. Each window now keeps the box tiling gave it: near a
half or quarter (within 5%) it becomes that snapped tile, any other box on
screen stays as it is, and one off the screen, such as a scrolling column,
joins the snapped windows as a new window would, on the half on its side.
Dragged away, a kept window takes the mode's comfortable size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are addressed.

Summary

Keeps tiled windows in place when their workspace switches to floating, with snapping for nearby halves and quarters.

  • Windows on floating workspaces snap into halves and quarters.
  • Switching to floating keeps tiled windows near their original places.
  • Dragging a window shows an outline of its snap target.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Switch workspace to floating] --> B[Save tiled window boxes]
  B --> C[Float each window]
  C --> D{Can its box stay?}
  D -->|Yes| E[Keep its box or snap to a nearby tile]
  D -->|No| F[Place at a comfortable size]
  F --> G[Join an available snapped tile]
  E --> H[Keep restore size for dragging away]
  G --> H
Loading

Reviews (4) · Last reviewed commit: "Merge branch 'floating-window-snapping' ..." · Reviewed by Greptile

Comment thread default/hypr/window-snapping.lua Resolved
QuixoticGitHub and others added 8 commits November 17, 2026 17:24
Beside a shorter monitor only part of an edge is shared, so a drag could enter
a zone where the edge is outer, snapping at once, and slide on into the part
the other monitor shares without leaving the zone: the early return kept the
snap, and letting go there skipped the pause meant for crossing over. The drag
now keeps whether the edge under the pointer is shared, and starts over when
that changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A snap from maximized first waits for the window's own size, and an arrow
pressed meanwhile read the window as it was, not the tile already asked for:
Left then Up gave the top half. A pending placement now carries its tile, and
the next arrow starts from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	test/shell.d/hyprland-floating-workspaces-test.sh
On the first switch to floating in a session the titlebars plugin is only
asked for, and Hyprland loads it on the next config pass: windows kept in
place then took their whole tile, and the titlebar added afterwards stuck out
above it, so they no longer counted as snapped. The height now comes from
Omarchy's own titlebar setting rather than from the plugin. An app that draws
its own frame (Chromium, Omarchy's browser) gets no titlebar at all, so it is
tagged where that rule is made, and keeps its whole tile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the first switch to floating in a session, windows are kept in place before
the titlebars plugin is in and before the rule marking apps that draw their own
frame applies, so a browser was left room for a titlebar it never gets. Once
the plugin is in, a window snapping placed whose box would be its tile with the
titlebar the other way round goes back into that tile; a window already in its
tile, or resized by hand, stays as it is. Checked with Chromium in a nested
Hyprland through the layout toggle's own reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whether the edge under the pointer is shared is now asked on every motion in a
zone; the monitor layout behind it stays put during a drag, so it is read once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread default/hypr/window-snapping.lua Resolved
QuixoticGitHub and others added 2 commits November 17, 2026 20:53
…our's

A closing window has lost its titlebar, so its tile was measured with a snapped
neighbour's decorations, which miss when one of them is a browser drawing its
own frame. It is now measured with the neighbour's decorations, then with a
titlebar more or less; the two differ by far less than any two tiles, so at
most one fits. Tested both ways round.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the enhancement New feature or request label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants