OpenTTD / OpenTTD/OpenTTD

[Bug]: The window restore down button does not change window size when launched maximised

Open
#11,509 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
8.3k
Forks
1.3k
Avg merge
1d 20h
Merged PRs (30d)
37

Description

Version of OpenTTD

Latest nightly, Windows 10 & 11

Expected result

OpenTTD should follow normal window behaviours handling of restore/maximise. Normal program/window behaviour is for a program to launch in the same windowing mode as when it was exited (ie. restart in maximised if it was maximised, not if it was not), and, when maximised, for the "restore down" button to return the window to the size it last was when not maximised. That size might be from the current program launch or, if started maximised, then the size it was when last not maximised from a previous launch.

NB. I've searched for Windows design documentation about expected behaviour and can't find anything which defines this as a standard, but it certainly is the behaviour of many Windows, Microsoft and 3rd party programs.

Actual result

If OpenTTD is launched in its maximised state the restore button no longer works as expected. Clicking restore does not change the viewport size. This would be _OK, but clicking restore increases title bar and window frame size, leading to the edges of the window falling outside of the screen. The OpenTTD window then can't be resized without first moving it to reveal one of the screen edges.

OpenTTD window behaviour is normal if launched not maximised. Clicking "maximise" then "restore down" returns the window to the size it was prior to being maximised.

Steps to reproduce
  1. Launch OpenTTD and resize to a nice size for running in a floating window.
  2. Maximise the OpenTTD window.
  3. Close OpenTTD and relaunch, it will start maximised.
  4. Click restore down, and the window will stay full-screen, and the edges for resizing fall of the screen edges.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue on Windows 10 or 11 using the listed four-step sequence, including relaunching after closing a maximised window. Done means Restore down returns OpenTTD to its previous non-maximised size without leaving the resize edges outside the screen.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.