Skip to content

Conversation

@kumarabhi006
Copy link
Contributor

@kumarabhi006 kumarabhi006 commented Dec 7, 2022

In case of GTK LAF, the current selected element was not visible due to arrowbutton is rendered in entire display area of Combobox.

The proposed fix is to set the squareButton property of combobox to false so that the arrowbutton didn't take entire combobox display area for rendering. The getMinimumSize method is overridden in SynthComboBoxUI to consider arrowbutton insets for combobox minimum size.

The JCK tests mentioned in JBS seems fine with the fix.
An automated test case is implemented to test in Nimbus and GTK LAF. The text color check is to ensure the current selected item is visible.

When clientlibs tests are run with LAF set to Nimbus and GTK LAF, few test failures observed.

javax/swing/JComboBox/4523758/bug4523758.java test failed with current fix in GTK LAF.
open/test/jdk/javax/swing/JComboBox/TestComboBoxHeight.java test passes if run in GTK LAF with current fix.

In Nimbus LAF, the failures before and after fix has no issues as such.

Although CI jobs looks ok with tests run in their default set LAFs.


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-8218474: JComboBox display issue with GTKLookAndFeel

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11555

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 7, 2022

👋 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 openjdk bot added the rfr Pull request is ready for review label Dec 7, 2022
@openjdk
Copy link

openjdk bot commented Dec 7, 2022

@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 Dec 7, 2022
@mlbridge
Copy link

mlbridge bot commented Dec 7, 2022

Webrevs

@mrserb
Copy link
Member

mrserb commented Dec 7, 2022

Looks like the JBS issue is closed:
⚠️ Failed to retrieve information on issue 8218474.

@kumarabhi006
Copy link
Contributor Author

Looks like the JBS issue is closed: ⚠️ Failed to retrieve information on issue 8218474.

https://bugs.openjdk.org/browse/JDK-8218474

It seems it is not closed.

@mrserb
Copy link
Member

mrserb commented Dec 7, 2022

No it is confidential or something like that. Cannot open/view it.

Copy link
Contributor

@TejeshR13 TejeshR13 left a comment

Choose a reason for hiding this comment

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

TestComboBoxComponentRendering.java test failed (Synth L&F) in Ubuntu_21 VM machine. .jtr file and Failure case screen captured shared.

@kumarabhi006
Copy link
Contributor Author

kumarabhi006 commented Dec 12, 2022

No it is confidential or something like that. Cannot open/view it.

@mrserb The bug is open now. Please have a look.

@kumarabhi006
Copy link
Contributor Author

TestComboBoxComponentRendering.java test failed (Synth L&F) in Ubuntu_21 VM machine. .jtr file and Failure case screen captured shared.

Run the test in Ubuntu 20,21 and 22 in CI pipeline, test passed for all platform.

@kumarabhi006
Copy link
Contributor Author

@mrserb Please have a look.

@TejeshR13
Copy link
Contributor

TestComboBoxComponentRendering.java test failed (Synth L&F) in Ubuntu_21 VM machine. .jtr file and Failure case screen captured shared.

Run the test in Ubuntu 20,21 and 22 in CI pipeline, test passed for all platform.

The issue was that I was running in wayland, not xorg. The fix is tested and works fine

//adjust the size based on the button width
size.height += insets.top + insets.bottom + arrowInsets.top
+ arrowInsets.bottom;
size.width += insets.left + insets.right +arrowInsets.left
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
size.width += insets.left + insets.right +arrowInsets.left
size.width += insets.left + insets.right + arrowInsets.left

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

buttonHeight :
arrowButton.getPreferredSize().width;
//adjust the size based on the button width
size.height += insets.top + insets.bottom + arrowInsets.top
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure that the arrow insets should be applied on top of the component's insets, probably the maximum of both should be selected?

Copy link
Contributor Author

@kumarabhi006 kumarabhi006 Jan 3, 2023

Choose a reason for hiding this comment

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

For combobox text to render correctly arrow inset need to be applied otherwise the combobox editor shows "..." even for a smaller text.

Since component inset's return (0, 0, 0, 0) in GTK and Nimbus LAF, didn't take the maximum of both into consideration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mrserb Are you ok with the fix or do you want anything to add?

@openjdk
Copy link

openjdk bot commented Jan 9, 2023

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

8218474: JComboBox display issue with GTKLookAndFeel

Reviewed-by: tr, serb

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

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@TejeshR13, @mrserb) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 9, 2023
@kumarabhi006
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jan 9, 2023
@openjdk
Copy link

openjdk bot commented Jan 9, 2023

@kumarabhi006
Your change (at version ea53f8a) is now ready to be sponsored by a Committer.

@TejeshR13
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Jan 9, 2023

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 9, 2023

@TejeshR13 @kumarabhi006 Pushed as commit c444922.

💡 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