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

Bug 271501

Summary: [CSS] CSSSWTApplyStylesListener - does it need to shell.pack()
Product: [Eclipse Project] e4 Reporter: Kevin McGuire <Kevin_McGuire>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: azerr, gheorghe
Version: 0.9   
Target Milestone: 1.0 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 260406    
Bug Blocks:    

Description Kevin McGuire CLA 2009-04-07 14:02:18 EDT
Bug #268679 made the following change in CSSSWTApplyStylesListener:
 
 		public void handleEvent(Event event) {
 			Widget widget = event.widget;
-			if (widget instanceof Shell)
-				((Shell) widget).pack();
+//			if (widget instanceof Shell)
+//				((Shell) widget).pack();
 		}

I suspect this code is required for triggering lazy style applying.

Angelo?
Comment 1 Angelo ZERR CLA 2009-04-08 02:47:41 EDT
Hi Kevin,

Youe are right, it's to manage lazy apply but I don't know if we must keep that. I have done that because into Swing it exists an helper which observe when Composite is added,removed and I have develelop lazy apply into Swing. For SWT we have not this helper class, and SWT lazy apply is not implemented properly.

Regards Angelo
Comment 2 Kevin McGuire CLA 2009-04-08 10:53:26 EDT
I'm assumiung that in the show listener we do the pack in order to trigger the resize listener? (because packing changes layout and thus size).  I think this is a problem anyway and can result in unintended shell sizes.  Certainly I've seen bugs which I believe related to this.  Can we not instead just call engine.applyStyles(widget, false) for the show listener as well?

For the bug #268679 I think we can forgo lazy styling. It will still be a problem for non modelled-ui uses though.

Of course the long term fix is bug #260406
Comment 3 Kevin McGuire CLA 2009-09-11 14:53:16 EDT
Removed the code, and the use of display.addFilter(SWT.SHOW, ...) listener.