From ab4ae96e05e5ac76b4bb31b25e25734914bc375f Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Wed, 28 Dec 2022 18:27:04 +0000 Subject: [PATCH] Clarify/set condition: wayland && !wayland_egl Check for the condition where the windowing system has wayland support but not wayland EGL support for wxGLCanvas in wx, in which case the Simple renderer must be forced. This is currently how the wx packages are built on Fedora. Refer #1028 Signed-off-by: Rafael Kitover --- src/wx/dialogs/display-config.cpp | 2 +- src/wx/wayland.h | 8 +++++++- src/wx/wxvbam.cpp | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/wx/dialogs/display-config.cpp b/src/wx/dialogs/display-config.cpp index 004fecca..29408410 100644 --- a/src/wx/dialogs/display-config.cpp +++ b/src/wx/dialogs/display-config.cpp @@ -294,7 +294,7 @@ DisplayConfig::DisplayConfig(wxWindow* parent) #ifdef NO_OGL GetValidatedChild(this, "OutputOpenGL")->Hide(); -#elif defined(__WXGTK__) && !wxCHECK_VERSION(3, 2, 0) +#elif defined(HAVE_WAYLAND_SUPPORT) && !defined(HAVE_WAYLAND_EGL) // wxGLCanvas segfaults on Wayland before wx 3.2. if (IsWayland()) { GetValidatedChild(this, "OutputOpenGL")->Hide(); diff --git a/src/wx/wayland.h b/src/wx/wayland.h index 65a14c5b..be25c01a 100644 --- a/src/wx/wayland.h +++ b/src/wx/wayland.h @@ -21,8 +21,14 @@ constexpr bool IsWayland() { return false; } #endif // wayland +#if defined(__WXGTK__) && defined(HAVE_EGL) && wxCHECK_VERSION(3, 2, 0) && wxUSE_GLCANVAS_EGL + +#define HAVE_WAYLAND_EGL + +#endif + // Temporary hack to backport 800d6ed69b from wxWidgets until 3.2.2 is released. -#if defined(__WXGTK__) && defined(HAVE_EGL) && wxCHECK_VERSION(3, 2, 0) && !wxCHECK_VERSION(3, 2, 2) && wxUSE_GLCANVAS_EGL +#if defined(HAVE_WAYLAND_EGL) && !wxCHECK_VERSION(3, 2, 2) #define WAYLAND_MOVE_SUBSURFACE_BACKPORT diff --git a/src/wx/wxvbam.cpp b/src/wx/wxvbam.cpp index 2e31c166..6066e49c 100644 --- a/src/wx/wxvbam.cpp +++ b/src/wx/wxvbam.cpp @@ -359,7 +359,7 @@ bool wxvbamApp::OnInit() { load_opts(); // wxGLCanvas segfaults under wayland before wx 3.2 -#if defined(__WXGTK__) && !wxCHECK_VERSION(3, 2, 0) +#if defined(HAVE_WAYLAND_SUPPORT) && !defined(HAVE_WAYLAND_EGL) if (UsingWayland()) { config::OptDispRenderMethod()->SetRenderMethod( config::RenderMethod::kSimple);