Skip to content

Commit bb5fffb

Browse files
linesightclaude
andcommitted
Fix macOS ARM64 compile errors: update stale cef_types_mac.h and cef_mac.h
The bundled headers were missing CEF 146 macOS additions: - cef_types_mac.h: add includes for cef_types_color.h, cef_types_osr.h, cef_types_runtime.h; add size field to _cef_window_info_t; add runtime_style field; add cef_accelerated_paint_info_t; use typedefs for handle types instead of macros - cef_mac.h: init size field in CefWindowInfoTraits, copy runtime_style in set(), set runtime_style=ALLOY in SetAsWindowless(), modernize CefWindowInfo using base_type alias pattern Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0dff81a commit bb5fffb

2 files changed

Lines changed: 60 additions & 17 deletions

File tree

src/include/internal/cef_mac.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CefMainArgs : public cef_main_args_t {
5353
struct CefWindowInfoTraits {
5454
typedef cef_window_info_t struct_type;
5555

56-
static inline void init(struct_type* s) {}
56+
static inline void init(struct_type* s) { s->size = sizeof(struct_type); }
5757

5858
static inline void clear(struct_type* s) {
5959
cef_string_clear(&s->window_name);
@@ -71,6 +71,7 @@ struct CefWindowInfoTraits {
7171
target->shared_texture_enabled = src->shared_texture_enabled;
7272
target->external_begin_frame_enabled = src->external_begin_frame_enabled;
7373
target->view = src->view;
74+
target->runtime_style = src->runtime_style;
7475
}
7576
};
7677

@@ -79,14 +80,9 @@ struct CefWindowInfoTraits {
7980
///
8081
class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
8182
public:
82-
typedef CefStructBase<CefWindowInfoTraits> parent;
83-
84-
CefWindowInfo() : parent() {}
85-
explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
86-
explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
87-
88-
CefWindowInfo& operator=(const CefWindowInfo&) = default;
89-
CefWindowInfo& operator=(CefWindowInfo&&) = default;
83+
using base_type = CefStructBase<CefWindowInfoTraits>;
84+
using base_type::CefStructBase;
85+
using base_type::operator=;
9086

9187
///
9288
/// Create the browser as a child view.
@@ -112,6 +108,7 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
112108
void SetAsWindowless(CefWindowHandle parent) {
113109
windowless_rendering_enabled = true;
114110
parent_view = parent;
111+
runtime_style = CEF_RUNTIME_STYLE_ALLOY;
115112
}
116113
};
117114

src/include/internal/cef_types_mac.h

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,16 @@
3131
#define CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_
3232
#pragma once
3333

34+
#if !defined(GENERATING_CEF_API_HASH)
3435
#include "include/base/cef_build.h"
36+
#endif
3537

3638
#if defined(OS_MAC)
3739
#include "include/internal/cef_string.h"
40+
#include "include/internal/cef_types_color.h"
3841
#include "include/internal/cef_types_geometry.h"
39-
40-
// Handle types.
41-
// Actually NSCursor*
42-
#define cef_cursor_handle_t void*
43-
// Acutally NSEvent*
44-
#define cef_event_handle_t void*
45-
// Actually NSView*
46-
#define cef_window_handle_t void*
42+
#include "include/internal/cef_types_osr.h"
43+
#include "include/internal/cef_types_runtime.h"
4744

4845
#define kNullCursorHandle NULL
4946
#define kNullEventHandle NULL
@@ -73,6 +70,16 @@
7370
extern "C" {
7471
#endif
7572

73+
// Handle types.
74+
// Actually NSCursor*
75+
typedef void* cef_cursor_handle_t;
76+
// Actually NSEvent*
77+
typedef void* cef_event_handle_t;
78+
// Actually NSView*
79+
typedef void* cef_window_handle_t;
80+
// Actually IOSurface*
81+
typedef void* cef_shared_texture_handle_t;
82+
7683
///
7784
/// Structure representing CefExecuteProcess arguments.
7885
///
@@ -85,6 +92,11 @@ typedef struct _cef_main_args_t {
8592
/// Class representing window information.
8693
///
8794
typedef struct _cef_window_info_t {
95+
///
96+
/// Size of this structure.
97+
///
98+
size_t size;
99+
88100
cef_string_t window_name;
89101

90102
///
@@ -134,8 +146,42 @@ typedef struct _cef_window_info_t {
134146
/// rendering.
135147
///
136148
cef_window_handle_t view;
149+
150+
///
151+
/// Optionally change the runtime style. Alloy style will always be used if
152+
/// |windowless_rendering_enabled| is true or if |parent_view| is provided.
153+
/// See cef_runtime_style_t documentation for details.
154+
///
155+
cef_runtime_style_t runtime_style;
137156
} cef_window_info_t;
138157

158+
///
159+
/// Structure containing shared texture information for the OnAcceleratedPaint
160+
/// callback. Resources will be released to the underlying pool for reuse when
161+
/// the callback returns from client code.
162+
///
163+
typedef struct _cef_accelerated_paint_info_t {
164+
///
165+
/// Size of this structure.
166+
///
167+
size_t size;
168+
169+
///
170+
/// Handle for the shared texture IOSurface.
171+
///
172+
cef_shared_texture_handle_t shared_texture_io_surface;
173+
174+
///
175+
/// The pixel format of the texture.
176+
///
177+
cef_color_type_t format;
178+
179+
///
180+
/// The extra common info.
181+
///
182+
cef_accelerated_paint_info_common_t extra;
183+
} cef_accelerated_paint_info_t;
184+
139185
#ifdef __cplusplus
140186
}
141187
#endif

0 commit comments

Comments
 (0)