JDK-4980161 : REG:setting focusable window state to false makes the maximized frame resizable
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-01-19
  • Updated: 2014-10-24
  • Resolved: 2011-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b17Fixed
Related Reports
Relates :  
Relates :  
Description
I am setting the maximized bounds of a frame to 0,0,300,300 and setting the focusable window state to false. I have set the frame state to MAXIMIZED_BOTH by calling setExtendedState(). When I move the cursor to the edges/border of the frame, i don't see any change in the cursor when the frame is in maximized state. But when I still click on the edges/border of the frame and drag the mouse, the frame is getting resized. Typically a maximized frame is not supposed to be resizable. The behavior seems to be fine when setFocusableWindowState is set to true. 

This is noticed only on Win32 platforms right from JDK1.4.2 and not occuring on 1.4.1, 1.4. Hence this is a regression introduced in 1.4.2.

I have attached a sample testcase. Execute the application as follows.
java WindowStateTest <0/1>
0 - set focusable window state to true
1 - set focusable window state to false

Pass "1" as the argument. A frame will be shown. Click on the border and try resizing it. If it gets resized, the bug is reproduced.

This is not reproducible on Solaris9 with CDE/GNOME.  

Comments
EVALUATION It seems reasonable to fix an issue discovered while investigating the CR 6503772. It was discovered that the Minimize or Maximize actions are performed upon WM_NCLBUTTONDOWN, though they should be performed (according to the native OS behavior) upon the WM_NCLBUTTONUP message. See the evaluation of the 6503772 for more details.
19-06-2007

EVALUATION Name: osR10079 Date: 01/20/2004 This is regression from rewriting implementation of unfocusable windows. The problem is that we handle WM_NCxxx messages to resize unfocusable windows. and we forgot to check is window resizable/zoomed when we receive WN_NCLBUTTONDOWN and start resizing in all cases (awt_Frame.cpp, AwtFrame::WmNcMouseDown()). ###@###.### Jan 21, 2004 ====================================================================== Suggested fix most likely works but it's too risky for mustang. Integrating this fix at the start of dolphin's development would be best. ###@###.### 2005-07-07 15:05:55 GMT
07-07-2005

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
18-08-2004

SUGGESTED FIX Name: osR10079 Date: 01/20/2004 ------- awt_Frame.cpp ------- *** /tmp/sccs.40a4Nq Wed Jan 21 07:47:29 2004 --- awt_Frame.cpp Wed Jan 21 07:47:25 2004 *************** *** 438,444 **** } } return mrConsume; - case HTCAPTION: case HTTOP: case HTBOTTOM: case HTLEFT: --- 438,443 ---- *************** *** 448,458 **** case HTBOTTOMLEFT: case HTBOTTOMRIGHT: case HTSIZE: // We are going to perform default mouse action on non-client area of this window // Grab mouse for this purpose and store coordinates for motion vector calculation savedMousePos.x = x; savedMousePos.y = y; ! ::SetCapture(GetHWnd()); isInManualMoveOrSize = TRUE; grabbedHitTest = hitTest; return mrConsume; --- 447,461 ---- case HTBOTTOMLEFT: case HTBOTTOMRIGHT: case HTSIZE: + if (!IsResizable() || ::IsZoomed(GetHWnd())) { + return mrConsume; + } + case HTCAPTION: // We are going to perform default mouse action on non-client area of this window // Grab mouse for this purpose and store coordinates for motion vector calculation savedMousePos.x = x; savedMousePos.y = y; ! ::SetCapture(GetHWnd()); isInManualMoveOrSize = TRUE; grabbedHitTest = hitTest; return mrConsume; ###@###.###, Jan 21, 2004 ======================================================================
18-08-2004