Skip to content

Commit 17ea294

Browse files
EL-File4138arch1t3cht
authored andcommitted
fix: Fallback to X11 if lacks EGL support
This should fix #233. It's recurring and is hard to fix in the downstream package. Fixing is trivial.
1 parent 42f05cf commit 17ea294

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@ void AegisubApp::OnAssertFailure(const wxChar *file, int line, const wxChar *fun
9595
AegisubApp::AegisubApp() {
9696
// http://trac.wxwidgets.org/ticket/14302
9797
wxSetEnv("UBUNTU_MENUPROXY", "0");
98+
99+
// Fallback to X11 if wxGTK implementation is build without Wayland EGL support
100+
// Fix https://github.com/TypesettingTools/Aegisub/issues/233
101+
#if defined(__WXGTK__) && !wxUSE_GLCANVAS_EGL
102+
wxString xdg_session_type = wxGetenv("XDG_SESSION_TYPE");
103+
wxString wayland_display = wxGetenv("WAYLAND_DISPLAY");
104+
105+
if (xdg_session_type == "wayland" || wayland_display.Contains("wayland")) {
106+
wxSetEnv("GDK_BACKEND", "x11");
107+
}
108+
#endif
109+
98110
}
99111

100112
namespace {

0 commit comments

Comments
 (0)