Project: Eclipse_Platform_UI
Bug 76846 Calling layout sets the height of a widget to 0
Reported: 2004-10-22 14:30:23 | Status: resolved wontfix

20041013 Note this was not an issue in M2. I have the following code in ProgressMonitorJobsDialog GridData viewerData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH); int heightHint = convertHeightInCharsToPixels(10); viewerData.heightHint = heightHint; viewer.getControl().setLayoutData(viewerData); Point size = viewer.getControl().computeSize( viewerComposite.getBounds().width, heightHint); viewer.getControl().setVisible(true); viewer.getControl().setSize(size); viewerComposite.layout(); viewerHeight = viewer.getControl().getBounds().height; When I run this code size is a reasonable size (about 400 x 200).If I then call layout and execute the last line I get a viewerHeight of 0. Not calling layout is just fine (I think I can remove this code). However this will cause a lot of trouble when layout() is called. To replicate 1) Load org.eclipse.ui.examples.jobs 2) Open the Job Factory in a self hosted image 3) Select Usr Job and Create Jobs 4) A dialog will come up 5) Select the details button. No resize will occur.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorJobsDialog.java