Skip to content

[Linux] [MacOS] CTabFolder renders tabs with a delay #3319

@basilevs

Description

@basilevs

CTabFolder does not render tabs in a timely manner on Linux and MaxOS x86_64. The problem is not observed on Windows and MacOS aarch64.

Test steps

Execute following test from #3295

@ParameterizedTest
@CsvSource(value = {"false,0", "false,1", "true,0", "true,1"})
public void test_tabsAreRendered(boolean nestComposite, int activateTab) {
	Composite parent = shell;
	Control[] children = shell.getChildren();
	for (Control child : children) {
		child.dispose();
	}
	if (nestComposite) {
		parent = new Composite(parent, SWT.NONE);
		parent.setLayout(new FillLayout());
	}
	ctabFolder = new CTabFolder(parent, SWT.NONE);
	setWidget(ctabFolder);
	shell.setSize(800, 400);
	ctabFolder.setBackground(RED);
	ctabFolder.setForeground(BLUE);
	ctabFolder.setSelectionForeground(BLUE);
	CTabItem tab = createTabItem(1);
	openShell(shell);
	processEvents();
	Rectangle bounds = tab.getBounds();
	assertTrue(hasPixel(ctabFolder, BLUE, bounds));
	tab = createTabItem(2);
	ctabFolder.setSelection(activateTab);
	SwtTestUtil.processEvents();
	bounds = tab.getBounds();
	assertTrue(hasPixel(ctabFolder, BLUE, bounds)); // reference 1
	tab.dispose();
	SwtTestUtil.processEvents();
	assertFalse(hasPixel(ctabFolder, BLUE, bounds)); // reference 2
}

private CTabItem createTabItem(int i) {
	CTabItem item = new CTabItem(ctabFolder, SWT.CLOSE);
	item.setText("█".repeat(10));
	Label content = new Label(ctabFolder, SWT.NONE);
	content.setText("Content " + i);
	item.setControl(content);
	return item;
}

The test creates two tabs, activates one of them and ensures that tab text is rendered. The test always fails for any parameter.

A characteristic screenshot captured from CI environment for GTK3, x86_64, x11:

Image

Instead of expected two tabs, only one is shown. This happens for all parameters but the last one failing test on line "reference 1".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions