From 7d4434ea4ceb1fa5c75f372a73ac6dfe5cb05b1d Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Thu, 8 May 2025 12:42:39 -0400 Subject: Don't crash on Wayland without decoration manager Signed-off-by: Andrew Opalach --- src/egl_common.c | 4 ++-- src/window_wayland.c | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/egl_common.c b/src/egl_common.c index d77e6cb..9bfc31f 100644 --- a/src/egl_common.c +++ b/src/egl_common.c @@ -44,9 +44,9 @@ bool stl_load_egl(struct stl_egl_global *global) log_error("Failed to load EGL (glad)."); return false; } - log_info("Using EGL (glad) version %s.", eglQueryString(global->display, EGL_VERSION)); + log_debug("Using EGL (glad) version %s.", eglQueryString(global->display, EGL_VERSION)); #else - log_info("Using EGL version %s.", eglQueryString(global->display, EGL_VERSION)); + log_debug("Using EGL version %s.", eglQueryString(global->display, EGL_VERSION)); #endif return true; diff --git a/src/window_wayland.c b/src/window_wayland.c index b9ac67d..7d37a11 100644 --- a/src/window_wayland.c +++ b/src/window_wayland.c @@ -896,10 +896,12 @@ static bool create_toplevel(struct stl_window_wayland *wl, s32 scale, const char xdg_toplevel_set_min_size(wl->xdg_toplevel, STELA_MIN_WIDTH, STELA_MIN_HEIGHT); xdg_surface_set_window_geometry(wl->xdg_surface, 0, 0, geom_width, geom_height); - u32 decor = ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE; - wl->zxdg_toplevel_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration( - wl->zxdg_decoration_manager, wl->xdg_toplevel); - zxdg_toplevel_decoration_v1_set_mode(wl->zxdg_toplevel_decoration, decor); + if (wl->zxdg_decoration_manager) { + u32 decor = ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE; + wl->zxdg_toplevel_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration( + wl->zxdg_decoration_manager, wl->xdg_toplevel); + zxdg_toplevel_decoration_v1_set_mode(wl->zxdg_toplevel_decoration, decor); + } return true; } -- cgit v1.2.3-101-g0448