JDK-6176507 : Modal dialogs have minimized buttons and don't have max/close buttons on some platforms
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2_07,5.0,5.0u1,6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_9
  • CPU: generic,sparc
  • Submitted: 2004-10-08
  • Updated: 2011-01-19
  • Resolved: 2005-04-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 6
6 b33Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
System Config.:
Sparc 10 (b67), Sparc 9, SLES 9 (AMD), RHAS 3.0, Suse 9.1 and Windows 2003
Tiger Update 1 Build 03

Symptom:
The same type of dialog is displayed differently on different platforms.
Modal dialogs have minimized buttons and don't have max/close buttons
on some platforms.

Test:
hopper/awt/Manual/AWTComponentTest/NonModDialogTest
The summary for this test is:
1) Main Frame appears.
2) Click on the ShowDialog button from Main Frame.
3) Modal Dialog1 should be launched, click on the text field and type
   something.
4) Click on the launch button, non-modal Dialog2 should be launched.
5) Type something on the text field in Dialog2.
6) Click on Dialog1 and type something in the text field of Dialog1.
7) If you can't type in any of the text fileds, test is considered
   as Fail.

Currently, I notice that the same dialog is displayed differently
on different platforms.

For example, a modal dialog "Dialog1" has three buttons (min., max., close) 
on Sparc 10, but it has only one button (close) on SLES 9 (AMD) system.
And a non-modal dialog "Dialog2" has only one button (close) on Sparc 10,
but it has three buttons (min., max., close) on SLES 9 (AMD) system.

Here are some data I collected for the dialog appearance on different
platforms:

Sparc 10                            SLES 9 (AMD)
============                        ============
Main Frame has(min. max. close)     Main Frame has(min. max. close)
Dialog1 has (min. max. close)       Dialog1 has (close)
Dialog2 has (close)                 Dialog2 has (min. max. close)


Sparc 9                             RHAS 3
===========                         ============
Main Frame has(min. max.)           Main Frame has(min. max. close)
Dialog1 has (min. max.)             Dialog1 has (close)
Dialog2 has (none)                  Dialog2 has (close)

Windows 2003                        Suse 9.1
============                        ============
Main Frame has(min. max. close)     Main Frame has(min. max. close)
Dialog1 has (close)                 Dialog1 has (min. max. close)
Dialog2 has (close)                 Dialog2 has (max. close)

According to Denis:
"They are not supposed to be like this. Modal dialogs are not allowed to
be minimized, so they must have only max/close buttons. All other
windows, if resizable, must have all three buttons..."
###@###.### 10/8/04 22:25 GMT

Additional Info.:
I tried on 1.4.2_07, Tiger beta3 b54, Tiger fcs (b64) and Tiger update 1 builds, they all have the same problem.
This is not a regression.
###@###.### 10/9/04 05:47 GMT
###@###.### 10/15/04 16:58 GMT

Comments
SUGGESTED FIX sun/awt/X11/XDialogPeer.java: *** 124,129 **** --- 124,139 ---- } else { return ((Dialog)target).isUndecorated(); } } + int getDecorations() { + int d = super.getDecorations(); + // remove minimize and maximize buttons for dialogs + if ((d & MWM_DECOR_ALL) != 0) { + d |= (MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE); + } else { + d &= ~(MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE); + } + return d; + } } sun/awt/X11/XWM.java: *** 783,797 **** * Functions we always want to be enabled as mwm(1) and * descendants not only hide disabled functions away from * user, but also ignore corresponding requests from the * program itself (e.g. 4442047). */ ! functions |= MWM_FUNC_CLOSE | MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE; if( resizable ) { ! functions |= MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE; } } PropMwmHints hints = window.getMWMHints(); hints.set_flags(hints.get_flags() | MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS); hints.set_functions(functions); --- 783,803 ---- * Functions we always want to be enabled as mwm(1) and * descendants not only hide disabled functions away from * user, but also ignore corresponding requests from the * program itself (e.g. 4442047). */ ! functions |= MWM_FUNC_CLOSE | MWM_FUNC_MOVE; ! if ((decorations & MWM_DECOR_MINIMIZE) != 0) { ! functions |= MWM_FUNC_MINIMIZE; ! } if (resizable) { ! functions |= MWM_FUNC_RESIZE; ! if ((decorations & MWM_DECOR_MAXIMIZE) != 0) { ! functions |= MWM_FUNC_MAXIMIZE; } } + } PropMwmHints hints = window.getMWMHints(); hints.set_flags(hints.get_flags() | MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS); hints.set_functions(functions); ###@###.### 2005-04-08 11:55:50 GMT
08-04-2005

EVALUATION not a tiger regression. should investigate in mustang. ###@###.### 10/29/04 07:49 GMT On Windows and Solaris+MToolkit dialogs, both modal and modeless, have the only button "close". So on XToolkit the same behaviour is expected. While working with the bug, I found that some window managers allow users to change window decorations (including minimize/maximize/shade/close buttons) in arbitrary way. When running applications with such WMs, AWT have no control for window decorations. Below is the brief list of supported WMs: - mwm/dtwm (CDE) - metacity (GNOME) - sawfish - icewm - olwm KWin (KDE) has its own heuristics for window decorations buttons (probably based on _NET_xxx hints?), but I was not able to find them. So, when running with KWin, Java dialogs have an additional "maximize" button. ###@###.### 2005-03-16 13:47:27 GMT
29-10-2004