From 8654766fed0d86d9ebfc42e275ce624b8ef1f5e2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 25 Sep 2023 00:43:58 +0200 Subject: [PATCH] Check that Wayland subsurface creation succeeded It seems that the check for m_surface added in 952de605f6 (Handle map/unmap events on Wayland's wxGLCanvasEGL, 2023-08-25) was a copy-paste error and we actually need to check m_wlSubsurface here. --- src/unix/glegl.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/unix/glegl.cpp b/src/unix/glegl.cpp index 79e8d991c3..2ab88a143b 100644 --- a/src/unix/glegl.cpp +++ b/src/unix/glegl.cpp @@ -577,17 +577,13 @@ void wxGLCanvasEGL::CreateWaylandSubsurface() m_wlSubsurface = wl_subcompositor_get_subsurface(m_wlSubcompositor, m_wlSurface, surface); + wxCHECK_RET( m_wlSubsurface, "Unable to get EGL subsurface" ); + wl_subsurface_set_desync(m_wlSubsurface); wxEGLUpdatePosition(this); m_wlFrameCallbackHandler = wl_surface_frame(surface); wl_callback_add_listener(m_wlFrameCallbackHandler, &wl_frame_listener, this); - - if ( m_surface == EGL_NO_SURFACE ) - { - wxFAIL_MSG("Unable to create EGL surface"); - return; - } #endif }