Skip to content

[Cocoa] Copy the client area with the parent background in GC.copyArea - #3848

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:cocoa-gc-copyarea-control-area
Open

vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:cocoa-gc-copyarea-control-area

Conversation

@vogella

@vogella vogella commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

On Cocoa, GC.copyArea(Image, int, int) on a control applied the client-area rectangle unconverted to the scroll view of a bordered control, so the captured image was shifted by the bezel, and it rendered only the control's own views, so transparent pixels came back empty. The capture now comes from the window content view with the rectangle converted from the control's view, so pixel (0,0) is the client area's top-left and the parent background shows through, as on GTK and Win32. A re-entrancy guard in GC keeps a Paint listener that calls copyArea from recursing when the content view is a foreign view without SWT's own guard. Test_cocoa_GCCopyArea covers a bordered Composite at zero and non-zero offsets and a transparent Label over a colored shell.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (macosx)

   362 files  +  182    362 suites  +182   30m 10s ⏱️ + 14m 41s
 4 916 tests +    2  4 482 ✅ +    2    434 💤 ±  0  0 ❌ ±0 
10 238 runs  +5 123  9 038 ✅ +4 523  1 200 💤 +600  0 ❌ ±0 

Results for commit 64c6a3d. ± Comparison against base commit a67dc32.

♻️ This comment has been updated with latest results.

GC.copyArea(Image, int, int) on a control applied the client-area rectangle to the scroll view of a bordered control unconverted, so the image was shifted by the bezel, and rendered only the control's own views, so transparent pixels came back empty. It now captures from the window content view with the rectangle converted from the control's view, like the on-screen pixels on GTK and Win32.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the cocoa-gc-copyarea-control-area branch from 49428e3 to 64c6a3d Compare November 12, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant