Skip to content
Closed
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
5 changes: 3 additions & 2 deletions src/view/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2142,11 +2142,12 @@ namespace umbriel {
m_refullscreenOnTile = false;
}
// Leaving column maximize when entering real fullscreen avoids a stale
// widthFrac=1.0 column after the client leaves fullscreen.
// widthFrac=1.0 column after the client leaves fullscreen. Toggle it off
// so ScrollingLayout restores the width saved when maximize was enabled.
if (fullscreen && m_tiled && m_workspace != nullptr) {
const int column = m_workspace->layout().columnOf(this);
if (m_workspace->layout().isFullWidth(column)) {
m_workspace->layout().clearFullWidthState(column);
m_workspace->layout().toggleFullWidth(column);
wlr_xdg_toplevel_set_maximized(m_toplevel, false);
}
}
Expand Down
38 changes: 38 additions & 0 deletions tests/harness/checks/170_fullscreen_restore_width.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# Entering fullscreen from a full-width column must preserve the column width that maximize saved for restoration.
set -euo pipefail

window_width() {
"$UMBRIEL" windows --json | jq -r '.[] | select(.title == "fullscreen-width") | .w'
}

readonly CLIENT="$(dirname "$UMBRIEL")/subsurface-client"
readonly CLIENT_LOG="$UMBRIEL_RUNTIME_DIR/fullscreen-width-client.log"

wait_for_width() {
local expected=$1
for _ in $(seq 60); do
[[ $(window_width) == "$expected" ]] && return 0
sleep 0.1
done
echo "timed out waiting for width $expected: $($UMBRIEL windows --json)"
return 1
}

"$CLIENT" fullscreen-width 640 480 > "$CLIENT_LOG" 2>&1 &

# The default 0.5 scrolling column is 624 px on the 1280x720 harness output.
readonly ORIGINAL_WIDTH=624
readonly FULL_WIDTH=1260
wait_for_width "$ORIGINAL_WIDTH"

"$UMBRIEL" msg window-toggle-maximize > /dev/null
wait_for_width "$FULL_WIDTH"

"$UMBRIEL" msg window-toggle-fullscreen > /dev/null
wait_for_width 1280

"$UMBRIEL" msg window-toggle-fullscreen > /dev/null
wait_for_width "$ORIGINAL_WIDTH"

echo "fullscreen round trip restored the maximized column from $FULL_WIDTH to $ORIGINAL_WIDTH"