Bug 577140

Summary: Toolbar does not resize/layout under certain circumstance
Product: [Eclipse Project] Platform Reporter: Christoph Laeubrich <laeubi>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: jkubitz-eclipse, Lars.Vogel, p.beauvoir
Version: 4.22   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=574641
https://bugs.eclipse.org/bugs/show_bug.cgi?id=577566
Whiteboard:
Attachments:
Description Flags
Snippet none

Description Christoph Laeubrich CLA 2021-11-09 07:23:16 EST
We have a toolbar that changes the text of its items or the size of a control, but this currently does not work to resize the toolbar accordingly.

I have attached a snippet (toolbar with red background to see its size) wich can be used to reproduce this behaviour with some flags:

A) You can click on any button to "blow up" the toolbar
B) Now set forceLayout = true, it still fails to resize even if I request to layout the component (but might be I'm using the method wrong)
C) set useAsyncRequest=true now the toolbar expands as desired 

I would exspect that I never have to call any layout methods and the example works tiht both flags set to false.
Comment 1 Christoph Laeubrich CLA 2021-11-09 07:29:55 EST
Created attachment 287466 [details]
Snippet
Comment 2 Christoph Laeubrich CLA 2021-11-09 07:36:50 EST
I also see this issue in Linux/Debian so it might not be an Windows-Only issue. Any Mac user can check if this is the case under mac also?
Comment 3 Phil Beauvoir CLA 2021-11-09 09:28:16 EST
(In reply to Christoph Laeubrich from comment #2)
> I also see this issue in Linux/Debian so it might not be an Windows-Only
> issue. Any Mac user can check if this is the case under mac also?

Tested on macOS Monterey 12.01 x86_64.

I had to set forceLayout and useAsyncRequest to true for the toolbar to resize.
Comment 4 Christoph Laeubrich CLA 2021-11-09 09:39:31 EST
(In reply to Phil Beauvoir from comment #3)
> Tested on macOS Monterey 12.01 x86_64.
> I had to set forceLayout and useAsyncRequest to true for the toolbar to
> resize.

Thanks for the verification!
Comment 5 Lars Vogel CLA 2021-11-09 10:50:39 EST
Jörg, can you have a look?
Comment 6 Jörg Kubitz CLA 2021-11-10 02:27:19 EST
(In reply to Lars Vogel from comment #5)
> Jörg, can you have a look?
Tested: does not relate to the ToolBar.computeSizeInPixels cache "return new Point (_width, _height)"
Thats all i can contribute.