Bug 547495 - [Snippets] [Mac] Item 0 is not selected as default tab on Mac in snippet 165
Summary: [Snippets] [Mac] Item 0 is not selected as default tab on Mac in snippet 165
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.12   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-21 02:50 EDT by Sravan Kumar Lakkimsetti CLA
Modified: 2020-02-28 06:53 EST (History)
3 users (show)

See Also:


Attachments
Snippet165 (123.38 KB, image/png)
2019-12-23 06:03 EST, Lakshmi P Shanmugam CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sravan Kumar Lakkimsetti CLA 2019-05-21 02:50:58 EDT
While running snippet165 Item 0 should have been selected as default tab. but that does not happen on Mac.

build tested I20190520-1805
Comment 1 Lakshmi P Shanmugam CLA 2019-12-20 07:43:08 EST
Caused by fix for Bug 297510.
The snippet in Bug297510 - comment#0 also fails.
Comment 2 Rolf Theunissen CLA 2019-12-20 08:14:31 EST
(In reply to Lakshmi Shanmugam from comment #1)
> Caused by fix for Bug 297510.
> The snippet in Bug297510 - comment#0 also fails.

Before Bug 297510 the restored focus was never propagated from a Composite to its children. Calling setFocus instead of forceFocus changed that. All tests added in that Bug did succeed locally (but all failed on the build Mac host).

If the focus is not on the expected element, where is the focus? If you revert the change in Bug 297510, does it work correctly for this specific case?
Comment 3 Lakshmi P Shanmugam CLA 2019-12-23 06:03:33 EST
Created attachment 281315 [details]
Snippet165

>If the focus is not on the expected element, where is the focus?
Please see the attached screenshot. Before the change, the Item 0 had the focus. After the change, the chevron has the focus.
How does Snippet 165 work on GTK after the change?

>If you revert the change in Bug 297510, does it work correctly for this specific case.
I reverted only the Mac change in Decorations.java and it works as before.

>Before Bug 297510 the restored focus was never propagated from a Composite to its children. >Calling setFocus instead of forceFocus changed that. All tests added in that Bug did succeed >locally (but all failed on the build Mac host).
I wasn't able to reproduce the failures locally, but may be they were real failures caused due to changed behaviour. I think we should enable the tests that were disabled by - http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=5025aae83ad230e610a9280a70f83a66bf35d705 and fix the problem. 
WDYT?
Comment 4 Rolf Theunissen CLA 2019-12-23 15:55:32 EST
(In reply to Lakshmi Shanmugam from comment #3)
> I wasn't able to reproduce the failures locally, but may be they were real
> failures caused due to changed behaviour. I think we should enable the tests
> that were disabled by -
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=5025aae83ad230e610a9280a70f83a66bf35d705 and fix the problem. 
> WDYT?

If you manage to get these tests run stable on the Mac build servers that would be great. But all kept failing in the multiple attempts I tried before disabling.

But I think the root cause is in the CTabFolder code itself. Have a look at the comment in the setFocus method in the CTabFolder class, it is kind of undefined which widget will get focus. It seems that the initial focus is not set either.
See also Bug 212446 and Bug 306051.
Comment 5 Lakshmi P Shanmugam CLA 2020-02-28 06:53:21 EST
(In reply to Rolf Theunissen from comment #4)
> (In reply to Lakshmi Shanmugam from comment #3)
> > I wasn't able to reproduce the failures locally, but may be they were real
> > failures caused due to changed behaviour. I think we should enable the tests
> > that were disabled by -
> > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> > ?id=5025aae83ad230e610a9280a70f83a66bf35d705 and fix the problem. 
> > WDYT?
> 
> If you manage to get these tests run stable on the Mac build servers that
> would be great. But all kept failing in the multiple attempts I tried before
> disabling.
> 
> But I think the root cause is in the CTabFolder code itself. Have a look at
> the comment in the setFocus method in the CTabFolder class, it is kind of
> undefined which widget will get focus. It seems that the initial focus is
> not set either.
> See also Bug 212446 and Bug 306051.

The mentioned bugs seem to be for different focus issues with CTabFolder. The change in Bug 297510 caused this bug and it happens only on Mac. So, it needs further investigation. Moving out of 4.15.