Name: acR10002 Date: 02/02/2004
--------- J2SE API spec v.1.5 ---------
public void setExtendedState(int state)
Sets the state of this frame. The state is represented as a bitwise mask.
NORMAL Indicates that no state bits are set.
MAXIMIZED_BOTH Concatenates MAXIMIZED_HORIZ and MAXIMIZED_VERT.
Note that if the state is not supported on a given platform, nothing will
happen. The application may determine if a specific state is available via
the java.awt.Toolkit#isFrameStateSupported(int state) method.
---------- end-of-excerpt ---------------
The problem was found during running the JCK interactive test
api/java/awt/interactive/FrameState/FrameStateTests with metacity WM.
The metacity WM reports that it can't handle single direction maximization,
like MAXIMIZED_HORIZ or MAXIMIZED_VERT states. However, if asked to do
maximization along with a single direction, it does maximization in both
directions resulting into the MAXIMIZED_BOTH frame.
Currently, the JDK code doesn't handle such misleading WM behavior,
just forwarding the setExtendedState() call to the underlying platform
(in this case - metacity WM). This makes the JDK inconsistent with
J2SE API spec when run against metacity WM. According to the spec,
no size change should happen to Frame in case certain state is not
Please find below the excerpt from licensee question:
>>With the code change, we correctly now identify that we are using the
>>Metacity wm. The JCK test first questions the window manager to
>>establish whether it can maximise in the horizontal and vertical
>>directions. The code now correctly returns false for this as Metacity
>>cannot do single direction maximisation. However, the JCK test then
>>attempts to maximise in single directions but expects the result of the
>>window to remain unchanged. This is because the Metacity says it cannot
>>do single direction. But, rather than remain unchanged, Metacity will
>>maximise in both directions if given a single direction maximise
The JDK code could workaround misleading WM's and just don't forward
calls to WM in case WM reports it doesn't support a feature.