Skip to content

Commit e2ef751

Browse files
linesightclaude
andcommitted
Fix window_info.pyx Darwin SetAsChild: use CefRect instead of 5-arg form
SetAsChild(parent, x, y, w, h) was removed; the API now takes (parent, CefRect). Update the Darwin branch to match the Linux branch, constructing CefRect from [left,top,right,bottom] windowRect and also setting runtime_style = CEF_RUNTIME_STYLE_ALLOY. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a64f75d commit e2ef751

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/window_info.pyx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ cdef void SetCefWindowInfo(
2222
cdef CefRect windowRect
2323
cdef CefString windowName
2424
cdef RECT rect
25+
ELIF UNAME_SYSNAME == "Darwin":
26+
cdef CefRect windowRect
2527
ELIF UNAME_SYSNAME == "Linux":
2628
cdef CefRect windowRect
2729

@@ -43,12 +45,15 @@ cdef void SetCefWindowInfo(
4345
# CEF 123+: must request Alloy runtime for native windowed rendering.
4446
cefWindowInfo.runtime_style = CEF_RUNTIME_STYLE_ALLOY
4547
ELIF UNAME_SYSNAME == "Darwin":
48+
x = int(windowInfo.windowRect[0])
49+
y = int(windowInfo.windowRect[1])
50+
width = int(windowInfo.windowRect[2] - windowInfo.windowRect[0])
51+
height = int(windowInfo.windowRect[3] - windowInfo.windowRect[1])
52+
windowRect = CefRect(x, y, width, height)
4653
cefWindowInfo.SetAsChild(
4754
<CefWindowHandle>windowInfo.parentWindowHandle,
48-
int(windowInfo.windowRect[0]),
49-
int(windowInfo.windowRect[1]),
50-
int(windowInfo.windowRect[2]),
51-
int(windowInfo.windowRect[3]))
55+
windowRect)
56+
cefWindowInfo.runtime_style = CEF_RUNTIME_STYLE_ALLOY
5257
ELIF UNAME_SYSNAME == "Linux":
5358
x = int(windowInfo.windowRect[0])
5459
y = int(windowInfo.windowRect[1])

0 commit comments

Comments
 (0)