-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8305825: getBounds API returns wrong value resulting in multiple Regression Test Failures on Ubuntu 23.04 #16960
Conversation
…ession Test Failures on Ubuntu 23.04
👋 Welcome back azvegint! A progress list of the required criteria for merging this PR into |
@@ -458,6 +458,7 @@ java/awt/Graphics2D/DrawString/RotTransText.java 8316878 linux-all | |||
java/awt/KeyboardFocusmanager/TypeAhead/ButtonActionKeyTest/ButtonActionKeyTest.java 8257529 windows-x64 | |||
java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeForModalDialogTest/ConsumeForModalDialogTest.java 8302787 windows-all | |||
java/awt/KeyboardFocusmanager/TypeAhead/MenuItemActivatedTest/MenuItemActivatedTest.java 8302787 windows-all | |||
java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java 8321303 linux-all |
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.
This intermittent issue is more reproducible after the fix, however it was there before.
I am able to reproduce it with various JDK 11, 17, 19, 21, 22 (more info and a reproducer is available here)
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.
This test has been problematic in the past.
Eg https://bugs.openjdk.org/browse/JDK-8283896
@@ -651,6 +652,7 @@ javax/sound/sampled/Clip/ClipIsRunningAfterStop.java 8307574 linux-x64 | |||
|
|||
javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java 8233177 linux-all,windows-all | |||
|
|||
javax/swing/JFrame/MaximizeWindowTest.java 8321289 linux-all |
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 test was supposed to fail on Linux, but it didn't because of the misreported size. JDK-8321289
Webrevs
|
@honkar-jdk @alisenchung @aivanov-jdk please review |
@@ -1369,6 +1369,9 @@ Insets guessInsets(XDecoratedPeer window) { | |||
case UNITY_COMPIZ_WM: | |||
res = new Insets(28, 1, 1, 1); | |||
break; | |||
case MUTTER_WM: | |||
res = new Insets(37, 0, 0, 0); | |||
break; | |||
case MOTIF_WM: | |||
case OPENLOOK_WM: |
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.
Out of scope for this fix but in a future fix I think we can get rid of at least
(1) LG3D
(2) OPENLOOK
and very probably
(3) MOTIF
and perhaps also
(4) CDE
They are all obsolete.
@@ -458,6 +458,7 @@ java/awt/Graphics2D/DrawString/RotTransText.java 8316878 linux-all | |||
java/awt/KeyboardFocusmanager/TypeAhead/ButtonActionKeyTest/ButtonActionKeyTest.java 8257529 windows-x64 | |||
java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeForModalDialogTest/ConsumeForModalDialogTest.java 8302787 windows-all | |||
java/awt/KeyboardFocusmanager/TypeAhead/MenuItemActivatedTest/MenuItemActivatedTest.java 8302787 windows-all | |||
java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java 8321303 linux-all |
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.
This test has been problematic in the past.
Eg https://bugs.openjdk.org/browse/JDK-8283896
@azvegint This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 59 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@@ -1369,6 +1369,9 @@ Insets guessInsets(XDecoratedPeer window) { | |||
case UNITY_COMPIZ_WM: | |||
res = new Insets(28, 1, 1, 1); | |||
break; | |||
case MUTTER_WM: | |||
res = new Insets(37, 0, 0, 0); |
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.
How did you come up with the numbers for these insets?
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.
They are obtained from the system, and are a default value for the Gnome shell (which uses Mutter WM).
You can get them with window.getInsets()
.
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.
Tested on Ubuntu 23.04 with X11. Code and test changes look good.
Minor: Copyright year needs to be updated for few test files.
/integrate |
Going to push as commit 632a3c5.
Your commit was automatically rebased without conflicts. |
Did you check that these empty values are actually correct? I mean the empty insets are actually real insets of the window which later changed to the correct one? Maybe we should report this upstream? |
The root of this issue is the incorrect calculation of window decoration insets.
Previously we got non-zero window insets in the first PropertyNotify with _NET_FRAME_EXTENTS atom, save them and never change them again.
This changed starting with Ubuntu 23.04:
Now we can get several such notifications with zero window insets, and only then the correct value.
Our code is not ready for this. It affects all our JDK. As a result, many tests fail on Ubuntu 23.04 and 23.10.
The solution is to change these insets on the fly, for now only for Mutter window manager.
The guessInsets for it have also been updated.
This also means that some tests need some stabilization as they are not ready for such late arrival of window insets.
Testing looks good.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16960/head:pull/16960
$ git checkout pull/16960
Update a local copy of the PR:
$ git checkout pull/16960
$ git pull https://git.openjdk.org/jdk.git pull/16960/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16960
View PR using the GUI difftool:
$ git pr show -t 16960
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16960.diff
Webrev
Link to Webrev Comment