From 61768dd15317a9e077b0180198a23177d4cb3eb8 Mon Sep 17 00:00:00 2001 From: aniketsahu07 Date: Fri, 22 May 2026 16:17:14 +0530 Subject: [PATCH 1/2] Fix: reserve dropdown popup scrollbar width to avoid suffix text cropping on GTK/Linux --- .../com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java index 7b9dc2f0..73385eac 100644 --- a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java +++ b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java @@ -156,6 +156,12 @@ void open(Point location, List groups, String selectedItemId, populateGroups(container, groups); Point contentSize = container.computeSize(SWT.DEFAULT, SWT.DEFAULT); + int scrollBarWidth = 0; + if (scrolledComposite.getVerticalBar() != null) { + scrollBarWidth = scrolledComposite.getVerticalBar().getSize().x; + } + // Reserve space for the vertical scrollbar to avoid cropping suffix text on GTK/Linux + contentSize.x += scrollBarWidth; container.setSize(contentSize); scrolledComposite.setMinSize(contentSize); From 4c3065f471c8fe685b8c07a0309ef0d0ae3c1c46 Mon Sep 17 00:00:00 2001 From: aniketsahu07 Date: Sun, 24 May 2026 07:59:05 +0530 Subject: [PATCH 2/2] Fix(review): avoid double-reserving scrollbar width; reserve only when constrained/scrollable --- .../microsoft/copilot/eclipse/ui/swt/DropdownPopup.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java index 73385eac..2937e9e2 100644 --- a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java +++ b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java @@ -156,12 +156,9 @@ void open(Point location, List groups, String selectedItemId, populateGroups(container, groups); Point contentSize = container.computeSize(SWT.DEFAULT, SWT.DEFAULT); - int scrollBarWidth = 0; - if (scrolledComposite.getVerticalBar() != null) { - scrollBarWidth = scrolledComposite.getVerticalBar().getSize().x; - } - // Reserve space for the vertical scrollbar to avoid cropping suffix text on GTK/Linux - contentSize.x += scrollBarWidth; + // Keep sizing simple here. If the popup becomes scrollable we reserve + // scrollbar width in constrainHeightIfNeeded(), avoiding double-reserving + // the width when the scrollbar is detected in both places. container.setSize(contentSize); scrolledComposite.setMinSize(contentSize);