Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 279163
Collapse All | Expand All

(-)src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java (-6 / +1 lines)
Lines 312-318 Link Here
312
  }
312
  }
313
313
314
  public void readData( final Display display ) {
314
  public void readData( final Display display ) {
315
    Rectangle oldBounds = display.getBounds();
316
    readBounds( display );
315
    readBounds( display );
317
    readFocusControl( display );
316
    readFocusControl( display );
318
    WidgetTreeVisitor visitor = new AllWidgetTreeVisitor() {
317
    WidgetTreeVisitor visitor = new AllWidgetTreeVisitor() {
Lines 328-339 Link Here
328
      WidgetTreeVisitor.accept( shell, visitor );
327
      WidgetTreeVisitor.accept( shell, visitor );
329
    }
328
    }
330
329
331
    // TODO: [fappel] since there is no possibility yet to determine whether
332
    //                a shell is maximized, we use this hack to adjust
333
    //                the bounds of a maximized shell in case of a document
334
    //                resize event
335
    for( int i = 0; i < shells.length; i++ ) {
330
    for( int i = 0; i < shells.length; i++ ) {
336
      if( shells[ i ].getBounds().equals( oldBounds ) ) {
331
      if( shells[ i ].getMaximized() ) {
337
        shells[ i ].setBounds( display.getBounds() );
332
        shells[ i ].setBounds( display.getBounds() );
338
      }
333
      }
339
    }
334
    }
(-)src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA_Test.java (-2 / +24 lines)
Lines 31-38 Link Here
31
import org.eclipse.swt.events.SelectionAdapter;
31
import org.eclipse.swt.events.SelectionAdapter;
32
import org.eclipse.swt.events.SelectionEvent;
32
import org.eclipse.swt.events.SelectionEvent;
33
import org.eclipse.swt.graphics.Rectangle;
33
import org.eclipse.swt.graphics.Rectangle;
34
import org.eclipse.swt.internal.widgets.WidgetAdapter;
34
import org.eclipse.swt.internal.widgets.*;
35
import org.eclipse.swt.internal.widgets.WidgetAdapterFactory;
36
import org.eclipse.swt.widgets.*;
35
import org.eclipse.swt.widgets.*;
37
36
38
37
Lines 271-276 Link Here
271
    assertEquals( previousFocusControl, display.getFocusControl() );
270
    assertEquals( previousFocusControl, display.getFocusControl() );
272
  }
271
  }
273
272
273
  public void testResizeMaximizedShells() {
274
    Display display = new Display();
275
    Object adapter = display.getAdapter( IDisplayAdapter.class );
276
    IDisplayAdapter displayAdapter = ( IDisplayAdapter )adapter;
277
    displayAdapter.setBounds( new Rectangle( 0, 0, 800, 600 ) );
278
    Shell shell1 = new Shell( display, SWT.NONE );
279
    shell1.setBounds( 0, 0, 800, 600 );
280
    Shell shell2 = new Shell( display, SWT.NONE );
281
    shell2.setBounds( 0, 0, 300, 400 );
282
    shell2.setMaximized( true );
283
    // fake display resize
284
    IDisplayLifeCycleAdapter lca = DisplayUtil.getLCA( display );
285
    String displayId = DisplayUtil.getAdapter( display ).getId();
286
    Fixture.fakeRequestParam( RequestParams.UIROOT, displayId );
287
    Fixture.fakeRequestParam( displayId + ".bounds.width", "700" );
288
    Fixture.fakeRequestParam( displayId + ".bounds.height", "500" );
289
    lca.readData( display );
290
    // shell1 is not resized although it has the same size as the display
291
    assertEquals( new Rectangle( 0, 0, 800, 600 ), shell1.getBounds() );
292
    // shell2 is resized because it's maximized
293
    assertEquals( new Rectangle( 0, 0, 700, 500 ), shell2.getBounds() );
294
  }
295
274
  protected void setUp() throws Exception {
296
  protected void setUp() throws Exception {
275
    Fixture.setUp();
297
    Fixture.setUp();
276
    System.setProperty( IInitialization.PARAM_LIFE_CYCLE, 
298
    System.setProperty( IInitialization.PARAM_LIFE_CYCLE, 

Return to bug 279163