Fix Windows main window restoring off-screen after fullscreen (fixes #26) #69

Merged
ValleyGeek merged 2 commits from 0.1.25/issue-26-window-offscreen into main 2026-06-13 01:00:45 +00:00
Member

Summary

Fixes #26 — on Windows, reopening the app after a fullscreen session could place the main window above the visible desktop so the title bar and window controls were unreachable.

Root cause

Session restore saved frameGeometry() but applied values through setGeometry(). On Windows those APIs disagree about client vs. frame size, so a fullscreen-sized rect could push the title bar above the work area when Qt tried to avoid the taskbar.

Changes

  • session_state.py: Persist Qt saveGeometry() (qt_geometry) and target screen name for platform-correct restore.
  • Fullscreen path: Skip manual setGeometry; re-enter fullscreen on the saved monitor via windowHandle().setScreen() + showFullScreen().
  • Legacy fallback: Frame-aware clamp nudges and shrinks windows until the frame fits inside availableGeometry.
  • main_window.py: Remove duplicate deferred showFullScreen (handled in session restore).
  • Tests: Extended test_pr13_config.py with qt-geometry round-trip, fullscreen re-entry, and legacy off-screen rect cases.

Verification

  • ruff check / ruff format --check
  • pytest tests/test_pr13_config.py (25 passed)
  • ./scripts/check-version-bump.sh

Version

0.1.26 (patch)

## Summary Fixes #26 — on Windows, reopening the app after a fullscreen session could place the main window above the visible desktop so the title bar and window controls were unreachable. ## Root cause Session restore saved `frameGeometry()` but applied values through `setGeometry()`. On Windows those APIs disagree about client vs. frame size, so a fullscreen-sized rect could push the title bar above the work area when Qt tried to avoid the taskbar. ## Changes - **`session_state.py`**: Persist Qt `saveGeometry()` (`qt_geometry`) and target `screen` name for platform-correct restore. - **Fullscreen path**: Skip manual `setGeometry`; re-enter fullscreen on the saved monitor via `windowHandle().setScreen()` + `showFullScreen()`. - **Legacy fallback**: Frame-aware clamp nudges and shrinks windows until the frame fits inside `availableGeometry`. - **`main_window.py`**: Remove duplicate deferred `showFullScreen` (handled in session restore). - **Tests**: Extended `test_pr13_config.py` with qt-geometry round-trip, fullscreen re-entry, and legacy off-screen rect cases. ## Verification - `ruff check` / `ruff format --check` - `pytest tests/test_pr13_config.py` (25 passed) - `./scripts/check-version-bump.sh` ## Version `0.1.26` (patch)
fix(windows): restore main window geometry without off-screen title bar
Some checks failed
Windows Release / prune-dev-release (push) Has been skipped
Windows Release / build-release (push) Successful in 8m54s
CI / test (pull_request) Has been cancelled
CI / nuitka-smoke (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
894f8851bb
Persist Qt saveGeometry payloads and target screen names so Windows
sessions restore through platform-aware APIs instead of raw frame rects.
Fullscreen sessions re-enter fullscreen on the saved monitor without a
preceding setGeometry call that pushed the frame above the desktop.
Legacy saved rects are clamped with a frame-aware position and size pass.

Fixes #26 on branch 0.1.25/issue-26-window-offscreen.
docs: PR-prep for issue 26 — Windows window geometry restore
All checks were successful
Windows Release / prune-dev-release (push) Has been skipped
CI / lint (pull_request) Successful in 12s
CI / test (pull_request) Successful in 7m13s
CI / nuitka-smoke (pull_request) Successful in 6m42s
Windows Release / build-release (push) Successful in 8m53s
d8217ea64c
Bump VERSION to 0.1.26 and document the fullscreen off-screen restore fix.
ValleyGeek deleted branch 0.1.25/issue-26-window-offscreen 2026-06-13 01:00:46 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ai-collab/bulk-image-organizer!69
No description provided.