-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
Disable hiding window while in MINIMIZED
, FULLSCREEN
or PRESENTATION
state and ignore no-op visibility requests
#3109
Merged
freakboy3742
merged 13 commits into
beeware:main
from
proneon267:disable_visibility_change_on_window_state
Jan 21, 2025
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5e17264
Disallow hiding window while in specific states
proneon267 8c7f3a6
Added changelog
proneon267 3f13986
Add note on test
proneon267 8174a98
Restart CI
proneon267 64194c4
Ignore visibility calls on requesting same as current visibility state
proneon267 96b667a
Apply suggestions from code review
proneon267 f85893c
Fix typo
proneon267 c2d68c1
Update changes/3109.removal.rst
proneon267 a5ec7c3
Fix typo
proneon267 d87699e
Ensure coverage on Android
proneon267 e8298db
Fix `window.visible` for iOS
proneon267 f7fabef
Merge core tests
proneon267 b067120
Add symmetry for show() in native APIs.
freakboy3742 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The `show()` and `hide()` APIs can no longer be used on a window while it is in a `MINIMIZED`, `FULLSCREEN` or `PRESENTATION` state. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previously form of this test was:
toga/core/tests/window/test_window.py
Lines 265 to 274 in fbedd3f
Since windows are not visible at the start(since
window.show()
hadn't been called). Thereforeassert_action_performed(window, "hide")
on line 273 would not be performed, as the call towindow.hide()
will be a no-op(since window was already in hidden state.).Hence, I have added the
window.show()
call at the start.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that windows wasn't visible at the start of the test was literally this point of this test - to confirm that invoking hide() before show() didn't do anything internally stateful.
That's no longer possible/applicable because invoking hide() on a non-visible window now has different (state-specific) behavior.
So -
test_hide_show
is no longer required. But the test you've added as "test_visilibity_noop" isn't testing the visibility property - it's checking the stateful behavior ofshow()
andhide()
.These three tests (test_show_hide, test_hide_show, and test_visibility_noop) should be merged, testing the "show, show (no-op), hide, hide (no-op), show" sequence. The
visibility
test then only needs to verify that assigningvisibile = True
is an analog of show(), andvisible = False
is an analog of hide().