Commit a3de8a7
Fix infinite Text redraw for SWT.SEARCH with custom background on macOS
On cocoa, Text.drawInteriorWithFrame_inView_searchfield queried the
search field text via NSControl.stringValue to decide whether to draw
the cancel icon. That call schedules a setNeedsDisplay: on the view
from inside the paint pass. Widget.setNeedsDisplay then enqueues the
view in display.needsDisplay, which is flushed after paint, marking
the view dirty again and causing readAndDispatch() to spin forever.
Read the text through NSCell.stringValue instead, which bypasses the
control-level side effect. Also add the JUnit regression test from
PR eclipse-platform#3260 reproducing the loop.
Fixes eclipse-platform/eclipse.platform.ui#3920
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 12b37f8 commit a3de8a7
3 files changed
Lines changed: 40 additions & 1 deletion
File tree
- bundles/org.eclipse.swt
- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa
- Eclipse SWT/cocoa/org/eclipse/swt/widgets
- tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
177 | 182 | | |
178 | 183 | | |
179 | 184 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
751 | | - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
752 | 759 | | |
753 | 760 | | |
754 | 761 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
1376 | 1378 | | |
1377 | 1379 | | |
1378 | 1380 | | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
1379 | 1406 | | |
1380 | 1407 | | |
1381 | 1408 | | |
| |||
0 commit comments