[Win32] GC.getClipping(Region) loses the window origin in advanced mode on a double-buffered paint GC
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start by tracing Composite.WM_PAINT and GC.getClippingRegion() alongside initGdip(); the issue identifies the window-origin and clipping-coordinate mismatch in the double-buffered advanced-mode path. Reproduce with the reported CTabFolder paint scenario, then verify that saving and restoring clipping through a Region leaves getClipping() unchanged in both advanced and non-advanced modes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On Windows, once the paint GC of a SWT.DOUBLE_BUFFERED control is in advanced graphics mode, set explicitly or implicitly by setAlpha/setAntialias, getClipping(Region) disagrees with getClipping(). The region is short by the window origin that the double buffering installed and initGdip() removed, so saving and restoring the clipping through a Region shrinks the clip and clips away everything drawn afterwards.
Composite.WM_PAINT calls SetWindowOrgEx(hdc, ps.left, ps.top). initGdip() then does SelectClipRgn(handle, 0) and the GDI+ graphics takes over the DC transform, after which GetWindowOrgEx is (0,0). GC.getClippingRegion() offsets by that lost origin, while the region held by GDI+ is still in the buffer's coordinates.
Measured (real CTabFolder paint, 150% zoom, damage {74,0,188,23}):
advanced=false getClipping()={74,0,188,23} windowOrg=(111,0) round-trip exact
advanced=true getClipping()={74,0,188,23} windowOrg=(0,0)
getClipping(Region) for {96,0,166,23} -> {96,0,92,23} short by 74
after restore: getClipping()={74,0,114,23}
Expected behavior
A getClipping(Region)/setClipping(Region) round-trip is lossless and agrees with getClipping(), regardless of the GC's advanced mode.
Environment
Windows 11 Home 10.0.26200, 150% zoom (also seen at emulated 100%).
Additional context
Found while fixing #3522. That fix avoids advanced mode for the rest of the paint and so dodges this defect, but does not repair it. Any code that switches a double-buffered paint GC to advanced mode and saves/restores clipping via a Region is exposed.
No standalone Canvas reproducer yet: a SWT.DOUBLE_BUFFERED Canvas came back lossless in both modes because that paint never took the buffered code path. The trace above is from a real CTabFolder paint.
- Lingua principale
- Java
- Stelle
- 202
- Fork
- 206
- Merge medio
- 14h 7m
- PR unite (30g)
- 103
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di eclipse-platform/eclipse.platform.swt
-
`SWT_AWT.initFrame` takes `(long, String)` in Java; the GTK native declares no `className` and the Cocoa native types it `const char *`Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
eclipse-platform/eclipse.platform.swt#3665 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
eclipse-platform/eclipse.platform.swt#3546 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
eclipse-platform/eclipse.platform.swt#3428 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
eclipse-platform/eclipse.platform.swt#3336 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
eclipse-platform/eclipse.platform.swt#3718 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di eclipse-platform/eclipse.platform.swt
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
apache/rocketmq-dashboard#6610 ·
I maintainer di solito rispondono entro 3 giorni
-
Citationcount column sorts alphabetically instead of numericallyForse già presa @kpunia306 l’ha presa oggi. Apertastatus: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
JabRef/jabref#17459 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
`RedisList.reversed()` view returns an empty `range` and `trim` removes all elementsForse già presa @CCCLL l’ha presa oggi. Apertastatus: waiting-for-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
spring-projects/spring-data-redis#3461 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
javapathfinder/jpf-core#649 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
devops-thiago/ThrillhouseBot#1093 ·
I maintainer di solito rispondono entro 1 giorno