-
Notifications
You must be signed in to change notification settings - Fork 5.9k
8335130: The test "javax/swing/plaf/synth/ComponentsOrientationSupport/5033822/bug5033822.java" fails because the background color of the tabs is displayed incorrectly. #20091
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
Conversation
👋 Welcome back abhiscxk! A progress list of the required criteria for merging this PR into |
@kumarabhi006 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 531 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 |
@kumarabhi006 The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
// Fill the tab rect area | ||
g.fillRect(x, y, w, h); | ||
// Fill the tab rect area | ||
g.fillRect(x, y, w, h); |
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.
I see that the original fix added these lines to GTKPainter. If the fix is being moved individual L&F files is this still needed?
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.
Yeah , it is still needed to paint the tab area correctly. Only the condition check part is being moved to individual L&F files in this PR.
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.
I get that the previous issue adds tabsOpaque
as a fix to check before applying some logic. I also understand that this breaks custom LAFs (synth) so moving the fix to GTK & Nimbus seems fair to move it out of Synth.
But why does this only apply to custom LAFs? What does Nimbus and GTK do differently? Because I'm assuming the fix was for all 3 before, but now you're just removing the fix from Synth and applying it to GTK & Nimbus.
The painter for the GTK, Nimbus and custom xml based synth style is different and that is the reason when custom xml is used the painting is done differently. In this case the custom painter is ParsedSynthStyle's Delegating Painter which invokes ImagePainter's paintTabbedPaneTabBackground API to paint the tabs using the image mentioned in xml file (i.e. path). Nimbus and GTK tabs are painted using L&F defined colors whereas custom based L&F tabs are painted images for their background color if images are valid. |
tabContext.getPainter().paintTabbedPaneTabBackground(tabContext, g, | ||
x, y, width, height, tabIndex, placement); | ||
} | ||
tabContext.getPainter().paintTabbedPaneTabBackground(tabContext, g, |
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.
what about the check tabPane.isOpaque()))
in l764, will it still be needed?
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.
Yeah, it is still needed. If contentOpaque
property is set to false
but tabPane opacity is set to true
, then the content area needs to fill with the set graphics color.
By default tabPane.isOpaque()
return false
, it depends on the contentOpaque property to have a effect on content area background filling.
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.
Is it not possible to opensource the test along with this fix?
This bugid needs to be added in the tag..
There are few png images associated with the test and most probably it can be open sourced but I am not sure.
ok. |
@prsadhuk bugid updated in the tag. What do you suggest about moving the test to open? |
Seems like the image files are being used in xml file and not in java where probably we could have used some bufferedimage.. |
ok. |
/integrate |
Going to push as commit 9ab8c6b.
Your commit was automatically rebased without conflicts. |
@kumarabhi006 Pushed as commit 9ab8c6b. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Issue is due to the condition added for the opaque property of SynthTabbedPane in JDK-8226990. The previous fix for GTK and Nimbus was handled commonly in
SynthTabbedPaneUI
class to render the tabs based on opaque property. Since the Synth package is responsible to create a custom L&F using user defined XML file. In this test the L&F is fetched through the XML file and whenSynthTabbedPaneUI
APIs are invoked for the tab rendering, it is not correctly rendered. Setting the opaque property to true also doesn't help as the selected tab is rendered incorrectly. The proposed fix is to move the fix to GTK and Nimbus specific class and that will not cause any impact on custom xml based L&F.Progress
Warning
8335130: The test "javax/swing/plaf/synth/ComponentsOrientationSupport/5033822/bug5033822.java" fails because the background color of the tabs is displayed incorrectly.
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20091/head:pull/20091
$ git checkout pull/20091
Update a local copy of the PR:
$ git checkout pull/20091
$ git pull https://git.openjdk.org/jdk.git pull/20091/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20091
View PR using the GUI difftool:
$ git pr show -t 20091
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20091.diff
Webrev
Link to Webrev Comment