JDK-6204874 : Applets comes to flicker in 5.0 when browser is scrolling
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-12-07
  • Updated: 2010-07-29
  • Resolved: 2006-10-30
Related Reports
Duplicate :  
Relates :  
Description
When we scroll an applet in a explorer in 5.0fcs, many flickers occurs much more 
than in 1.4.2_06.

REPRODUCE:
 1) Compile the attached program(ScaleTestApplet.java)
 2) Invoke the attached html file(ScaleTestApplet.html) in IE 
 3) resize down the browser insomuch as vertical/horizontal scroll bars appear
   (please see the attached jpg sample_size.jpg)
 4) Scroll up and down slowly in vertical scroll bar
    --> otherwise, click '^' or 'v'(scroll buttons)
   You will see the applet flickers so frequently on redraw

CONFIGURATION:
  JRE : 5.0fcs
  OS: WindowsXP(SP1, Japanese)
  Browser : Internet Explorer 6.0(SP1)

NOTE:
  Please try in 1.4.2_06 also and compare with 5.0fcs.
  We can find out the flickring has increased in 5.0fcs


###@###.### 2004-12-07 02:35:13 GMT

Comments
SUGGESTED FIX ###@###.### suggested to add a new private API: void disableBackgroundErase(Canvas canvas) I am fairly confident that this would reduce the flickering a lot but may not eliminate completely.
14-12-2005

EVALUATION ###@###.### noticed that the fix for 6333613 may help in reducing the flickering issue.
14-12-2005

EVALUATION The suggested fix fixes the problem, but not completely. If the user scrolls by "grabbing" the scrollbar with the mouse and scrolling, then the flickering problem no longer shows up. However, if the user uses the scroll buttons, the user will see "fractures" in the scrolling image.
14-10-2005

SUGGESTED FIX ------- AxControl.cpp ------- *** /tmp/sccs.OGaqLh Fri Aug 26 11:39:58 2005 --- AxControl.cpp Fri Aug 26 11:39:03 2005 *************** *** 890,896 **** // When this happens, SetWindowPos will not redraw the plugin window due to no // position/size change, so we have to have SetWindowRgn to redraw the window. if(EqualRect(&m_rectPrev, prcPos)) { ! ::SetWindowRgn(m_hWnd, tempRgn, (size.cx > 0 && size.cy > 0)); } else { // Caused by scrolling, plugin window position will be changed, so we avoid --- 890,896 ---- // When this happens, SetWindowPos will not redraw the plugin window due to no // position/size change, so we have to have SetWindowRgn to redraw the window. if(EqualRect(&m_rectPrev, prcPos)) { ! ::GetUpdateRgn(m_hWnd, tempRgn, (size.cx > 0 && size.cy > 0)); } else { // Caused by scrolling, plugin window position will be changed, so we avoid *************** *** 897,905 **** // multiple redraw by setting SetWindowPos's redraw flag to SWP_NOREDRAW, but // setting SetWindowRgn's redraw flag to TRUE. ::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)); } --- 897,904 ---- // multiple redraw by setting SetWindowPos's redraw flag to SWP_NOREDRAW, but // setting SetWindowRgn's redraw flag to TRUE. ::SetWindowPos(m_hWnd, NULL, prcPos->left, prcPos->top, ! size.cx, size.cy, SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOREDRAW); ! ::GetUpdateRgn(m_hWnd, tempRgn, (size.cx > 0 && size.cy > 0)); memcpy(&m_rectPrev, prcPos, sizeof(m_rectPrev)); }
26-08-2005

EVALUATION This bug isn't reprodcible in Mustang so I've removed mustang from the "Targeted Release". It is still reproducible with the promoted build of 5.0u6 b02. I've a suggested fix on the plugin side. However, I'm suspecting some code changes in 5.0 on the awt side created this problem. The suggested fix on the plugin side is more like a workaround fix.
26-08-2005

WORK AROUND For 5.0 update releases, one can set the following java runtime parameter using the java control panel to workaournd this flickering issue: -Dsun.awt.noerasebackground=true ###@###.### 2005-04-19 01:49:32 GMT
07-12-2004