United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4999735 REGRESSION:Applet not repainting after resizing the browser (IE)
JDK-4999735 : REGRESSION:Applet not repainting after resizing the browser (IE)

Details
Type:
Bug
Submit Date:
2004-02-23
Status:
Closed
Updated Date:
2004-04-28
Project Name:
JDK
Resolved Date:
2004-03-30
Component:
deploy
OS:
windows_2000
Sub-Component:
plugin
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.2_03
Fixed Versions:
1.4.2_05 (05)

Related Reports

Sub Tasks

Description
With JRE 1.4.x and 1.4.2_03, Microsoft JVM disabled or not installed, applets will show "smearing" or other repaint artifacts when the browser window is
resized. I've found that the applet demos on the Sun site can be used to
illustrate the problem. It appears that the repaint only occurs when the
browser window is resized horizontally.

Steps to reproduce:

1) Open IE (6.1)
2) Access:
http://java.sun.com/docs/books/tutorial/uiswing/start/HelloSwingApplet.html
3) Resize the browser window by grabbing the right edge, moving it over
the applet, then back out

Note: It does not always happen. You may have to move in, release, move
out. You may have to resize fairly rapidly. It seems to happen with
horizonal resizing only, but I'm not certain of that. It could be that
with more complicated applets (such as ours) that the effect is
exacerbated.

This problem does not occur with JRE 1.3.1_03 (not tried later), nor
with the Microsoft JVM.

Attached is a bitmap showing the problem. The exact repainted image will
change, but parts are either left unpainted, or the previous background
"smears" without being erased.

                                    

Comments
SUGGESTED FIX

the webrev for the fix in tiger is at:
http://web-east.east/~ah22606/webrevs/2004/webrev-4844303/
###@###.### 2004-02-24
                                     
2004-02-24
EVALUATION

This problem is being addressed in tiger as: 
4844303: Applet does not repaint when browser window is resized.
fix for 4844303 needs to be backported to 1.4.2_02
###@###.### 2004-02-24

this seems to be related with 4774159 in the code that handles the
SetObjectRect
the following diff seems to fix the problem
AxControl.cpp

***************
*** 816,822 ****
        RECT rcIXect;
        BOOL b = IntersectRect(&rcIXect, prcPos, prcClip);
        HRGN tempRgn = NULL;
!       if (b && !EqualRect(&rcIXect, prcPos))
        {
            OffsetRect(&rcIXect, -(prcPos->left), -(prcPos->top));
            tempRgn = CreateRectRgnIndirect(&rcIXect);
--- 816,822 ----
        RECT rcIXect;
        BOOL b = IntersectRect(&rcIXect, prcPos, prcClip);
        HRGN tempRgn = NULL;
!       //if (b && !EqualRect(&rcIXect, prcPos))
        {
            OffsetRect(&rcIXect, -(prcPos->left), -(prcPos->top));
            tempRgn = CreateRectRgnIndirect(&rcIXect);
***************
*** 837,845 ****
        // Caused by scrolling, plugin window position will be changed, so we to avoid
        // multiple redraw by setting redraw flag to FALSE, only SetWindowPos will redraw
        // plugin window.
-               ::SetWindowRgn(m_hWnd, tempRgn, FALSE);
                ::SetWindowPos(m_hWnd, NULL, prcPos->left, prcPos->top, 
!                                  size.cx, size.cy, SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE);
                memcpy(&m_rectPrev, prcPos, sizeof(m_rectPrev));
        }
  
--- 837,846 ----
        // Caused by scrolling, plugin window position will be changed, so we to avoid
        // multiple redraw by setting redraw flag to FALSE, only SetWindowPos will redraw
        // plugin window.
                ::SetWindowPos(m_hWnd, NULL, prcPos->left, prcPos->top, 
!                                  size.cx, size.cy, SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE
!                                             | SWP_NOREDRAW);
!               ::SetWindowRgn(m_hWnd, tempRgn, TRUE);
                memcpy(&m_rectPrev, prcPos, sizeof(m_rectPrev));
        }
                                     
2004-06-11
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
1.4.2_05
generic

FIXED IN:
1.4.2_05

INTEGRATED IN:
1.4.2_05

VERIFIED IN:
1.4.2_05


                                     
2004-06-14



Hardware and Software, Engineered to Work Together