ITADN

[Win] StyledText with paint artifacts

#3298Opentmssngr 创建于 2026-05-12
T
tmssngrcommented
**Describe the bug** Resizing a shell with a `StyledText` control leaves paint artifacts. **To Reproduce** Run this snippet: ```java import org.eclipse.swt.*; import org.eclipse.swt.custom.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class StyledTextExample { public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new FillLayout()); final StyledText styledText = new StyledText(shell, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI); styledText.setText("line 1\nline 2\nline 3\nline 4\n"); shell.setSize(400, 300); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } } ``` and resize the shell to become larger. **Expected behavior** There must not be repaint artifacts. **Screenshots** Initial display (Windows 11, 175% zoom): <img width="680" height="515" alt="Image" src="https://github.com/user-attachments/assets/183b3eb4-bc6a-435a-b5e6-5ac5635b3689" /> After resizing a little bit: <img width="745" height="541" alt="Image" src="https://github.com/user-attachments/assets/1958a2c0-50f5-47c1-9534-64b63ee82f6d" /> **Environment:** 1. Select the platform(s) on which the behavior is seen: - - [ ] All OS - - [x] Windows - - [ ] Linux - - [ ] macOS
10 条评论