Repository navigation
Maximize and snaps end above a floating dock; honour a native window's requested size - #487
Merged
Merged
Conversation
ymote
force-pushed
the
fix/maximize-above-dock
branch
from
October 11, 2026 14:33
03347e4 to
a71388f
Compare
…s size Maximizing a window (its title-bar button, a double-click on its title, the maximize shortcut) or snapping it filled the whole work area, so under OctoSense's and macOS's docks, which float over the desk and reserve no strip, its bottom edge went behind the dock. `DesktopWindows::rects` now fills `desktop_layout::room`, the work area less what the dock covers, for maximized and snapped windows. The dock's height is `DesktopWindows::dock`, which the shell sets before every draw from `App::dock_overlay`, the one lookup new windows' sizes already use (so #485's full-screen auto-hide flows through it unchanged), and clicks between frames read the same number. The window's own rect is untouched, so restoring brings it back. Windows (whose taskbar reserves its strip) and the styles without a dock get 0: unchanged. A native module's extra window (`WindowRequest::Open { size }`) now opens at the size the module asks for, clamped as a script app's manifest `window` is (`preferred_size`, above a floating dock), instead of the default. `desktop_layout::requested_size` treats a missing size, a zero, negative or non-finite one as no request, so such a window opens at the default size; a phone shows no extra windows. No native app OctoSense ships names a size today: Rinx's Moments and Article editor windows pass none, and no other native app opens extra windows. So no window changes size until one does. Tests: maximize and snaps end at the dock's top on a floating-dock desk and restoring brings back the rect; on Windows and Omarchy maximize fills the work area as before; a native request larger than the desk is clamped, one the desk holds is honoured, a tiny one takes the minimum, and no request, or a zero or non-finite one, keeps today's default. The code walkthrough (English and Chinese) describes both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ymote
force-pushed
the
fix/maximize-above-dock
branch
from
October 11, 2026 14:52
a71388f to
091ecbd
Compare
ymote
marked this pull request as ready for review
October 11, 2026 15:07
Contributor
Author
|
Local CI passed on 091ecbd ( GitHub would run for this PR: desktop.yml, phone.yml, apps.yml. Merged on this local pass (macOS runner queue); GitHub CI runs on the merge commit on main.
Skipped (these did NOT pass; (!) marks a skip that blocks tools/ci-local-merge.sh):
Notes:
|
This was referenced Oct 11, 2026
RoooyHe
pushed a commit
to woshuoduijiushidui/OctoSense
that referenced
this pull request
Oct 13, 2026
On a floating desk (the OctoSense and macOS styles, and every other floating style through SUPER+F), a window can now be full screen as on macOS: it covers the whole screen, edge to edge, and the top bar, its own title bar and the dock hide. Resting the pointer on the top edge slides the bar and the window's title bar down over it together (the title bar's green button leaves full screen); the bottom edge brings the dock up. Each goes back shortly after the pointer leaves it, and stays out while a menu it opened is showing (the launcher for the dock, a bar menu for the top). - The green button makes a window full screen in the mac-family styles; Option-click, SUPER+ALT+F and a title-bar double-click still maximize (above the dock, as OctoSense-org#487 made it). SUPER+F toggles full screen on a floating desk (it maximized before). An app's SetFullscreen request follows the window's flag there. - DesktopWindow.fullscreen, independent of maximized; WmLayout::rects_of gives it the outer desk rect (past the gaps), and is_fullscreen answers for both desks. A full-screen window neither moves nor resizes. - The desk draws it as content alone (no frame, title bar, corners, shadow or glass); its title bar is drawn over the content, solid and without resize edges, while the top is out. The desk refreshes the outer rect from itself each draw, so a bar that just went is never left as a gap. - The root body now overlays the bar on the scene: the scene keeps a top margin equal to the docked bar (App::place_bar, every draw), so nothing moves in a window; in full screen the margin is 0 and the bar, shown only while the top is out, slides down from above the edge. The pointer over the floating bar is the bar's alone (floating_bar_pointer). - edge_reveal.rs: the edge timing (rest 0.15 s, leave 0.45 s, slide 0.22 s) shared by the dock (now on it) and the top (App::top_edge, WmState.top_reveal / top_bar). The dock also hides beside a full-screen window (desktop::front_fullscreen), not only when OctoSense itself is full screen. - desktop/README (en/zh), KEYBINDINGS: the behaviour and its test actions. Tested: cargo test --locked -p octosense-shell --lib (1053 pass, with empty OCTOSENSE_HOME and RINX_DATA_DIR, MAKEPAD_HIDE_WINDOWS=1; new tests in desktop_layout, layout, desktop and edge_reveal). A hidden shell with the Calculator, driven over the remote control: green button -> full screen at [0,0,1400,899] with no bar, dock, title or gap; top edge -> bar and title bar out over the app; bottom edge -> dock up; the revealed green button -> back to the window [54,76,990,603], unchanged from main; SUPER+F in and out; Option-click -> maximized above the dock. The iOS phone style renders as before. The README's --test-action command was run. Unverified: a real display, and the Windows, Linux and phone shells beyond compiling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#478 made a window that asks for its own size end 32 points above a dock that floats over the desk: OctoSense's and macOS's docks reserve no strip. The shell's own maximize, and snapping, still filled the whole work area, so their bottom edge went behind the dock. Native modules' window size requests were also still ignored. These are the known follow-ups from #478.
What changes
Maximize and snaps end above a floating dock
DesktopWindows::rectsnow fillsdesktop_layout::roomfor maximized and snapped windows: the work area, less what the dock covers.toggle_fullscreen_modein desktop mode).adb3f122). The height comes only fromApp::dock_overlay, the lookup new windows' sizes already use.DesktopWindows::dockbefore every draw, in a 4-line hunk next tosync_ai_pane_geometry. Clicks between frames read the same number.desktop::dock_auto_hides),App::dock_overlayreturns 0, so maximize and snaps use the whole desk. Nothing in this PR computes the dock separately.desktop.rsordesk.rs.Native modules' requested window size
App::drain_module_windowsnow honoursWindowRequest::Open { size }, clamped exactly like a script app's manifestwindow:preferred_size, above a floating dock, throughinsert_sized.desktop_layout::requested_sizecounts a missing size, or one with a side that is zero, negative or not finite, as no request. Such a window opens at today's default.ModuleWindowsis unsupported there), and the request is ignored on a mobile style anyway.ModuleWindows::open(…, None).Tests (
crates/shell/src/desktop_layout.rs)maximize_and_snaps_end_above_a_dock_that_floats_over_the_desk, on the OctoSense style and the hidden shell's desk:maximize_where_the_dock_reserves_its_strip_or_is_absent_is_unchanged: on Windows and Omarchy, maximize fills the work area and snaps use it as before.a_native_window_size_request_is_clamped_like_a_hint:Proof in a hidden desktop shell
The binary was
target/debug/octosense, built withcargo build --locked -p octosense --no-default-features --features app-hub,craft-enginesat this head, on macOS (Apple silicon).The run:
OCTOSENSE_HOME,MAKEPAD_HIDE_WINDOWS=1andMAKEPAD_REMOTE=127.0.0.1:8915;/ggrabs only, and ended with/quit.The shell window was 1400 × 897 and the dock's top was at y 809. All rects are the app's area (
MpModuleView):opens at 1296x703)--test-action host-fullscreen(dock hidden): maximized with ⌘⌥Fthe dock covers 0 pointsThe maximized frame shows the status line ("0 bytes of 64 MB used") above the dock.
No native app requests a size, so a request could not be shown live. The unit test covers the clamp, and App Hub shows that no request keeps the default.
What ran
On the Linux build host, at this head (
a71388f3, on main with #485), from a fresh clone:python3 tools/setup.py --check --cargo.cargo test --locked -p octosense-shell --features mobile-apps --lib -- desktop_layout desktop::tests apps::tests::a_script_apps_manifest_window_is_the_size_it_asks_for: 27 passed.phone/:cargo test --locked --features mobile-apps -p octosense-shell, with phone.yml's kernel andMAKEPAD_SPLASH_BUDGET_MS=10000: 1195 passed, 0 failed.desktop/:cargo check --locked -p octosense.All passed.
Before the rebase, at
03347e4a, these also passed:cargo check --locked -p octosense-home --features mobile-apps,cargo check --locked -p octosense --features mobile-apps, and bothcheck-shell-graph.shruns. The suite then passed with 1181 tests.On the Mac:
python3 tools/setup.py --check --cargoafter the rebase, the debug builds, and the hidden-shell runs above.What did not run
tools/ci-local.sh.cargo checkvariants.--test-action host-fullscreen.Docs:
desktop/docs/code-walkthrough.mdand its Chinese twin describe maximize, snapping and native window sizes.🤖 Generated with Claude Code