Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#3,319 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
java
领域
desktop

调研方向

Start with the test_tabsAreRendered reproduction linked from PR #3295 and run it on the affected Linux or macOS x86_64 setup. Then trace how CTabFolder renders and updates tabs on those platforms, comparing with the working platforms. Done means the test passes for all parameters and both tabs render and disappear as asserted.

由索引模型根据 Issue 内容生成。

描述

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 https://github.com/eclipse-platform/eclipse.platform.swt/pull/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".

主要语言
Java
星标
202
派生
206
平均合并
16 小时 56 分钟
30 天内合并 PR
110

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

eclipse-platform/eclipse.platform.swt 的其他 Issue

查看 eclipse-platform/eclipse.platform.swt 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。