JDK-6464482 : XAWT: Multiple problems setting WM_NORMAL_HINTS
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2006-08-28
  • Updated: 2019-03-23
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Code responsible for setting WM_NORMAL_HINTS property has multiple problems and should be refactored.

1. maximizedBounds is lost after toggling resizable state on several window managers

---Test1.java---
import java.awt.*;
import java.awt.event.*;

public class Test1 {

    public static void main(String[] args) {
        final Frame f = new Frame("test frame");
        final Button b1 = new Button("Press me");
        f.add(b1);
        b1.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    f.setResizable(!f.isResizable());
                }
            });
        f.setMaximizedBounds(new Rectangle(0, 0, 400, 400));
        f.setBounds(100, 100, 200, 200);
        f.setVisible(true);
    }
        
};
---Test1.java---
1. Compile and run Test1.java
2. Verify that frame is resizable and it's being maximixed to Dimensions (400, 400)
3. Click 'Press me' button and verify that frame is not resizable
4. Click 'Press me' button once again, frame becomes resizable
5. If frame is maximizable to the whole screen, the bug is reproduced

This bug is reproducible always with JDK6 b95 on Gnome & KDE, other builds & WMs were not tested.

2. Non-resizable state is lost when setting maximized bounds on Gnome

---Test2.java---
import java.awt.*;
import java.awt.event.*;

public class Test2 {

    public static void main(String[] args) {
        final Frame f = new Frame("test frame");
        final Button b1 = new Button("Press me");
        f.add(b1);
        b1.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    f.setMaximizedBounds(new Rectangle(0, 0, 400, 400));
                }
            });
        f.setBounds(100, 100, 200, 200);
        f.setResizable(false);
        f.setVisible(true);
    }
        
};
---Test2.java---
1. Compile and run Test2.java
2. Verify that frame is not resizable
3. Click 'Press me' button
4. If frame becomes resizable, the bug is reproduced

This bug is always reproducible with JDK6 b95 on Gnome, not reproducible on KDE. 
Other builds & WMs were not tested.

3. There are several other problems in code that should also be fixed:
- XlibWrapper.XSetMinMaxHints method should be removed, because it is not used for now, 
and its invocation can lead to unpredictable behaviour.
- Setting correct combination of hints in different situations is not trivial task,
becuase of complexity of interface and lack of documentation.
- WM_NORMAL_HINTS property can be modified with severals means (XBaseWindow.setSizeHints,
XWM.removeSizeHints, etc). This should be refactored into one or several compact and 
easy to use methods.

Comments
- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. Kind regards, Mathias
29-08-2013

These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. Kind regards, Mathias
29-08-2013

These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. Kind regards, Mathias
29-08-2013

Converted "8-client-defer-candidate" label to "8-defer-request" by SQE' OK.
15-08-2013

*This is anti-deferral criteria list*: - P2 -------------- Engineering's Criteria ------------------------------------- - tck-red labeled - conformance labeled - P3 regressions reported/labeled against jdk8 - findbugs, parfait, eht labeled bugs - CAP <1 year reported - netbeans <1 year reported Victor ----------------- SQE's OK --------------------------------- Yes, we are ok with that thanks, Mikhail
15-08-2013

8-defer-request: This is the issue from 7 GA when it was approved to defer that time. Requesting to defer again because there are no customer escalations on this issue.
14-06-2013

EVALUATION See description.
30-08-2006