From 1811cbebd4e31414772bd5b75c0503d06b1528aa Mon Sep 17 00:00:00 2001 From: Deepika Udayagiri Date: Thu, 8 Feb 2024 18:53:32 +0530 Subject: [PATCH] Update the selectedIndex when the 1st CTabItem is created. Fixes https://github.com/eclipse-platform/eclipse.platform.swt/issues/46 --- .../common/org/eclipse/swt/custom/CTabFolder.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java index d1acaab705a..0260e18ecb5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java @@ -775,6 +775,7 @@ void createItem (CTabItem item, int index) { if (items.length == 1) { updateFolder(UPDATE_TAB_HEIGHT | REDRAW); + selectedIndex = selectedIndex + 1; } else { updateFolder(REDRAW_TABS); }