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

Anton Litvinov alitvinov at openjdk.java.net
Mon Dec 14 14:38:59 UTC 2020


On Wed, 9 Dec 2020 20:14:01 GMT, Anton Litvinov <alitvinov at openjdk.org> wrote:

> 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

This pull request has now been integrated.

Changeset: e8c40baf
Author:    Anton Litvinov <alitvinov at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/e8c40baf
Stats:     199 lines in 2 files changed: 199 ins; 0 del; 0 mod

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

Reviewed-by: prr, serb

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

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


More information about the awt-dev mailing list