Skip to content
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

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

Closed
wants to merge 2 commits into from

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 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 label Dec 9, 2020
@openjdk
Copy link

@openjdk 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.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Dec 9, 2020

Webrevs

@prrace
Copy link
Contributor

@prrace 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.

prrace
prrace approved these changes Dec 13, 2020
@openjdk
Copy link

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

  • 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
  • b28b094: 8257145: Performance regression with -XX:-ResizePLAB after JDK-8079555
  • fa20186: 8257676: Simplify WeakProcessorPhase
  • b90b7f5: 8196090: javax/swing/JComboBox/6559152/bug6559152.java fails
  • ... and 201 more: https://git.openjdk.java.net/jdk/compare/56b15fbbcc7c04252f2712d859ff7b820b7c79ad...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 openjdk bot added the ready label Dec 13, 2020
@alitvinv
Copy link
Member Author

@alitvinv alitvinv commented Dec 14, 2020

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.

mrserb
mrserb approved these changes Dec 14, 2020
@alitvinv
Copy link
Member Author

@alitvinv alitvinv commented Dec 14, 2020

/integrate

@openjdk openjdk bot closed this Dec 14, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Dec 14, 2020
@openjdk
Copy link

@openjdk 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 Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants