-
-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window does not maintain size after being minimized on Windows #2729
Comments
Thanks for the report. Some further clarifications:
Based on some preliminary analysis, I think I've worked out what is happening. The Winforms toga.Window class has a listener on window resizes. When you resize the window, this causes a re-evaluation of the layout; the maximum of the current layout size and the minimum possible layout size is applied as the actual size (effectively imposing a minimum size on the window that matches the minimum possible layout size). However, on Winforms, minimizing triggers a resize event, with a window size of 0,0. This causes the window size to be set to the minimum possible size of the window content, resulting in the behavior seen here. From a quick inspection, I think the fix is to check the current window state when the resize event occurs. We don't need to process resize events when the window is minimized; so a By way of testing, there is an existing testbed test that validates window minimisation ( |
@freakboy3742 would like to work on this issue could you please assign me this issue to me!! |
@yashathwani We don't formally "assign" issues; dropping a comment that you're working on the topic (as you have already done) is more than enough. I look forward to seeing a PR! |
I have made some changes in windows.py . Could you please guide me on how to test these changes to ensure they are working correctly with the Toga framework? Like how to run the application what requirements are required |
@yashathwani The Toga docs have a contribution guide that details how to set up a development environment, and how Toga is tested. My original reply to this ticket details the extra assertion in the testbed that is required to validate this change. If you need any additional pointers, let us know! |
Describe the bug
Platform tested: Windows
When a window gets minimized and restored, it will be restored to the smallest possible size given its contents, rather than the size it was when minimized.
Steps to reproduce
briefcase dev
(orbriefcase run
)Expected behavior
Window gets restored to the original size before minimizing.
Screenshots
Before:
After:
Environment
Logs
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: