Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ndviewer_light/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4019,8 +4019,22 @@ def closeEvent(self, event):

def main(dataset_path: str = None):
"""Launch lightweight viewer."""
import os
import platform
import sys

# On Linux Wayland sessions, PyQt5 + vispy (OpenGL) fails to create an EGL
# surface ("Could not create EGL surface", "QOpenGLWidget: Failed to make
# context current"), so the viewer crashes on startup. Fall back to
# XWayland (xcb), which renders reliably, unless the user has already
# chosen a Qt platform.
if (
platform.system() == "Linux"
and os.environ.get("WAYLAND_DISPLAY")
and "QT_QPA_PLATFORM" not in os.environ
):
os.environ["QT_QPA_PLATFORM"] = "xcb"

app = QApplication(sys.argv)

if dataset_path:
Expand Down
Loading