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

Bug 539693

Summary: [Cocoa][10.14] Unified toolbar: returns excessively large size
Product: [Eclipse Project] Platform Reporter: Thomas Singer <eclipse>
Component: SWTAssignee: Thomas Singer <ts-swt>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: lshanmug, olivier.prouvost, ts-swt
Version: 4.9   
Target Milestone: 4.18   
Hardware: PC   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/168130
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=962bc418d30aec9515bcaa34cdcc0b659009c8a2
Whiteboard:

Description Thomas Singer CLA 2018-10-01 09:51:47 EDT
When I'm running SmartSVN 9.3 from smartsvn.com and try to open the Log or Revision Graph it reliably causes an assertion. The reason is that the shell reports an excessively large width caused by the unified toolbar. Any effort to extract the problem in a tiny test snippet failed. While debugging the problem only occurs sporadically when using Continue, but never when debugging step by step ("heisenbug").

The amount of toolbar items seems to matter; with 5 equal items I could not reproduce (when running), but with 6 I could reliable (except of when debugging).

see also bug 387864
Comment 1 Thomas Singer CLA 2018-10-01 11:41:34 EDT
It boils down to the Toolbar.layoutUnified method where the invocation

NSRect [] containerRects = new NSRect[itemCount];
...
containerRects[i] = new NSView(itemViewers.objectAtIndex(i)).frame();

causes strange values in the NSRect's values. Converting these doubles to a long using Double.doubleToRawLongBits shows some interesting result: the width value reads 434c4e47432b2b00 which can be interpreted as CLNGC++.
Comment 2 Thomas Singer CLA 2018-10-01 11:48:37 EDT
Multiple invocations produce different results:
x: 7ffeef6f31d0
y: 7fff7ad7babb
width: 434c4e47432b2b00
height: 107ba5e50

x: 7ffeef6f31d0
y: 7fff7ad7babb
width: 434c4e47432b2b00
height: 1

x: 7ffeef6f31d0
y: 7fff7ad7babb
width: 434c4e47432b2b00
height: 2

x: 7ffeef6f31d0
y: 7fff7ad7babb
width: 434c4e47432b2b00
height: 3

x: 7ffeef6f31d0
y: 7fff7ad7babb
width: 434c4e47432b2b00
height: 4

...
Comment 3 Lakshmi P Shanmugam CLA 2018-10-11 08:59:03 EDT
Does the code use ToolItem.setWidth(SWT.SEPARATOR_FILL)? Does changing it to SWT.DEFAULT fix the issue?
Comment 4 Thomas Singer CLA 2018-10-16 05:00:57 EDT
No, for this problematic shell's toolbar no stretching toolitem is used. For a different shell's toolbar where a stretching toolitem is used, the problem does not occur.
Comment 5 Lakshmi P Shanmugam CLA 2018-10-16 05:48:46 EDT
Can you try to create a SWT snippet to reproduce this issue?
Comment 6 Thomas Singer CLA 2018-10-16 13:26:28 EDT
I wrote in my initial posting:

> Any effort to extract the problem in a tiny test snippet failed.
Comment 7 Lakshmi P Shanmugam CLA 2018-12-21 04:35:55 EST
(In reply to Thomas Singer from comment #6)
> I wrote in my initial posting:
> 
> > Any effort to extract the problem in a tiny test snippet failed.

It's hard to do anything in this case without a reproducible test case.
Comment 8 Thomas Singer CLA 2018-12-21 08:28:16 EST
Sorry, I only know the way to use SmartSVN 9.3 or 11 and opening the Log or Revision Graph window on macOS 10.14. You will need to use the original org.eclipse.swt*.jar files, because ours contain a work-around.
Comment 9 Eclipse Genie CLA 2020-08-24 07:09:19 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/168130