diff options
| author | srdusr <[email protected]> | 2026-08-25 14:49:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2026-08-25 14:49:00 +0200 |
| commit | 8b3ef3c7b28570122126a1c8b3d6695fc3647557 (patch) | |
| tree | 5e37511996bbaa891476a37906d621ab1912853f /crates/platform/src | |
| parent | 807d0ba1680cdc1322bfe9584781416339f6f76d (diff) | |
| download | srdwm-8b3ef3c7b28570122126a1c8b3d6695fc3647557.tar.gz srdwm-8b3ef3c7b28570122126a1c8b3d6695fc3647557.zip | |
Move a window in steps, and let the keyboard resize one at all
Two of the owner's reported gaps, both about moving a window without a
mouse.
Super+Shift+HJKL slammed the window to the far edge of the monitor in one
press: "it should move in increments - one side, middle, other side - not
just extreme left/up/right/down". It now steps an eighth of the monitor per
press, which crosses the screen in eight, passes through the middle at the
fourth, and stops flush against the edge rather than short of it. A
fraction rather than a pixel count, so the same key feels the same on a
laptop panel and a 4K display.
Only outside a tiling layout. There a window does not own its geometry --
stepping it would be undone by the next arrange - so the neighbour swap
stays, and three tests that assumed swapping on a dynamic workspace now say
which layout they mean.
Keyboard resize did not exist. Super+right-drag has resized with the mouse
for a while, which is why this went unnoticed, but nothing resized a window
without one. `srd.window.resize("right", "grow"|"shrink")` grows or shrinks
from the far edge in that direction, leaving the top-left where it is, and
is bounded by the same minimums a drag is and by the monitor's usable area
- a window can be resized neither to nothing nor off the screen, and a
test holds each key down forty times to prove it.
Wired into the owner's config: Super+Ctrl+arrows resize (the arrow says
which way the far edge moves, so Right always widens), and Super+Ctrl+L
locks the screen. Hyprland only ever bound the lock to XF86ScreenSaver,
which most keyboards do not have; Super+L is the convention everywhere else
but is already focus-right here. Ctrl+arrows rather than Ctrl+HJKL because
Super+Ctrl+K is already kill-process.
Verified through the real path in a nested compositor running that config:
89 bindings, all 89 described, the five new ones registered.
Diffstat (limited to 'crates/platform/src')
| -rw-r--r-- | crates/platform/src/ipc/tests.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/platform/src/ipc/tests.rs b/crates/platform/src/ipc/tests.rs index 2e61761..d73cbc5 100644 --- a/crates/platform/src/ipc/tests.rs +++ b/crates/platform/src/ipc/tests.rs @@ -684,6 +684,14 @@ fn move_window_dispatch_swaps_with_the_neighbour_and_focuses_the_target_first() let mut server = IpcServer::bind_in(dir.path(), "test").unwrap(); let wm = Rc::new(RefCell::new(WindowManager::new())); wm.borrow_mut().set_monitors(vec![srdwm_core::Monitor::new(0, "primary", srdwm_core::Rect::new(0, 0, 1920, 1080))]); + // Swapping with the neighbour is tiling behaviour. On a dynamic + // workspace a directional move steps the window itself - see + // `WindowManager::nudge_window`. + { + let mut wm = wm.borrow_mut(); + let ws = wm.current_workspace(); + wm.set_layout(ws, "tiling"); + } let (a, b) = { let mut wm = wm.borrow_mut(); let a = wm.alloc_window_id(); |