Bug 564073

Summary: [MACOS] Also call update (); in Display#runDeferredLayouts similar to GTK
Product: [Eclipse Project] Platform Reporter: Lars Vogel <Lars.Vogel>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: Lars.Vogel, lshanmug
Version: 4.14   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/164439
https://bugs.eclipse.org/bugs/show_bug.cgi?id=563712
Whiteboard:

Description Lars Vogel CLA 2020-06-08 08:57:59 EDT
GTK: 
boolean runDeferredLayouts () {
	if (layoutDeferredCount != 0) {
		Composite[] temp = layoutDeferred;
		int count = layoutDeferredCount;
		layoutDeferred = null;
		layoutDeferredCount = 0;
		for (int i = 0; i < count; i++) {
			Composite comp = temp[i];
			if (!comp.isDisposed()) comp.setLayoutDeferred (false);
		}
		update ();
		return true;
	}
	return false;
}

MacOS:

boolean runDeferredLayouts () {
	if (layoutDeferredCount != 0) {
		Composite[] temp = layoutDeferred;
		int count = layoutDeferredCount;
		layoutDeferred = null;
		layoutDeferredCount = 0;
		for (int i = 0; i < count; i++) {
			Composite comp = temp[i];
			if (!comp.isDisposed()) comp.setLayoutDeferred (false);
		}
		update ();
		return true;
	}
	return false;
}

This missing call my explain bugs like Bug 494470 in which layout behaves incorrect on Mac while it works well on GTK.
Comment 1 Lars Vogel CLA 2020-06-08 08:59:18 EDT
Sorry current Mac version of cause is missing the update() call:

MacOS:

boolean runDeferredLayouts () {
	if (layoutDeferredCount != 0) {
		Composite[] temp = layoutDeferred;
		int count = layoutDeferredCount;
		layoutDeferred = null;
		layoutDeferredCount = 0;
		for (int i = 0; i < count; i++) {
			Composite comp = temp[i];
			if (!comp.isDisposed()) comp.setLayoutDeferred (false);
		}
		return true;
	}
	return false;
}
Comment 2 Eclipse Genie CLA 2020-06-08 08:59:35 EDT
New Gerrit change created: https://git.eclipse.org/r/164439
Comment 3 Lakshmi P Shanmugam CLA 2020-06-08 09:39:32 EDT
@Lars,
Can you please give an example of the problem that the change fixes?
Comment 4 Lakshmi P Shanmugam CLA 2020-06-08 09:41:07 EDT
(In reply to Lakshmi Shanmugam from comment #3)
> @Lars,
> Can you please give an example of the problem that the change fixes?

or a snippet so that I can test it.
Comment 5 Lars Vogel CLA 2020-06-08 10:45:05 EDT
(In reply to Lakshmi Shanmugam from comment #3)
> @Lars,
> Can you please give an example of the problem that the change fixes?

Only don't have a Mac so I don't know but test case would be Bug 494470
Comment 6 Lakshmi P Shanmugam CLA 2020-06-09 07:08:03 EDT
(In reply to Lars Vogel from comment #5)
> (In reply to Lakshmi Shanmugam from comment #3)
> > @Lars,
> > Can you please give an example of the problem that the change fixes?
> 
> Only don't have a Mac so I don't know but test case would be Bug 494470

Please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=494470#c21, we need to verify if the bug is still reproducible.