Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

kumarabhi006
Copy link
Contributor

@kumarabhi006 kumarabhi006 commented Jul 9, 2024

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 when SynthTabbedPaneUI 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

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Warning

 ⚠️ Found trailing period in issue title for 8335130: The test "javax/swing/plaf/synth/ComponentsOrientationSupport/5033822/bug5033822.java" fails because the background color of the tabs is displayed incorrectly.

Issue

  • JDK-8335130: The test "javax/swing/plaf/synth/ComponentsOrientationSupport/5033822/bug5033822.java" fails because the background color of the tabs is displayed incorrectly. (Bug - P3)

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 9, 2024

👋 Welcome back abhiscxk! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jul 9, 2024

@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:

8335130: The test "javax/swing/plaf/synth/ComponentsOrientationSupport/5033822/bug5033822.java" fails because the background color of the tabs is displayed incorrectly.

Reviewed-by: achung, psadhukhan

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 master branch:

  • f92c60e: 8337810: ProblemList BasicDirectoryModel/LoaderThreadCount.java on Windows
  • 0d8ec42: 8337642: Remove unused APIs of GCPolicyCounters
  • 2057594: 8337782: Use THROW_NULL instead of THROW_0 in pointer contexts in prims code
  • 73718fb: 8337788: RISC-V: Cleanup code in MacroAssembler::reserved_stack_check
  • 965d6b9: 8335836: serviceability/jvmti/StartPhase/AllowedFunctions/AllowedFunctions.java fails with unexpected exit code: 112
  • 7146dae: 8337783: Use THROW_NULL instead of THROW_0 in pointer contexts in misc runtime code
  • 431d4f7: 8337785: Fix simple -Wzero-as-null-pointer-constant warnings in x86 code
  • e2c07d5: 8337299: vmTestbase/nsk/jdb/stop_at/stop_at002/stop_at002.java failure goes undetected
  • 08f697f: 8337819: Update GHA JDKs to 22.0.2
  • 42652b2: 8337787: Fix -Wzero-as-null-pointer-constant warnings when JVMTI feature is disabled
  • ... and 521 more: https://git.openjdk.org/jdk/compare/e227c7e37d4de0656f013f3a936b1acfa56cc2e0...master

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 master branch, type /integrate in a new comment.

@openjdk
Copy link

openjdk bot commented Jul 9, 2024

@kumarabhi006 The following label will be automatically applied to this pull request:

  • client

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.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Jul 9, 2024
// Fill the tab rect area
g.fillRect(x, y, w, h);
// Fill the tab rect area
g.fillRect(x, y, w, h);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 15, 2024
@mlbridge
Copy link

mlbridge bot commented Jul 15, 2024

Webrevs

Copy link
Contributor

@DamonGuy DamonGuy left a 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.

@kumarabhi006
Copy link
Contributor Author

kumarabhi006 commented Jul 17, 2024

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,
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@prsadhuk prsadhuk left a 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..

@kumarabhi006
Copy link
Contributor Author

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.

This bugid needs to be added in the tag..

ok.

@kumarabhi006
Copy link
Contributor Author

@prsadhuk bugid updated in the tag. What do you suggest about moving the test to open?

@prsadhuk
Copy link
Contributor

prsadhuk commented Aug 6, 2024

Seems like the image files are being used in xml file and not in java where probably we could have used some bufferedimage..
png headers doesn't show any copyright as far I could see but still not sure if those images can be opensourced..
Ok for now to be in closed..

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 6, 2024
@kumarabhi006
Copy link
Contributor Author

Seems like the image files are being used in xml file and not in java where probably we could have used some bufferedimage.. png headers doesn't show any copyright as far I could see but still not sure if those images can be opensourced.. Ok for now to be in closed..

ok.

@kumarabhi006
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Aug 9, 2024

Going to push as commit 9ab8c6b.
Since your change was applied there have been 571 commits pushed to the master branch:

  • 0c1e911: 8338019: Fix simple -Wzero-as-null-pointer-constant warnings in riscv code
  • 55c5097: 8337331: crash: pinned virtual thread will lead to jvm crash when running with the javaagent option
  • 9f08a01: 8338010: WB_IsFrameDeoptimized miss ResourceMark
  • e7a0b5b: 8334780: Crash: assert(h_array_list.not_null()) failed: invariant
  • bfb75b9: 8336926: jdk/internal/util/ReferencedKeyTest.java can fail with ConcurrentModificationException
  • 53c9f03: 8336849: Remove .llvm_addrsig section from JDK/VM static libraries (.a files)
  • 9695f09: 8337683: Fix -Wconversion problem with arrayOop.hpp
  • 78773b1: 8338015: Fix "Java Java" typo in package info file of java.lang.classfile
  • 6a9a867: 8337994: [REDO] Native memory leak when not recording any events
  • 4b740d8: 8225209: jdk/jfr/event/compiler/TestCodeSweeper.java fails
  • ... and 561 more: https://git.openjdk.org/jdk/compare/e227c7e37d4de0656f013f3a936b1acfa56cc2e0...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 9, 2024
@openjdk openjdk bot closed this Aug 9, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Aug 9, 2024
@openjdk
Copy link

openjdk bot commented Aug 9, 2024

@kumarabhi006 Pushed as commit 9ab8c6b.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants