Bug 157463 - Vertical window resize fails for non-native Window decorations
Vertical window resize fails for non-native Window decorations
Status: VERIFIED FIXED
Product: platform
Classification: Unclassified
Component: Window System
6.x
All All
: P3 with 4 votes (vote)
: 6.x
Assigned To: Stanislav Aubrecht
issues@platform
65fixes3-verified
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-26 20:03 UTC by wzberger
Modified: 2009-03-16 16:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
Metal2LookAndFeel (383 bytes, text/plain)
2009-01-26 20:04 UTC, wzberger
Details
Proposed patch (1.29 KB, text/plain)
2009-02-08 13:02 UTC, maxnitribitt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wzberger 2009-01-26 20:03:05 UTC
The NetBeans platform has a problem with third party look and feels and non-native window decoration. Resizing windows
vertically (especially minimizing) isn't possible. You can simply reproduce this by using the LAF below which extends
Metal and additionally enables the Metal window decoration. As soon as Metal2LookAndFeel is applied the main window
can't be resized vertically.

public class Metal2LookAndFeel extends MetalLookAndFeel
{
  @Override
  public void initialize()
  {
    JFrame.setDefaultLookAndFeelDecorated(true);
    JDialog.setDefaultLookAndFeelDecorated(true);    
    super.initialize();
  }
}

Thanks,
Wolfgang
Comment 1 wzberger 2009-01-26 20:04:53 UTC
Created attachment 76248 [details]
Metal2LookAndFeel
Comment 2 Peter Pis 2009-01-27 09:03:37 UTC
Reassigning to platform.
Comment 3 maxnitribitt 2009-02-08 12:45:33 UTC
Proposed patch: remove setBounds method in MainWindow

The problem is that the decorations use the setBounds Method that MainWindow overrides to fix a bug with SDI:

    /**
     * don't allow smaller bounds than the one constructed from preffered sizes, making sure everything is visible when
     * in SDI. #40063
     */
    @Override
    public void setBounds(Rectangle rect) {
        Rectangle bounds = rect;
        if (bounds != null) {
            if (bounds.height < getPreferredSize().height) {
                bounds = new Rectangle(bounds.x, bounds.y, bounds.width, getPreferredSize().height);
            }
        }
        super.setBounds(bounds);
    }

Commenting the setBounds Method fixes the problem. Since SDI has been removed a long time ago, is there still a reason
to override setBounds?

Thanks
Toni
Comment 4 maxnitribitt 2009-02-08 13:02:59 UTC
Created attachment 76710 [details]
Proposed patch
Comment 5 Stanislav Aubrecht 2009-02-09 16:24:05 UTC
fixed by rolling back fix for #40063, thanks for the patch

daf24180c08a

Comment 6 maxnitribitt 2009-02-10 10:15:00 UTC
Hi Stan,

thanks for taking care of this! Is there a chance to get this into 6.5 as well?

Toni
Comment 7 Stanislav Aubrecht 2009-02-10 10:30:48 UTC
i've added appropriate flag but our sustaining dept has been axed a lot so it'll take some time to produce patch3 for nb 65
Comment 8 Quality Engineering 2009-02-13 09:27:33 UTC
Integrated into 'main-golden', will be available in build *200902130336* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/daf24180c08a
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #157463 - Vertical window resize fails for non-native Window decorations
Comment 9 matusdekanek 2009-02-23 16:23:18 UTC
seems ok
marking verified
Comment 10 Stanislav Aubrecht 2009-02-26 08:40:18 UTC
backporting the fix to release65_fixes: 05fd24ca5025


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo