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
8326619: Stage.sizeToScene() on maximized/fullscreen Stage breaks the Window #1382
base: master
Are you sure you want to change the base?
8326619: Stage.sizeToScene() on maximized/fullscreen Stage breaks the Window #1382
Conversation
👋 Welcome back mhanl! A progress list of the required criteria for merging this PR into |
Webrevs
|
Since this involved changing the specified behavior it will need a CSR. If we agree that this is the right behavior, then the CSR will be trivial. /csr |
@kevinrushforth has indicated that a compatibility and specification (CSR) request is needed for this pull request. @Maran23 please create a CSR request for issue JDK-8326619 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
@kevinrushforth |
This seems like a reasonable fix and spec change. Have you tested the case of calling sizeToScene before setting full-screen or maximzed? Since the pending flag will still be set in that case, I want to make sure that case is tested as well. Also, if this fixed JDK-8316425, then that bug should be closed as a duplicate of this one. @lukostyra @arapte can you also review this? |
Btw, I get the following test failures on our headful Linux test systems:
This seems unrelated to your fix. I think the problem might be that in full-screen mode the stage can be bigger than the visible screen size or maybe the decorations are just larger on that system. You might either need to increase the tolerance values or instead check for >= visible width / height (possibly with some small tolerance). |
I thought about this as well but could not find any problem at least on Windows. I used the following code to test this, and it didn't matter when
|
❗ This change is not yet ready to be integrated. |
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.
LGTM, tests also seem to be fine on my end (checked on Windows and Ubuntu 22.04 LTS)
@Maran23 This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
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 fix looks good. The spec changes (updated javadocs) look good. Can you create the CSR for the spec change?
I have a couple overall comments:
- I wanted to verify different orders of operation, so I wrote a (manual) test program and attached it to the JBS bug. It covers the following cases:
- set ; sizeToScene ; show
- sizeToScene ; set ; show
- show ; set ; sizeToScene
- show ; sizeToScene ; set
I verified that the first 3 are broken today. All cases work with your fix. I think it might be a good idea to add automated tests for the different orderings.
- Please merge the latest master. Note that the calls to Util.shutdown in the tests must be fixed after this is done or they will no longer compile.
tests/system/src/test/java/test/javafx/stage/SizeToSceneFullscreenTest.java
Outdated
Show resolved
Hide resolved
tests/system/src/test/java/test/javafx/stage/SizeToSceneMaximizeTest.java
Outdated
Show resolved
Hide resolved
@Maran23 I think this is pretty close to being ready to go in. At a minimum, you will need to merge master and then fix the test so that it will compile, and then create a CSR with the updated specification (I can help with that if needed). My only other suggestion was around additional tests that might be useful, but they could be done as a follow-on fix. |
Yes, sure, I've just been very busy with my day job over the last few weeks. I hopefully have more time now though :) |
…619-maximize-minimize-scene
I'm retesting and writing tests right now and reproduced one usecase out of my head that indeed 'fails' now.
With my logic, the If I do instead:
The flag is remembered and the scene has the size of the button. Not sure what the expectation is here, but we could fix this problem by still remembering the flag if called. |
…eToScene() request is allowed. Implement much more tests
This PR fixes the problem that maximizing/fullscreen a
Stage
orDialog
is broken whensizeToScene()
was called before or after.The approach here is to ignore the
sizeToScene()
request when theStage
is maximized or set to fullscreen.Otherwise the Window Manager of the OS will be confused and you will get weird flickering or wrong Window buttons (e.g. on Windows, the 'Maximize' button still shows the 'Restore' Icon, while we already resized the
Stage
to not be maximized).Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1382/head:pull/1382
$ git checkout pull/1382
Update a local copy of the PR:
$ git checkout pull/1382
$ git pull https://git.openjdk.org/jfx.git pull/1382/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1382
View PR using the GUI difftool:
$ git pr show -t 1382
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1382.diff
Webrev
Link to Webrev Comment