| Summary: | [10.15] Some categories in tree not displaying in PreferenceDialog on MacOS 10.15 | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Phil Beauvoir <p.beauvoir> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Sravan Kumar Lakkimsetti <sravankumarl> |
| Severity: | normal | ||
| Priority: | P3 | CC: | a.nesheret, Lars.Vogel, lshanmug, peter, ts-swt |
| Version: | 4.13 | ||
| Target Milestone: | 4.15 M3 | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X | ||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=558584 | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 553808 | ||
|
Description
Phil Beauvoir
Could you provide a Gerrit? (In reply to Lars Vogel from comment #1) > Could you provide a Gerrit? Lars, I can certainly take a look into the issue but I won't be able to look at it for a couple of weeks. The workaround is, in fact, simpler: - Resize the dialog window This gives us a clue. Perhaps PreferenceDialog#layoutTreeAreaControl() is the culprit? (Will investigate further and provide a Gerrit if I can) After some time investigating I've found a workaround or fix in org.eclipse.jface.preference.PreferenceDialog:
protected void layoutTreeAreaControl(Control control) {
GridDataFactory.fillDefaults().hint(getLastRightWidth(), convertVerticalDLUsToPixels(120)).grab(false, true)
.applyTo(control);
// Workaround for 552514
control.getParent().layout(true);
}
But these are the issues I'm facing:
1. I don't know if this is a proper fix or a workaround. The root cause may lie elsewhere.
2. I want to surround that line of code with a call to Platform.getOS() and to check that we're on Mac OS and that the OS version number >= 10.15 but the bundle doesn't import org.eclipse.core.runtime so I can't do that.
Layout calls are bad. Does requestLayout() also work? (In reply to Lars Vogel from comment #5) > Layout calls are bad. Does requestLayout() also work? No. The problem also occurs in org.eclipse.ui.internal.dialogs.PropertyDialog so I now need to look in org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog (In reply to Phil Beauvoir from comment #6) > The problem also occurs in org.eclipse.ui.internal.dialogs.PropertyDialog so > I now need to look in > org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog Actually the workaround also works for org.eclipse.ui.internal.dialogs.PropertyDialog so nothing to do with FilteredPreferenceDialog I think the underlying issue is when a tree node is selected when opening the dialog. Mac seems to differ on the order of UI events in some cases. When the dialog is opened and the last selected tree node is reselected this is called in PreferenceDialog#selectSavedItem(): getTreeViewer().setSelection(new StructuredSelection(node), true); getTreeViewer().getControl().setFocus(); If we call these two lines in a Display.asyncExec() runnable block then the tree nodes are all correctly displayed. However, this breaks other code that puts the focus on the search text box in FilteredPreferenceDialog#selectSavedItem() I don't have a solution to this other than the workaround above. (In reply to Lars Vogel from comment #5) > Layout calls are bad. Does requestLayout() also work? This also works: control.getParent().pack(); pack() eventually calls this: setSize (computeSize (SWT.DEFAULT, SWT.DEFAULT, true)); (In reply to Phil Beauvoir from comment #0) > Eclipse 4.13 > MacOS 10.15 > > Steps to reproduce: > > 1. Open Preferences dialog > 2. Select the "Java" category on the left. > 3. Close Preferences dialog > 4. Re-open Preferences dialog > > All categories above "Java" are no longer visible. Can't reproduce under Linux therefore it looks like an SWT Mac problem. Moving to SWT. Phil, are you able to reproduce this with a SWT snippet? Lars, I don't think this is an SWT issue. It's to do with the order of selecting a tree node and then laying out the tree and parent composite. This is only occurring in the Preferences dialog. (You won't be able to reproduce it under Windows, either.) In my experience, these types of issues are caused by the order of some events being different on Mac. I tested with a modified snippet (https://git.eclipse.org/c/platform/eclipse.platform.ui.git/plain/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet002TreeViewer.java) that simply selects the nth node in the SWT Tree and could not reproduce this issue. Therefore, I think this issue is unique to PreferencesDialog and the order of creating the Tree, laying out and selecting a node in MacOS 10.15. Another example of this type of Mac issue can be found here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=545279 Fix for Bug 558584 fixes the Preferences dialog as well. *** This bug has been marked as a duplicate of bug 558584 *** |