detached 7d63e83

fix(cef): adopt slice-merged signatures from purego-cef

OnPaint, OnAcceleratedPaint, OnImeCompositionRangeChanged now receive
[]Rect slices instead of raw count+pointer pairs, matching the purego-cef
generator's automatic count+pointer merging.
commit
7d63e83d088e3dd7d66e11621b45eeef0ac579f3
author
brice · · 2026-03-19 16:10 UTC
committer
brice · · 2026-03-28 04:35 UTC
parent
0458bb4
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +6 -14
M internal/infrastructure/cef/webview_handlers.go +6 -14
@@ -90,23 +90,15 @@ func (h *handlerSet) OnPopupSize(_ purecef.Browser, _ *purecef.Rect) {}
9090
9191 // OnPaint receives the BGRA pixel buffer from CEF and forwards dirty rects
9292 // to the render pipeline for GPU upload.
93-// NOTE: dirty rects are still count+pointer (uintptr) because the purego-cef
94-// parser doesn't preserve the C type for this parameter yet. Decode manually.
95-func (h *handlerSet) OnPaint(_ purecef.Browser, _ purecef.PaintElementType, dirtyrectscount int, dirtyrects uintptr, buffer unsafe.Pointer, width int32, height int32) {
96- var rects []rect
97- if dirtyrectscount > 0 && dirtyrects != 0 {
98- // Each cef_rect_t is {x, y, width, height} as int32, but purecef.Rect
99- // has a HostLayout padding prefix. Use unsafe.Slice on the raw pointer.
100- cefRects := unsafe.Slice((*purecef.Rect)(unsafe.Pointer(dirtyrects)), dirtyrectscount)
101- rects = make([]rect, dirtyrectscount)
102- for i, dr := range cefRects {
103- rects[i] = rect{X: dr.X, Y: dr.Y, Width: dr.Width, Height: dr.Height}
104- }
93+func (h *handlerSet) OnPaint(_ purecef.Browser, _ purecef.PaintElementType, dirtyRects []purecef.Rect, buffer unsafe.Pointer, width int32, height int32) {
94+ rects := make([]rect, len(dirtyRects))
95+ for i, dr := range dirtyRects {
96+ rects[i] = rect{X: dr.X, Y: dr.Y, Width: dr.Width, Height: dr.Height}
10597 }
10698 h.wv.pipeline.handlePaint(buffer, width, height, rects)
10799 }
108100
109-func (h *handlerSet) OnAcceleratedPaint(_ purecef.Browser, _ purecef.PaintElementType, _ int, _ uintptr, _ *purecef.AcceleratedPaintInfo) {
101+func (h *handlerSet) OnAcceleratedPaint(_ purecef.Browser, _ purecef.PaintElementType, _ []purecef.Rect, _ *purecef.AcceleratedPaintInfo) {
110102 }
111103
112104 func (h *handlerSet) GetTouchHandleSize(_ purecef.Browser, _ purecef.HorizontalAlignment, _ *purecef.Size) {
@@ -122,7 +114,7 @@ func (h *handlerSet) UpdateDragCursor(_ purecef.Browser, _ purecef.DragOperation
122114
123115 func (h *handlerSet) OnScrollOffsetChanged(_ purecef.Browser, _ float64, _ float64) {}
124116
125-func (h *handlerSet) OnImeCompositionRangeChanged(_ purecef.Browser, _ *purecef.Range, _ int, _ uintptr) {
117+func (h *handlerSet) OnImeCompositionRangeChanged(_ purecef.Browser, _ *purecef.Range, _ []purecef.Rect) {
126118 }
127119
128120 func (h *handlerSet) OnTextSelectionChanged(_ purecef.Browser, _ string, _ *purecef.Range) {}
@@ -90,23 +90,15 @@ func (h *handlerSet) OnPopupSize(_ purecef.Browser, _ *purecef.Rect) {}
90 90
91 // OnPaint receives the BGRA pixel buffer from CEF and forwards dirty rects91 // OnPaint receives the BGRA pixel buffer from CEF and forwards dirty rects
92 // to the render pipeline for GPU upload.92 // to the render pipeline for GPU upload.
93-// NOTE: dirty rects are still count+pointer (uintptr) because the purego-cef93+func (h *handlerSet) OnPaint(_ purecef.Browser, _ purecef.PaintElementType, dirtyRects []purecef.Rect, buffer unsafe.Pointer, width int32, height int32) {
94-// parser doesn't preserve the C type for this parameter yet. Decode manually.94+ rects := make([]rect, len(dirtyRects))
95-func (h *handlerSet) OnPaint(_ purecef.Browser, _ purecef.PaintElementType, dirtyrectscount int, dirtyrects uintptr, buffer unsafe.Pointer, width int32, height int32) {95+ for i, dr := range dirtyRects {
96- var rects []rect96+ rects[i] = rect{X: dr.X, Y: dr.Y, Width: dr.Width, Height: dr.Height}
97- if dirtyrectscount > 0 && dirtyrects != 0 {
98- // Each cef_rect_t is {x, y, width, height} as int32, but purecef.Rect
99- // has a HostLayout padding prefix. Use unsafe.Slice on the raw pointer.
100- cefRects := unsafe.Slice((*purecef.Rect)(unsafe.Pointer(dirtyrects)), dirtyrectscount)
101- rects = make([]rect, dirtyrectscount)
102- for i, dr := range cefRects {
103- rects[i] = rect{X: dr.X, Y: dr.Y, Width: dr.Width, Height: dr.Height}
104- }
105 }97 }
106 h.wv.pipeline.handlePaint(buffer, width, height, rects)98 h.wv.pipeline.handlePaint(buffer, width, height, rects)
107 }99 }
108 100
109-func (h *handlerSet) OnAcceleratedPaint(_ purecef.Browser, _ purecef.PaintElementType, _ int, _ uintptr, _ *purecef.AcceleratedPaintInfo) {101+func (h *handlerSet) OnAcceleratedPaint(_ purecef.Browser, _ purecef.PaintElementType, _ []purecef.Rect, _ *purecef.AcceleratedPaintInfo) {
110 }102 }
111 103
112 func (h *handlerSet) GetTouchHandleSize(_ purecef.Browser, _ purecef.HorizontalAlignment, _ *purecef.Size) {104 func (h *handlerSet) GetTouchHandleSize(_ purecef.Browser, _ purecef.HorizontalAlignment, _ *purecef.Size) {
@@ -122,7 +114,7 @@ func (h *handlerSet) UpdateDragCursor(_ purecef.Browser, _ purecef.DragOperation
122 114
123 func (h *handlerSet) OnScrollOffsetChanged(_ purecef.Browser, _ float64, _ float64) {}115 func (h *handlerSet) OnScrollOffsetChanged(_ purecef.Browser, _ float64, _ float64) {}
124 116
125-func (h *handlerSet) OnImeCompositionRangeChanged(_ purecef.Browser, _ *purecef.Range, _ int, _ uintptr) {117+func (h *handlerSet) OnImeCompositionRangeChanged(_ purecef.Browser, _ *purecef.Range, _ []purecef.Rect) {
126 }118 }
127 119
128 func (h *handlerSet) OnTextSelectionChanged(_ purecef.Browser, _ string, _ *purecef.Range) {}120 func (h *handlerSet) OnTextSelectionChanged(_ purecef.Browser, _ string, _ *purecef.Range) {}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close