<AWT Dev> RFR: 8255880: UI of Swing components is not redrawn after their internal state changed

Anton Litvinov alitvinov at openjdk.java.net
Wed Dec 9 20:19:42 UTC 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

-------------

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

Changes: https://git.openjdk.java.net/jdk/pull/1722/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1722&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8255880
  Stats: 200 lines in 2 files changed: 200 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1722.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1722/head:pull/1722

PR: https://git.openjdk.java.net/jdk/pull/1722


More information about the awt-dev mailing list