Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 372886 - Swing: Maximize of undecorated frame does not work in some circumstances
Summary: Swing: Maximize of undecorated frame does not work in some circumstances
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-29 13:13 EST by Bruno Koeferli CLA
Modified: 2021-08-19 11:16 EDT (History)
1 user (show)

See Also:
ivan.motsch: indigo+
ivan.motsch: juno+


Attachments
Patch implementing the PROPOSED SOLUTION (6.11 KB, patch)
2012-02-29 13:13 EST, Bruno Koeferli CLA
ivan.motsch: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno Koeferli CLA 2012-02-29 13:13:02 EST
Created attachment 211824 [details]
Patch implementing the PROPOSED SOLUTION

Build Identifier: 3.7.2

PROBLEM DESCRIPTION:
Windows taskbar, that's position is different to bottom, overlaps undecorated frames if the user maximizes it.

EVALUATION:
java.awt.Frame.setMaximizedBounds cannot handle the x/y coordinate value Integer.MAX_VALUE correctly even though it is state in javadoc (see JFrameEx.setExtendedState(int state):81-82)

PROPOSED SOLUTION:
Set the x/y coordinate directly by getting the toolkit's current screen insets [Toolkit.getScreenInsets(...)].
However due to the Java bug 6899304 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6899304) the attached solution only considers the insets for the primary screen device. For frames locating on other screen devices (not primary) empty insets will be returned. In Windows environments these circumstances (taskbar on a none primary screen) will be very rare and therefore ignored until the Java bug will be fixed in a future Java version.

Reproducible: Always
Comment 1 Ivan Motsch CLA 2012-03-02 05:26:15 EST
Patch applied, works fine.
Comment 2 Ivan Motsch CLA 2012-03-28 02:52:22 EDT
backported to 3.7
Comment 3 Matthias Zimmermann CLA 2013-07-08 17:36:50 EDT
Bugfixes shipped on Scout 3.7 branch