Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 421942

Summary: [Dialog] Initial size is too big
Product: [RT] RAP Reporter: Robert Mägel <r.maegel>
Component: JFaceAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ivan
Version: 2.2   
Target Milestone: 2.2 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
The dialog code none

Description Robert Mägel CLA 2013-11-18 04:31:21 EST
Created attachment 237524 [details]
The dialog code

Tested on: RAP 2.2 M3 

On first opening a dialog with a ScrolledComposite the size of the dialog is too big. The dialog fills the horizontal and vertical space. 
If the dialog is closed and opened again the dialog size is correct.

The error doesn't occur on RAP 2.0 and RAP 2.1

In the attachment you can find the code of the dialog.
Comment 1 Ivan Furnadjiev CLA 2013-11-19 08:14:12 EST
In 2.2M1 (bug 379136) we added a resize listener to dialog/window shell for re-initialization of dialog bounds after the availability of correct text sizes. As ScrolledComposite content is resized back to original size after the Shell (see TextSizeRecalculation#forceShellRecalculations) the dialog bounds are re-initialized with bigger values (+1000). Changing the order in TextSizeRecalculation#forceShellRecalculations (restoreScrolledCompositeOrigins first than restoreShellSize) fixes the problem, but I'm not 100% sure if this change will not break anything else.
Comment 2 Ivan Furnadjiev CLA 2013-11-22 03:41:13 EST
As a workaround you could specify the preferred size of your ScrolledComposite by setting it's layout data:
scrollBase.setLayoutData( new GridData( 500, 300 ) );
Comment 3 Ivan Furnadjiev CLA 2013-11-25 07:26:11 EST
Fixed with commit 4b5357b9ac2c423d36333f6627e5aca6208be233.