Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/view/view_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ namespace umbriel {
}

m_maximizedToEdges = maximized;
if (m_tiled && m_workspace != nullptr && !leavingFullscreen) {
// The state changes below re-present the window at its new tile size. Arrange first, so the motion starts from
// the box on screen and owns the presentation from here on.
m_workspace->snapVisible(this);
m_workspace->arrange(animate);
}
bool columnFullWidth = false;
if (!maximized && m_tiled && m_workspace != nullptr && !scheduledFullscreen()) {
const int column = m_workspace->layout().columnOf(this);
Expand Down
15 changes: 13 additions & 2 deletions tests/harness/checks/animation/maximize_to_edges.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env bash
# Maximizing a tiled window to the usable-area edges must pass through the shared size animation instead of snapping.
# Maximizing a tiled window to the usable-area edges must pass through the shared size animation instead of snapping,
# from its first frame.
# A solid client on the black headless output makes its presented width measurable before, during, and after the action.
set -euo pipefail

readonly CLIENT="${UMBRIEL_UNMAP_CLIENT:-./build-debug/tests/unmap-client}"
readonly CLIENT_LOG="$UMBRIEL_RUNTIME_DIR/maximize-to-edges-animation-client.log"
readonly BEFORE="$UMBRIEL_RUNTIME_DIR/maximize-to-edges-before.png"
readonly START="$UMBRIEL_RUNTIME_DIR/maximize-to-edges-start.png"
readonly DURING="$UMBRIEL_RUNTIME_DIR/maximize-to-edges-during.png"
readonly AFTER="$UMBRIEL_RUNTIME_DIR/maximize-to-edges-after.png"

Expand Down Expand Up @@ -50,7 +52,11 @@ grim "$BEFORE"
before_width=$(presented_width "$BEFORE")

"$UMBRIEL" msg window-toggle-maximize-to-edges > /dev/null
"$UMBRIEL" clock-advance 1000
"$UMBRIEL" clock-advance 1
grim "$START"
start_width=$(presented_width "$START")

"$UMBRIEL" clock-advance 999
grim "$DURING"
during_width=$(presented_width "$DURING")

Expand All @@ -63,6 +69,11 @@ if (( after_width - before_width < 300 )); then
echo "maximize-to-edges did not substantially widen the window: before=$before_width after=$after_width"
exit 1
fi
# Both edges move together: the window must not show its new width before the motion has started.
if (( start_width > before_width + 10 )); then
echo "maximize-to-edges showed its new width before animating: before=$before_width start=$start_width"
exit 1
fi
if (( during_width <= before_width + 10 || during_width >= after_width - 10 )); then
echo "maximize-to-edges snapped instead of presenting an intermediate width: before=$before_width during=$during_width after=$after_width"
exit 1
Expand Down