-
Bug
-
Resolution: Fixed
-
P2
-
6u10
-
b04
-
generic
-
windows
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2177444 | 7 | Artem Ananiev | P4 | Closed | Fixed | b60 |
Many external developers complain about translucent windows performance, for example:
http://www.miginfocom.com/blog/?p=30
The current implementation of non-opaque windows in AWT/Swing is ugly. Here is a rough sequence of events for *every* user- or system-triggered repaint:
1. Repaint request is registered by Swing (RepaintManager).
2. Somewhen later, RepaintManager processes all the dirty regions - see RepaintManager.paintDirtyRegions().
3. All the dirty components in non-opaque windows are removed from the list to repaint, and the corresponding windows are updated with Window.updateWindow(null) call - see RepaintManager.updateWindows().
4. updateWindows(null) forwards to peer.updateWindow(null) and then to TranslucentWindowPainter.updateWindow(null).
5. As the given image is null, the latter method calls window.paintAll() to get the whole window contents.
See attached test to reproduce the problem. It shows a frame with a JButton and JTextArea at the bottom. The button changes window's opacity on and off, and text area prints all the upcoming paint() calls to the console. Launch the test, press button, observe the window gets non-opaque. Move the mouse over the button to trigger hover effect. If you see the text area is repainted on button hover, the bug is reproduced.
http://www.miginfocom.com/blog/?p=30
The current implementation of non-opaque windows in AWT/Swing is ugly. Here is a rough sequence of events for *every* user- or system-triggered repaint:
1. Repaint request is registered by Swing (RepaintManager).
2. Somewhen later, RepaintManager processes all the dirty regions - see RepaintManager.paintDirtyRegions().
3. All the dirty components in non-opaque windows are removed from the list to repaint, and the corresponding windows are updated with Window.updateWindow(null) call - see RepaintManager.updateWindows().
4. updateWindows(null) forwards to peer.updateWindow(null) and then to TranslucentWindowPainter.updateWindow(null).
5. As the given image is null, the latter method calls window.paintAll() to get the whole window contents.
See attached test to reproduce the problem. It shows a frame with a JButton and JTextArea at the bottom. The button changes window's opacity on and off, and text area prints all the upcoming paint() calls to the console. Launch the test, press button, observe the window gets non-opaque. Move the mouse over the button to trigger hover effect. If you see the text area is repainted on button hover, the bug is reproduced.
- backported by
-
JDK-2177444 Translucent windows are completely repainted on every paint event, on Windows
- Closed
- relates to
-
JDK-6884960 java/awt/Window/TranslucentJAppletTest/TranslucentJAppletTest.java fails
- Resolved
-
JDK-6683775 Painting artifacts is seen when panel is made setOpaque(false) for a translucent window
- Closed
-
JDK-6848852 PIT:test/javax/swing/JComponent/6683775/bug6683775.java on linux with RuntimeException.
- Closed
-
JDK-2169928 Repainting artifacts when resizing or dragging JInternalFrames in non-opaque toplevel
- Closed