Skip to content

[GTK] TreeItem.setExpanded() / getExpanded() inconsistency #2887

@iloveeclipse

Description

@iloveeclipse

Regression from #2836.

In two tests for our application we see regression after merge of #2836 to master.

The problem is that TreeItem.getExpanded() now relates solely on the SWT TreeItem.isExpanded field state (not on GTK state) but TreeItem.setExpanded() not always sets new SWT expanded state to the TreeItem because it still relies on GTK expanded state for the SWT state change.

So if parent is collapsed in SWT & GTK, the setExpanded(false) doesn't change SWT state because GTK internally assumes the child already collapsed.

I have a fix & regression test.

I will provide also JFace test for that, because the regression is also visible in JFace if instead of TreeViewer.collapseToLevel(child, AbstractTreeViewer.ALL_LEVELS) the specific element is used to collapse the tree, like TreeViewer.collapseToLevel(child, 2). This extra handling of ALL_LEVELS argument in AbstractTreeViewer.optionallyPruneChildren(Item, Object) "hides" the inconsistency in SWT.

Metadata

Metadata

Assignees

Labels

Linux/GTKHappens on LinuxbugSomething isn't workingregressionSomething that used to work

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions