diff options
| author | Arslaan Pathan <[email protected]> | 2026-05-06 18:25:48 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-05-06 18:25:48 +1200 |
| commit | e6a1e69bea00fc808ae71709abc4e6a4b8f33b3b (patch) | |
| tree | 5a243630948e08700431a8a82dd3fbc238f2f224 /src | |
| parent | f21101b98ccd509b4a416723b956158042b7f6e7 (diff) | |
| download | saffronwebkit-e6a1e69bea00fc808ae71709abc4e6a4b8f33b3b.tar.xz saffronwebkit-e6a1e69bea00fc808ae71709abc4e6a4b8f33b3b.zip | |
Work on Wayland support, use different EGL context that shares with the other one
eaaaaaaaaaaaaaaaaaaaaaaaaaaa
Diffstat (limited to 'src')
| -rw-r--r-- | src/sfwk-wpe.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sfwk-wpe.c b/src/sfwk-wpe.c index 7d6c5e7..b9c04a4 100644 --- a/src/sfwk-wpe.c +++ b/src/sfwk-wpe.c @@ -508,14 +508,18 @@ static bool sfwk_webview_ensure_initialized(SFWKWebView* webview) { return false; } - SDL_GLContext ctx = webview->window->gl_context; + SDL_GLContext ctx = saffron_window_get_gl_context(webview->window); if (!ctx) { g_debug("sfwk: no gl context in window?? good luck"); return false; } + EGLContext saffron_ctx = (EGLContext)ctx; + EGLDisplay saffron_display = (EGLDisplay)saffron_window_get_egl_display(webview->window); + EGLConfig saffron_conf = saffron_window_get_egl_config(webview->window); - saffron_window_detach_gl_context(webview->window); - if (!SDL_GL_MakeCurrent(webview->window->sdl_window, ctx)) { + EGLContext webkit_ctx = eglCreateContext(saffron_display, saffron_conf, saffron_ctx, NULL); + + if (!SDL_GL_MakeCurrent(webview->window->sdl_window, (SDL_GLContext)webkit_ctx)) { g_debug("SFWK: SDL_GL_MakeCurrent failed: %s", SDL_GetError()); return false; } |
