diff options
| author | srdusr <[email protected]> | 2025-11-07 14:04:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2025-11-07 14:04:00 +0200 |
| commit | ea78f94027ecd2c690904a6d7729e9e3cc190a20 (patch) | |
| tree | fe622c0cd12a2fe077501a26f0077c51d41b4209 /crates/core/src/window.rs | |
| parent | a8991f65602abc5ecee740c443c58fa96ecd15e1 (diff) | |
| download | srdwm-ea78f94027ecd2c690904a6d7729e9e3cc190a20.tar.gz srdwm-ea78f94027ecd2c690904a6d7729e9e3cc190a20.zip | |
Make tiling's master/stack ratio live, add settings readback everywhere
Investigated the "tiling needs a lot of work" report directly. The
MasterStackLayout algorithm itself was already correct; the real gap was
that dragging or resizing a tiled window did nothing durable (raw
geometry that the next arrange_workspace silently discarded), and
master_ratio/master_count had no live path at all (config-file only).
A resize-drag on the shared master/stack boundary now live-adjusts
TilingConfig::master_ratio and re-arranges the group immediately; srd set
master_ratio/master_count do the same for a keybind or script. Found and
fixed a real bug while building this: start_resize's own focus_window
call re-stacks its target in self.order before the ratio-drag decision
used to be made, silently misclassifying real master-column grabs.
Fixed by deciding ratio-drag status (and freezing the membership
snapshot it depends on) before that raise happens, applying
MasterStackLayout directly against the frozen snapshot rather than
re-deriving membership from the by-then-reordered live order. Live-
verified in a nested compositor, not just unit-tested.
Also closes the readback gaps flagged directly by the AGS peer session:
border_width/border_color/corner_radius/decoration_mode/gap_inner/
gap_outer/master_ratio/master_count were all live-settable via srd set
with no way to read the current value back, and pin_input had no
readback at all. SettingsResponse now reports all of them; a new
pinned_inputs query (srd pinned inputs) lists every currently pinned
pid/window.
Diffstat (limited to 'crates/core/src/window.rs')
| -rw-r--r-- | crates/core/src/window.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/core/src/window.rs b/crates/core/src/window.rs index ae82b49..a8de352 100644 --- a/crates/core/src/window.rs +++ b/crates/core/src/window.rs @@ -705,6 +705,20 @@ impl ResizeEdge { r } + /// Whether this edge has a left-hand component (`Left`, `TopLeft`, + /// `BottomLeft`) - used by tiling's own master/stack ratio-drag + /// detection (`WindowManager::tiling_ratio_drag`) to recognize a stack + /// column window's left edge as the same shared boundary a master + /// column window's own right edge is. + pub fn has_left(self) -> bool { + matches!(self, ResizeEdge::Left | ResizeEdge::TopLeft | ResizeEdge::BottomLeft) + } + + /// [`Self::has_left`]'s mirror, for `Right`/`TopRight`/`BottomRight`. + pub fn has_right(self) -> bool { + matches!(self, ResizeEdge::Right | ResizeEdge::TopRight | ResizeEdge::BottomRight) + } + /// Re-derives one dimension of `delta_applied` (the result of /// `apply_delta`, already reflecting this drag's pointer motion) so /// the rect holds `ratio` (`width, height`) - `Window::aspect_ratio`'s |