Skip to content

Commit

Permalink
Merge pull request #2837 from cgkoutzigiannis/fix-resize-after-minimize
Browse files Browse the repository at this point in the history
Window size stays the same after minimizing and unmizing the window
  • Loading branch information
freakboy3742 committed Sep 15, 2024
2 parents be9bc40 + 0e572c3 commit e15fb50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/2729.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Window has the same size after being minimized and unminimized on Windows.
2 changes: 2 additions & 0 deletions testbed/tests/window/test_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ async def test_visibility(app, second_window, second_window_probe):
)

assert not second_window_probe.is_minimized
# Window size hasn't changed as a result of min/unmin cycle
assert second_window.size == (250, 200)

second_window_probe.close()
await second_window_probe.wait_for_window("Secondary window has been closed")
Expand Down
3 changes: 2 additions & 1 deletion winforms/src/toga_winforms/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def create(self):
######################################################################

def winforms_Resize(self, sender, event):
self.resize_content()
if self.native.WindowState != WinForms.FormWindowState.Minimized:
self.resize_content()

def winforms_FormClosing(self, sender, event):
# If the app is exiting, do nothing; we've already approved the exit
Expand Down

0 comments on commit e15fb50

Please sign in to comment.