Skip to content

Feat/configurable dock edge - #142

Open
frypan05 wants to merge 3 commits into
SumirSeth:mainfrom
frypan05:feat/configurable-dock-edge
Open

frypan05 wants to merge 3 commits into
SumirSeth:mainfrom
frypan05:feat/configurable-dock-edge

Conversation

@frypan05

@frypan05 frypan05 commented Nov 30, 2026 •

Copy link
Copy Markdown

Fixes: #85 for side edges; no option for Top ATM.

What changed

  • Added dock_edge = "bottom" | "left" | "right", with bottom as the default.
  • Added the Edge picker to Settings and documented the option in README and the default config.
  • Made the dock, launcher, work-area reservation, taskbar hiding, hit-testing, rendering, and slide animations follow the selected edge.
  • Down a side, the dock is a vertical column as thick as the bottom bar, with unrotated icons/text and a time-only clock.
  • The side clock opens Notifications with ms-actioncenter:, matching the bottom clock. The old side-clock date expansion was removed.
  • Redirected Windows’ native minimize/restore animation to the dock edge. Windows shrink into and expand from a side dock; bottom behavior is unchanged.
  • Added tests for edge parsing, side geometry, settings round-trip, launcher/dock placement, clock width, and animation target geometry.

Why

The dock was fixed to the bottom edge. This lets users place it on the left or right without breaking the launcher or app animations, which should grow from and shrink to the same edge as the dock.

How I verified it

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo clippy --workspace --all-targets --features wisp/nightly,wisp/perf-trace -- -D warnings
  • cargo test --workspace: 280 passed, 0 failed, 4 ignored

All done on Windows 11 Pro, 100% and 125% scaling, dock mode: bottom and right/left.

Performance

CPU/memory summary:
image

span durations:
image

Not tested

  • No installed Nightly build was tested.
  • Not checked yet on multiple monitors, virtual desktops, or Windows 10.

Fixes #

  • I understand every line of this change and tested a build of it.
  • fmt, both clippy runs and the tests pass.
  • CHANGELOG.md has an entry under Unreleased, or this has nothing users notice.

Note: This PR is just for testing the side dock implementation. Once tested thoroughly, I'll squash the commits with a final push keeping the code cleanliness in place. @SumirSeth

@RayTrunk

Copy link
Copy Markdown
Contributor

@frypan05 I tested #142 (d89df68) on the two side-by-side screens from #85: 2560×1440 at 125% on the left, 1920×1080 at 100% on the right, 182 px lower. First the merge with main, which needs fixing before anything else.

Merge with main

  1. It doesn't compile. src/dock.rs:3323 repeats let (width, height) = ((width * scale).ceil() as i32, ...) after the earlier conversion, so CI fails with E0277: cannot multiply i32 by f32. With that line removed it builds, and cargo test passes.
  2. sync_shell in src/app.rs (lines 720 and 724) went back to self.dock = None, which undoes Hide the launcher's window when its dock goes away #141. drop_dock is still there but has no callers, so clippy fails on dead code. I haven't retried it on this branch, but the still picture of the old dock that Hide the launcher's window when its dock goes away #141 fixed should be back.
  3. The window popup lost Show live window previews in the dock's window list #136's thumbnails. Main calls self.thumbnails.sync(...) and sizes the popup with logic::thumbnail_columns(...), while Feat/configurable dock edge #142 always uses logic::window_list_rows(...) (src/dock.rs:3295). The thumbnail code is now unused, which is where the other dead-code warnings come from. I read this from the code and haven't tried previews.

Autohide at the side edges

With the build fixed, I glided the pointer into each edge with SendInput, 5 times each at 250, 1000, 2000 and 4000 px/s:

Dock edge Where Dock came up Pointer held at
right left screen's right side (shared) 20 of 20, on the left screen x = 2559
right right screen's right side (outer) 20 of 20 —
left right screen's left side (shared) 20 of 20, on the right screen x = 2561
left left screen's left side (outer) 20 of 20 —
bottom left screen 20 of 20 —

Jumping across the shared edge in a single move didn't bring the dock up (0 of 5 for each side), which is right. The dock is 70 px wide at 125% and 56 px at 100%.

Left edge holds one pixel inside the screen

At the right edge the pointer is held on the screen's last pixel (2559). At the left edge it's held one pixel in, at 2561 instead of 2560. edge_hold turns a left edge with x → −x, which maps the half-open [left, right) to (−right, −left]. In the turned space the seam pixel x = 2560 therefore counts as the left screen. As a result:

  • the hold lands at left + 1,
  • a poll that samples the pointer exactly on the seam pixel finds both points on the same screen, so the pointer crosses without being held.

This test fails on d89df68 on both asserts:

#[test]
fn left_side_edge_holds_on_the_seam_pixel() {
    use windows::Win32::Foundation::{POINT, RECT};
    let monitors = [
        RECT { left: -1920, top: 0, right: 0, bottom: 1080 },
        RECT { left: 0, top: 0, right: 1920, bottom: 1080 },
    ];
    let held = edge_hold(Edge::Left, &monitors, POINT { x: 8, y: 600 }, POINT { x: -8, y: 610 }, 400..800, false);
    assert_eq!(held.map(|p| p.x), Some(0), "held at");
    let from_seam = edge_hold(Edge::Left, &monitors, POINT { x: 0, y: 600 }, POINT { x: -8, y: 610 }, 400..800, false);
    assert!(from_seam.is_some(), "a sample on the seam pixel x=0 slips through");
}

Mirroring points with x → −1 − x and turning each rectangle through its last pixel inside fixes both. The full suite still passes, and on my screens the hold then lands on 2560:

     let turn = |point: POINT| match edge {
         Edge::Left => POINT {
             x: point.y,
-            y: -point.x,
+            y: -1 - point.x,
         },
         _ => POINT { x: point.y, y: point.x },
     };
     let back = |point: POINT| match edge {
         Edge::Left => POINT {
-            x: -point.y,
+            x: -1 - point.y,
             y: point.x,
         },
@@
-            let b = turn(POINT {
-                x: rect.right,
-                y: rect.bottom,
-            });
+            // Turn the last pixel inside, not the exclusive corner, so the
+            // turned rectangle covers exactly the same pixels.
+            let b = turn(POINT {
+                x: rect.right - 1,
+                y: rect.bottom - 1,
+            });
             RECT {
                 left: a.x.min(b.x),
                 top: a.y.min(b.y),
-                right: a.x.max(b.x),
-                bottom: a.y.max(b.y),
+                right: a.x.max(b.x) + 1,
+                bottom: a.y.max(b.y) + 1,
             }

Still to check: the space kept for maximized windows, autohide off, and switching between bottom, left and right while Wisp runs. I'll add those here.

@frypan05

Copy link
Copy Markdown
Author

@RayTrunk I believe the error came from a bad merge resolution. The popup size was being DPI-scaled twice. Once you're through with the tests, I'll take up the above insights and update accordingly.

@RayTrunk

Copy link
Copy Markdown
Contributor

@frypan05 Thanks. Here are the rest of the results, again on d89df68 with the duplicate line removed. Everything here passed.

Autohide off, switching edges while Wisp runs. I started with the dock at the bottom of the main screen and the taskbar hidden. Then I changed dock_edge and dock_screen in the config and reloaded it. After each step I read the dock's window and each screen's work area, which is the space a maximized window fills.

Screen, edge Dock Work area
main (125%), bottom 875,1359 – 1685,1429 bottom 1347 (93 px kept)
main, left 11,267 – 81,1172 left 93
main, right 2479,267 – 2549,1172 right 2467
main, bottom again same as at start bottom 1347
right screen (100%), left, on the shared edge 2569,360 – 2625,1084 left 2634 (74 px kept)
right screen, right 4415,360 – 4471,1084 right 4406
right screen, bottom 3196,1197 – 3844,1253 bottom 1188
autohide on hidden both screens full
  • One dock at a time. After every switch Wisp had exactly one visible window, at the new edge. The other screen's work area never changed.
  • The same space on every edge. The gap and the space kept for maximized windows came out equal on all three edges: 11 px and 93 px at 125%, 9 px and 74 px at 100%.
  • A clean quit. After --quit the taskbar came back with its original work area.

I didn't maximize a real window. I relied on the work area, which is what Windows uses to size one.

@frypan05

Copy link
Copy Markdown
Author

@RayTrunk thanks for tests. I've addressed the points you mentioned.

Verified: cargo fmt, both clippy configurations, cargo test --workspace (288 passed), and cargo check --release.

@RayTrunk

Copy link
Copy Markdown
Contributor

@frypan05 Retested af3d8b4 on the same two screens. All good:

  • cargo fmt --check, clippy with and without nightly (-D warnings) and cargo test (288 passed) are clean.
  • Left seam. I glided toward the seam, then took one step across. At the right edge the pointer is held on the last pixel, 2559, and at the left edge now on the first, 2560, 6 of 6 each. Both edges match. Starting on the seam pixel itself, the dock is already up there, so the pointer passes freely on both sides, as at the bottom.
  • Autohide. The glide probe again brought the dock up at every shared and outer edge, and jumps across the seam still didn't (0 of 3).
  • Autohide off and live switching. Same results as before: one dock at the new edge after each switch, 93 px kept at 125% and 74 px at 100% on every edge, and the original work area back after --quit.
  • Hide the launcher's window when its dock goes away #141. Turning dock off while Wisp runs hides the launcher window again.

Two notes:

@frypan05
frypan05 force-pushed the feat/configurable-dock-edge branch from af3d8b4 to 15e0ca9 Compare December 1, 2026 08:14
@frypan05

frypan05 commented Dec 1, 2026 •

Copy link
Copy Markdown
Author

@RayTrunk Hi, I rebased onto current main, including #150.

Local checks pass:

  • cargo fmt --all --check
  • both clippy configurations with -D warnings
  • cargo test --workspace : test result: ok. 289 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out; finished in 2.28s
  • cargo check --release --workspace

I also retested the side-dock previews, dock-off launcher hiding, left seam hold, autohide at shared/outer edges, live edge switching/work area, and --quit.

The rebased branch is pushed. Please rerun CI on the updated branch.

@RayTrunk

RayTrunk commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@frypan05 Thanks. I checked 15e0ca9:

  • The branch now sits on current main (499528c, 0.9.1), and the diff is line for line the same as af3d8b4's, so my retest results above still apply.
  • cargo fmt --all --check, clippy with and without nightly (-D warnings) and cargo test --workspace (289 passed) are clean here too.

I can't rerun CI on your PR myself, and GitHub shows no checks for this branch yet. @SumirSeth, could you start or approve the CI run for 15e0ca9?

@SumirSeth

Copy link
Copy Markdown
Owner

sure, done.

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.

Put the dock at the top, left or right edge

3 participants