diff options
| author | 2025-08-14 10:55:11 -0400 | |
|---|---|---|
| committer | 2025-08-14 10:55:11 -0400 | |
| commit | a4be897cf71e2e6d4a98c0be612da7e01e3273f5 (patch) | |
| tree | a73fd8187efc283f9573ce4ebde597dfc1c8ced1 | |
| parent | 88d24e4caa0211b78d3d86d9fab5ec9e11d9b66d (diff) | |
| download | stela-a4be897cf71e2e6d4a98c0be612da7e01e3273f5.tar.gz stela-a4be897cf71e2e6d4a98c0be612da7e01e3273f5.tar.bz2 stela-a4be897cf71e2e6d4a98c0be612da7e01e3273f5.zip | |
Move wayland surface commit before egl init
Signed-off-by: Andrew Opalach <andrew@akon.city>
| -rw-r--r-- | src/window_wayland.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/window_wayland.c b/src/window_wayland.c index a313a08..7598038 100644 --- a/src/window_wayland.c +++ b/src/window_wayland.c @@ -1019,15 +1019,6 @@ static bool window_wayland_create_window(struct stl_window *window, u32 width, u } } -#ifdef STELA_API_OPENGL - if (!wl_egl_init(wl)) { - goto err; - } - stl_egl_make_current(&wl->egl); - stl_egl_swap_interval(&wl->egl, (flags & STELA_WINDOW_VSYNC) ? 1 : 0); - stl_egl_release_current(&wl->egl); -#endif - wl->cursor.serial = 0; wl->cursor.pointer = NULL; wl->frame.pointer_x = FRAME_NO_VALUE; @@ -1035,9 +1026,19 @@ static bool window_wayland_create_window(struct stl_window *window, u32 width, u wl->frame.scroll_x = FRAME_NO_VALUE; wl->frame.scroll_y = FRAME_NO_VALUE; + // Keep this before egl_init() for optimal window creation speed. wl_surface_commit(wl->surface); wl_display_roundtrip(wl->display); +#ifdef STELA_API_OPENGL + if (!wl_egl_init(wl)) { + goto err; + } + stl_egl_make_current(&wl->egl); + stl_egl_swap_interval(&wl->egl, (flags & STELA_WINDOW_VSYNC) ? 1 : 0); + stl_egl_release_current(&wl->egl); +#endif + return true; err: log_error("Failed to create window."); |