Bug 494470 - Evaluate why SWT.CHANGED is necessary on the mac to make toolbar appear
Summary: Evaluate why SWT.CHANGED is necessary on the mac to make toolbar appear
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: 4.17 M1   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 485856 487621 497812
Blocks:
  Show dependency tree
 
Reported: 2016-05-24 14:08 EDT by Lars Vogel CLA
Modified: 2020-06-11 11:14 EDT (History)
16 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2016-05-24 14:08:39 EDT
Bug 487621 describes the issue on Mac, that if ctrl.getParent().layout(new Control[] { ctrl }, SWT.CHANGED | SWT.DEFER); is replaced with ctrl.requestLayout(); the toolbar is not rendered correctly on the Mac.

Stefan Xenos indicated that this indicates a layout bug and that this should be investigate. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=487621#c48

To test, revert http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=afffa93f93a617616c794965bc0e4c9f8900c947

See https://www.youtube.com/watch?v=aWk76qJXy6M how to reproduce.
Comment 1 Stefan Xenos CLA 2016-05-24 15:04:42 EDT
FYI, I'm working on a diagnostic tool to make this sort of bug easier to track down. You can see my work in progress here:

https://git.eclipse.org/r/#/c/69794/
Comment 2 Lars Vogel CLA 2016-05-25 09:48:01 EDT
(In reply to Stefan Xenos from comment #1)
> FYI, I'm working on a diagnostic tool to make this sort of bug easier to
> track down. You can see my work in progress here:
> 
> https://git.eclipse.org/r/#/c/69794/

Gerrit tells me that I have no permission to view this one.
Comment 3 Lars Vogel CLA 2016-05-25 09:48:32 EDT
Stefan, do you have access to a Mac and can you take this bug?
Comment 4 Stefan Xenos CLA 2016-05-25 10:14:41 EDT
> Stefan, do you have access to a Mac and can you take this bug?

No access to a Mac at the moment, but I'll see if I can fix that.
Comment 5 Patrik Suzzi CLA 2016-05-25 10:39:14 EDT
I can access a Mac for tests; if needed count on me.
Comment 6 Lars Vogel CLA 2016-07-19 02:33:13 EDT
We found a Bug in requestLayout. See Bug 497812. This bug might be related to this issue.
Comment 7 Stefan Xenos CLA 2016-07-20 13:33:47 EDT
The initial version of my diagnostic tool just went into PDE master.

Patrik, is there any chance you could investigate this? I'm still lacking a Mac.
Comment 8 Lars Vogel CLA 2016-08-22 08:02:50 EDT
Patrik, can you check with the latest nightly download if you still can reproduce the issue on the Mac? requestLayout has been fixed in master.
Comment 9 Patrik Suzzi CLA 2016-08-22 09:15:58 EDT
Yes, I will test shortly. 

Note: I think I encountered this bug in precedence, in a different form: 

When launching an Inner Eclipse Instance from inside my Eclipse IDE, the toolbar was visible, but not clickable, until I put the launching Eclipse in the background.
Comment 10 Patrik Suzzi CLA 2016-08-23 04:41:04 EDT
With the latest nightly build the issue is not fixed. 

Please see the video here: https://www.youtube.com/watch?v=0-NBS6aDSSQ

The above video shows
- if you revert the change you still see the error (comment 1)
- the toolbar behavior is wrong until the user explicitly sets the focus out and in the Eclipse IDE again.

I tested with:
Eclipse SDK
Version: Oxygen (4.7)
Build id: N20160821-1959
OS: Mac OS X, v.10.11.5, x86_64 / cocoa
Comment 11 Lars Vogel CLA 2016-10-31 12:12:47 EDT
Mass move to M4.
Comment 12 Eclipse Genie CLA 2019-04-30 05:38:17 EDT
New Gerrit change created: https://git.eclipse.org/r/141386
Comment 13 Lars Vogel CLA 2019-04-30 05:39:56 EDT
(In reply to Eclipse Genie from comment #12)
> New Gerrit change created: https://git.eclipse.org/r/141386

Patrik, could you test if the issue is still present on Mac with the latest Eclipse release?
Comment 14 Lars Vogel CLA 2019-09-24 18:07:59 EDT
No time to investigate, please reopen if you want to work on this.
Comment 15 Lars Vogel CLA 2019-12-17 14:19:44 EST
Reopening, Paul identified a place in SWT Mac in which a update() call might be missing. This issue might be related.
Comment 16 Patrik Suzzi CLA 2019-12-18 00:21:31 EST
(In reply to Lars Vogel from comment #15)
> Reopening, Paul identified a place in SWT Mac in which a update() call might
> be missing. This issue might be related.

This could lead to a great user experience improvement on Mac!!

Also, I think there are other related bugs, such as bug 553846
Comment 17 Paul Pazderski CLA 2019-12-18 04:03:59 EST
I have no Mac and can not do much myself. The update() call Lars mention that might help here can be found in bug 354762. It is a simple update() in Display.runDeferredLayouts before return true;
Comment 18 Lars Vogel CLA 2020-02-27 09:34:12 EST
(In reply to Paul Pazderski from comment #17)
> I have no Mac and can not do much myself. The update() call Lars mention
> that might help here can be found in bug 354762. It is a simple update() in
> Display.runDeferredLayouts before return true;

Nikita, could you help in trying that out?

To test, revert http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=afffa93f93a617616c794965bc0e4c9f8900c947

See https://www.youtube.com/watch?v=aWk76qJXy6M how to reproduce.
Comment 19 Lakshmi P Shanmugam CLA 2020-04-03 06:38:10 EDT
(In reply to Patrik Suzzi from comment #10)
> With the latest nightly build the issue is not fixed. 
> 
> Please see the video here: https://www.youtube.com/watch?v=0-NBS6aDSSQ
> 
> The above video shows
> - if you revert the change you still see the error (comment 1)
> - the toolbar behavior is wrong until the user explicitly sets the focus out
> and in the Eclipse IDE again.
> 
> I tested with:
> Eclipse SDK
> Version: Oxygen (4.7)
> Build id: N20160821-1959
> OS: Mac OS X, v.10.11.5, x86_64 / cocoa

The problem (shown in video) is inactive menubar in child eclipse tracked by Bug 457921 and Bug 552063.
This is different from the original bug for the disappearing toolbar (Bug 487621).
Comment 20 Lars Vogel CLA 2020-04-03 08:35:55 EDT
(In reply to Lakshmi Shanmugam from comment #19)
> The problem (shown in video) is inactive menubar in child eclipse tracked by
> Bug 457921 and Bug 552063.
> This is different from the original bug for the disappearing toolbar (Bug
> 487621).

Thanks, so I understand that once Bug 552063 is fixed, we can retry to fix Bug 487621.
Comment 21 Lakshmi P Shanmugam CLA 2020-06-09 07:06:19 EDT
(In reply to Lars Vogel from comment #20)
> (In reply to Lakshmi Shanmugam from comment #19)
> > The problem (shown in video) is inactive menubar in child eclipse tracked by
> > Bug 457921 and Bug 552063.
> > This is different from the original bug for the disappearing toolbar (Bug
> > 487621).
> 
> Thanks, so I understand that once Bug 552063 is fixed, we can retry to fix
> Bug 487621.

No, Bug 552063 is the problem shown in the video in comment#10. It is different from Bug 487621. 
For Bug 487621, it'll be great if someone can revert the changes locally and verify if it's still a problem on Mac. If it's not reproducible anymore we can close this bug.
Comment 22 Lars Vogel CLA 2020-06-09 07:13:20 EDT
(In reply to Lakshmi Shanmugam from comment #21)
> For Bug 487621, it'll be great if someone can revert the changes locally and
> verify if it's still a problem on Mac. If it's not reproducible anymore we
> can close this bug.

Could you test this with https://git.eclipse.org/r/#/c/141386/? I still do not have a Mac.
Comment 23 Lakshmi P Shanmugam CLA 2020-06-10 01:52:29 EDT
(In reply to Lars Vogel from comment #22)
> (In reply to Lakshmi Shanmugam from comment #21)
> > For Bug 487621, it'll be great if someone can revert the changes locally and
> > verify if it's still a problem on Mac. If it's not reproducible anymore we
> > can close this bug.
> 
> Could you test this with https://git.eclipse.org/r/#/c/141386/? I still do
> not have a Mac.

I tested the gerrit using steps in https://bugs.eclipse.org/bugs/show_bug.cgi?id=487621#c23 and cannot reproduce the problem in child eclipse. To verify, I think we can merge the change and test it in the build.
Comment 24 Lars Vogel CLA 2020-06-10 04:43:51 EDT
Assignng to Lakshmi, as she did the testing on the Mac.

Lakshmi, thanks for that.