Limit initial window size on application launch #1945
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem: When launching Bisq on my Windows 10 laptop, the application window is larger than the usable screen bounds causing the title bar of the application to be mostly off the screen. This is an annoyance and requires me to move and resize the window so that it is within the screen bounds.
Cause: My laptop has a 13-inch 1920x1080 display and uses 150% display scaling. As a result, it has a usable resolution (maximum screen bounds) of 1280x660 (accounting for the height of the Windows task bar). When launching the application, it sets the initial window height to 710px, which exceeds my usable screen height.
Fix: When launching the application, prevent the initial window size from exceeding the maximum available bounds. These bounds account for objects in the native windowing system such as task bars and menu bars.
Note: This is a work in progress as I have yet to test it on anything other than Windows (I plan to verify against Ubuntu). Nor have I verified a multi-display setup. But I still wanted to put this PR together in case anyone is able to verify it especially on Mac which I do not have available to test.