Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 138343 Details for
Bug 279163
[Shell] Contents of a non-maximized shell are resized on display resize
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Test case and patch
DisplayLCA-patch.txt (text/plain), 3.67 KB, created by
Ralf Sternberg
on 2009-06-04 17:15:07 EDT
(
hide
)
Description:
Test case and patch
Filename:
MIME Type:
Creator:
Ralf Sternberg
Created:
2009-06-04 17:15:07 EDT
Size:
3.67 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt.q07 >Index: src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java,v >retrieving revision 1.14 >diff -u -r1.14 DisplayLCA.java >--- src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java 4 Jun 2009 11:48:55 -0000 1.14 >+++ src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java 4 Jun 2009 21:11:54 -0000 >@@ -312,7 +312,6 @@ > } > > public void readData( final Display display ) { >- Rectangle oldBounds = display.getBounds(); > readBounds( display ); > readFocusControl( display ); > WidgetTreeVisitor visitor = new AllWidgetTreeVisitor() { >@@ -328,12 +327,8 @@ > WidgetTreeVisitor.accept( shell, visitor ); > } > >- // TODO: [fappel] since there is no possibility yet to determine whether >- // a shell is maximized, we use this hack to adjust >- // the bounds of a maximized shell in case of a document >- // resize event > for( int i = 0; i < shells.length; i++ ) { >- if( shells[ i ].getBounds().equals( oldBounds ) ) { >+ if( shells[ i ].getMaximized() ) { > shells[ i ].setBounds( display.getBounds() ); > } > } >#P org.eclipse.rap.rwt.q07.test >Index: src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.q07.test/src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA_Test.java,v >retrieving revision 1.3 >diff -u -r1.3 DisplayLCA_Test.java >--- src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA_Test.java 2 Jul 2008 12:43:19 -0000 1.3 >+++ src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA_Test.java 4 Jun 2009 21:11:55 -0000 >@@ -31,8 +31,7 @@ > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.graphics.Rectangle; >-import org.eclipse.swt.internal.widgets.WidgetAdapter; >-import org.eclipse.swt.internal.widgets.WidgetAdapterFactory; >+import org.eclipse.swt.internal.widgets.*; > import org.eclipse.swt.widgets.*; > > >@@ -271,6 +270,29 @@ > assertEquals( previousFocusControl, display.getFocusControl() ); > } > >+ public void testResizeMaximizedShells() { >+ Display display = new Display(); >+ Object adapter = display.getAdapter( IDisplayAdapter.class ); >+ IDisplayAdapter displayAdapter = ( IDisplayAdapter )adapter; >+ displayAdapter.setBounds( new Rectangle( 0, 0, 800, 600 ) ); >+ Shell shell1 = new Shell( display, SWT.NONE ); >+ shell1.setBounds( 0, 0, 800, 600 ); >+ Shell shell2 = new Shell( display, SWT.NONE ); >+ shell2.setBounds( 0, 0, 300, 400 ); >+ shell2.setMaximized( true ); >+ // fake display resize >+ IDisplayLifeCycleAdapter lca = DisplayUtil.getLCA( display ); >+ String displayId = DisplayUtil.getAdapter( display ).getId(); >+ Fixture.fakeRequestParam( RequestParams.UIROOT, displayId ); >+ Fixture.fakeRequestParam( displayId + ".bounds.width", "700" ); >+ Fixture.fakeRequestParam( displayId + ".bounds.height", "500" ); >+ lca.readData( display ); >+ // shell1 is not resized although it has the same size as the display >+ assertEquals( new Rectangle( 0, 0, 800, 600 ), shell1.getBounds() ); >+ // shell2 is resized because it's maximized >+ assertEquals( new Rectangle( 0, 0, 700, 500 ), shell2.getBounds() ); >+ } >+ > protected void setUp() throws Exception { > Fixture.setUp(); > System.setProperty( IInitialization.PARAM_LIFE_CYCLE,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
rsternberg
:
review?
Actions:
View
|
Diff
Attachments on
bug 279163
: 138343