Skip to content

Conversation

@alitvinv
Copy link
Member

@alitvinv alitvinv commented Dec 9, 2020

Hello colleagues,

Could you please review the fix for the bug specific to Linux OS and Solaris OS, which consists in the fact that, if Swing components are changed through standard public API of these components, while the frame containing these components is in "Frame.ICONIFIED" state or in other words minimized, then, when the frame becomes deiconified the UI of the Swing components does not reflect those changes.

ROOT CAUSE OF THE BUG:
"javax.swing.RepaintManager.addDirtyRegion0(Container, int, int, int, int)" by design prevents updating regions of containers, when the containers are inside a frame with "Frame.ICONIFIED" state. And at the same time Linux OS specific JDK code does not initiate repaint of the frame, when the frame's peer is notified about change of state from "Frame.ICONIFIED" to other state. More details are available in the bug record.

THE FIX:
The fix adds code to the method "sun.awt.X11.XFramePeer.handlePropertyNotify(XEvent)" which calls "repaint()" for instance of "XFramePeer", if its state changed from "Frame.ICONIFIED". The fix repeats the approach already existing in macOS specific code, which is in the method "sun.lwawt.LWWindowPeer.notifyIconify(boolean)".

Thank you,
Anton


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8255880: UI of Swing components is not redrawn after their internal state changed

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1722/head:pull/1722
$ git checkout pull/1722

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 9, 2020

👋 Welcome back alitvinov! 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 9, 2020
@openjdk
Copy link

openjdk bot commented Dec 9, 2020

@alitvinv The following labels will be automatically applied to this pull request:

  • awt
  • swing

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added swing client-libs-dev@openjdk.org awt client-libs-dev@openjdk.org labels Dec 9, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 9, 2020

Webrevs

@prrace
Copy link
Contributor

prrace commented Dec 11, 2020

The fix looks reasonable although I am surprised such an issue has existed for what I suppose is a long time.
One nit about the test regarding the requires.
It can't require solaris because there is no solaris support in JDK 16.
So unless you think this test will fail on other platforms (I hope not) it may be best to just remove this line.

@openjdk
Copy link

openjdk bot commented Dec 13, 2020

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

8255880: UI of Swing components is not redrawn after their internal state changed

Reviewed-by: prr, 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 211 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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 13, 2020
@alitvinv
Copy link
Member Author

Hello Phil. Thank you for review and already approval of the 2nd version of the fix, which has just been pushed in this branch. In the second commit I removed completely "@requires" tag from the regression test by your request. I verified that this test passes on Windows OS, macOS, Linux OS.

@alitvinv
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Dec 14, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 14, 2020
@openjdk
Copy link

openjdk bot commented Dec 14, 2020

@alitvinv Since your change was applied there have been 214 commits pushed to the master branch:

  • 1548104: 8255477: Remove unused method URL.set(String protocol, String host, int port, String file, String ref)
  • e69ae07: 8257985: count_trailing_zeros doesn't handle 64-bit values on 32-bit JVM
  • 2ee795d: 8196092: javax/swing/JComboBox/8032878/bug8032878.java fails
  • c30fff7: 8257229: gtest death tests fail with unrecognized stderr output
  • e118292: 8258040: Reenable fixed problemlisted test
  • 74b79c6: 8257964: Broken Calendar#getMinimalDaysInFirstWeek with java.locale.providers=HOST
  • f9c9bf0: 8255583: Investigate creating a test to trigger the condition in KeepAliveStreamCleaner
  • 8273514: 8166026: Refactor java/lang shell tests to java
  • ff75ad5: 8258059: Clean up MethodData::profile_unsafe
  • b5592c0: 8257970: Remove julong types in os::limit_heap_by_allocatable_memory
  • ... and 204 more: https://git.openjdk.java.net/jdk/compare/56b15fbbcc7c04252f2712d859ff7b820b7c79ad...master

Your commit was automatically rebased without conflicts.

Pushed as commit e8c40ba.

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

@alitvinv alitvinv deleted the JDK-8255880 branch December 17, 2020 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awt client-libs-dev@openjdk.org integrated Pull request has been integrated swing client-libs-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

3 participants