United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6825342 Security warning may change Z-order of top-level
JDK-6825342 : Security warning may change Z-order of top-level

Details
Type:
Bug
Submit Date:
2009-04-02
Status:
Closed
Updated Date:
2011-03-07
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
client-libs
OS:
windows
Sub-Component:
java.awt
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:
Relates:

Sub Tasks

Description
Please use the testcase attached to the CR 6770457 to reproduce the problem

The steps to reproduce the bug are

- there are two windows: the browser window and the"W2" dialog
- the browser window is on the top and the "W2" dialog is behind the browser window
- the browser window partially covers the "W2" dialog so that the user can highlight tooltip for button on the "W2" dialog / *button*
- The user moves the mouse continuously and quickly between the two windows - highlighting a tooltip in each window as they rotate.
- After many iterations (even 20-30) the W2 window will appear in front of the browser window but the title Bar of the W2 window
   will remain inactive (grey) - the browser window goes to back but still has active window title bar.

The problem is easily reproducible on Windows 2K, latest 6u14 build

                                    

Comments
SUGGESTED FIX

------- awt_Window.cpp -------
*** /tmp/sccs.qiEVJC    2009-03-31 17:52:29.000000000 +0400
--- awt_Window.cpp      2009-03-31 17:51:52.000000000 +0400
***************
*** 321,327 ****
      ::SetWindowPos(warningWindow, HWND_NOTOPMOST,
              rect.left, rect.top,
              rect.right - rect.left, rect.bottom - rect.top,
!             SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOZORDER
              );
  }

--- 321,327 ----
      ::SetWindowPos(warningWindow, HWND_NOTOPMOST,
              rect.left, rect.top,
              rect.right - rect.left, rect.bottom - rect.top,
!             SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER
              );
  }

***************
*** 801,807 ****
      if (securityAnimationKind == akShow) {
          ::SetWindowPos(warningWindow, HWND_NOTOPMOST, 0, 0, 0, 0,
                  SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE |
!                 SWP_SHOWWINDOW);

          load_user_procs();
          if (fn_set_layered_window_attributes) {
--- 801,807 ----
      if (securityAnimationKind == akShow) {
          ::SetWindowPos(warningWindow, HWND_NOTOPMOST, 0, 0, 0, 0,
                  SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE |
!                 SWP_SHOWWINDOW | SWP_NOOWNERZORDER);

          load_user_procs();
          if (fn_set_layered_window_attributes) {
***************
*** 830,836 ****
          case akPreHide:
              ::SetWindowPos(warningWindow, HWND_NOTOPMOST, 0, 0, 0, 0,
                      SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE |
!                     SWP_HIDEWINDOW);
              break;
          case akShow:
              RepaintWarningWindow();
--- 830,836 ----
          case akPreHide:
              ::SetWindowPos(warningWindow, HWND_NOTOPMOST, 0, 0, 0, 0,
                      SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE |
!                     SWP_HIDEWINDOW | SWP_NOOWNERZORDER);
              break;
          case akShow:
              RepaintWarningWindow();
                                     
2009-04-02
EVALUATION

Need to use SWP_NOOWNERZORDER flag for warning windows.
                                     
2009-04-02
EVALUATION

This is a timing issue between the heavyweight tooltips and the security warning. It seems that on Windows 2000 the tooltip window may appear either above or below the security warning icon. Depending on the case the bug is sometimes reproduced. Looks like on Windows XP and higher the window always gets inserted in the correct position in the z-order, thus not causing the SetWindowPos invoked on the security warning to perform any actions.
                                     
2009-04-07



Hardware and Software, Engineered to Work Together