Skip to content

Conversation

@prsadhuk
Copy link
Contributor

@prsadhuk prsadhuk commented Nov 27, 2024

When a textfield is embedded in a TableCellEditor in a JTable in Aqua L&F and space is entered and caret moved back and forth by pressing left/right arrow button, an artifact is seen, which is basically the caret is not properly repainted leaving behind its trails.

When caret is moved, it is repainted every time by "damaging" the area surrounding the caret to cause it to be repainted in a new location. AquaCaret overrides the default "damage" code to intersect the caret area with the border insets so that it does not damage the AquaBorder area..
For TextField case, AquaTextFieldBorder insets is removed from AquaTextField and then intersected with AquaCaret to get the dirry region which is then repainted, so as to not damage the border but it is done irrespective of whether border is shown or not, so proper dirty region is not repainted leaving behind artifacts when the caret is moved around...

Fix is to see if border to be painted is not opaque in which case the proper dirty region is calculated which is then used in repaint logic to repaint the component..


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

Issue

  • JDK-8268145: [macos] Rendering artifacts is seen when text inside the JTable with TableCellEditor having JTextfield (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22416/head:pull/22416
$ git checkout pull/22416

Update a local copy of the PR:
$ git checkout pull/22416
$ git pull https://git.openjdk.org/jdk.git pull/22416/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22416

View PR using the GUI difftool:
$ git pr show -t 22416

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22416.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 27, 2024

👋 Welcome back psadhukhan! 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 Nov 27, 2024

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

8268145: [macos] Rendering artifacts is seen when text inside the JTable with TableCellEditor having JTextfield

Reviewed-by: kizune, abhiscxk, honkar

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 218 new commits pushed to the master branch:

  • 5cc150c: 8342979: Start of release updates for JDK 25
  • 85fedbf: 8344607: Link Time Optimization - basic support for clang
  • 5a0899f: 8345302: Building microbenchmarks require larger Java heap
  • 1ece4f9: 8345514: Should use internal class name when calling ClassLoader.getResourceAsByteArray
  • ef8da28: 8345591: [aarch64] macroAssembler_aarch64.cpp compile fails ceil_log2 not declared
  • 7513b13: 8328944: NMT reports "unknown" memory
  • 691e692: 8345565: Remove remaining SecurityManager motivated APIs from sun.reflect.util
  • 97b8a09: 8345339: JFR: Missing javadoc for RecordingStream::onMetadata
  • 456c71d: 8343699: [aarch64] Bug in MacroAssembler::klass_decode_mode()
  • 308357c: 8345578: New test in JDK-8343622 fails with a promoted build
  • ... and 208 more: https://git.openjdk.org/jdk/compare/fc2da15bcee9560186058b3e2fd12ddcb0eb0f39...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 Nov 27, 2024

@prsadhuk 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 Nov 27, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 27, 2024
@mlbridge
Copy link

mlbridge bot commented Nov 27, 2024

Webrevs

"inactive forever"}},
new Object[] {"1", "2"});

JFrame frame = new JFrame();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFrame title is missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment on lines +205 to +209
} else {
x = alloc.x;
y = alloc.y;
width = alloc.width;
height = alloc.height;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the test case tests the else branch (no border case), since the if branch is also modified, would it be better to test both cases - with and without border?

Copy link
Contributor Author

@prsadhuk prsadhuk Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is already being tested by existing testcases in CI and if I am not wrong by SwingSet2 too and there is no change in logic in the if branch, when it enters the branch..

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 28, 2024
Copy link
Contributor

@kumarabhi006 kumarabhi006 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test verified and it works as expected.

Copy link
Contributor

@honkar-jdk honkar-jdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestCaretArtifact (no-border case) and SwingSet2 (with border) work as expected with the fix.

Do this few times.
If artifact is seen, press Fail else press Pass.""";

public static void main(String[] args) throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nitpick but I think there's an extra whitespace here after void

}


public static JFrame createUI() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra whitespace here too

@prsadhuk
Copy link
Contributor Author

prsadhuk commented Dec 6, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Dec 6, 2024

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

  • aa38284: 8345435: Eliminate tier1_compiler_not_xcomp group
  • 9284602: 8345628: [BACKOUT] JDK-8287122 Use gcc12 -ftrivial-auto-var-init=pattern in debug builds
  • 41c8971: 8287122: Use gcc12 -ftrivial-auto-var-init=pattern in debug builds
  • 5da0eee: 8285692: Enable _FORTIFY_SOURCE=2 when building with Clang
  • daa2ba5: 8339622: Regression in make open-hotspot-xcode-project
  • 6f6bce5: 8344559: Log is spammed by missing pandoc warnings when building man pages
  • 5f30a8d: 8345424: Move FindDebuginfoFiles out of FileUtils.gmk
  • bf0debc: 8343890: SEGV crash in RunTimeClassInfo::klass
  • a97dca5: 8344593: GenShen: Review of ReduceInitialCardMarks
  • bedb68a: 8342444: Shenandoah: Uncommit regions from a separate, STS aware thread
  • ... and 219 more: https://git.openjdk.org/jdk/compare/fc2da15bcee9560186058b3e2fd12ddcb0eb0f39...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Dec 6, 2024

@prsadhuk Pushed as commit 8403285.

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

@prsadhuk prsadhuk deleted the JDK-8268145 branch December 6, 2024 03:19
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.

5 participants