Skip to content

fix(view): animate both edges when maximizing a tiled window to edges - #974

Open
minhduc17801 wants to merge 1 commit into
noctalia-dev:mainfrom
minhduc17801:fix/maximize-to-edges-size-animation
Open

minhduc17801 wants to merge 1 commit into
noctalia-dev:mainfrom
minhduc17801:fix/maximize-to-edges-size-animation

Conversation

@minhduc17801

Copy link
Copy Markdown

Summary

View::setMaximizedToEdges now arranges the workspace right after the maximize-to-edges flag changes, before the state updates that re-present the window. Maximizing a tiled column narrower than the output to edges now animates both edges together, the way fullscreen does, instead of showing its new width in the first frame and only animating the position.

Motivation

With the scrolling layout, Mod+M (window-toggle-maximize-to-edges) on a 1/2 or 1/3 width column visibly jerks: the far edge jumps to the output edge at once, then the near edge slides. From a full-width column the size barely changes, so it is not noticeable there.

Cause: after the flag flips, setMaximizedState → refreshStateRuleEffects → Workspace::syncViewPresentation presents the window at its new tiledTargetBox size (the edges size) at its old node position, because nothing owns the presentation yet (cancelSizeAnimation released it). The deferred arrange then reads that box as the motion's start, so from already has the target size and only the position animates. Arranging immediately lets the layout motion take the presentation from the box actually on screen.

Type of Change

  • Bug fix

Testing

  • Extended animation/maximize_to_edges with a sample 1 ms after the action: the presented width must still be the starting width. Before, the check only sampled the midpoint, which this bug passes.
    • Without the fix: just check-stress animation/maximize_to_edges 16 → 16 failed (before=628 start=954).
    • With the fix: 32 passed.
  • Frame-by-frame probe (scratch, not committed), presented box of a 1/2 column after the action: before 628 → 954 at +0 ms; after 628 → 660 → 694 → 726 …. Same from 1/3 width. Restoring from edges, and a client that keeps a fixed-size buffer, animate in both versions.
  • just test: 169/169 passed.
  • just check (full suite): the same set of checks fails on my machine with and without this change (their clients never map in this environment), apart from animation/maximize_to_edges, which now passes. layout/tab_maximized_to_edges, scratchpad/maximized_to_edges, layout/maximized_tile_return and input/mod_right_double_click_maximize are among those environment failures, with identical messages before and after, so they did not exercise this change here.
  • just lint src/view/view_state.cpp: clean. just format-code: no changes.

Manual Coverage

  • Tested in a nested Umbriel session
  • Tested with native Wayland applications
  • Tested with the scrolling layout

Checklist

  • This PR is ready for review, or it is marked as Draft.
  • This change fits SCOPE.md, or its scope was agreed in an issue or on Discord first.
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format, or this PR has no C++, shader, or Markdown changes.
  • I ran the relevant build, test, lint, or verification commands, or explained why they were not run.
  • I functionally verified compositor behavior where automated checks are insufficient.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I updated docs/ and examples/config.toml, or this PR does not change user-facing configuration or behavior.
  • I used canonical names for config keys, IPC actions, paths, and identifiers.

Additional Notes

Verified in a nested session with ghostty: Alt+M from 1/2 and 1/3 width columns jerks with the current build and animates smoothly with this change. Tab groups and tiled scratchpads were not exercised manually, and their harness checks do not run in my environment (see Testing).

Setting the maximize-to-edges state re-presented the window at its new tile
size through setMaximizedState before the deferred arrange ran. The layout
motion then started from that box, so a narrower column showed its full
width at once and only its position animated: the far edge jumped to the
output edge in the first frame.

Arrange right after the flag changes, before the state updates re-present
the window, so the motion starts from the box on screen.
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.

1 participant