sci-chemistry/xcrysden: manage OpenGL accumulation buffer at runtime

The previous revision of this ebuild applied a patch to prevent Togl
from requesting an OpenGL accumulation buffer when XCrySDen is launched,
which can cause crashes when running under XWayland. Unfortunately, it
turns out that this also disables antialiasing, which is clearly not
desirable when running under X11 if this fix is not strictly
necessary. The new patch ensures that we only disable the accumulation
buffer (at runtime) if we are more or less certainly running within a
Wayland session.

Signed-off-by: Patrick J. Taylor <patrick.joseph.taylor@gmail.com>
This commit is contained in:
Patrick J. Taylor committed 2026-08-03 17:11:43 +01:00
1 parent 95e99952bb
commit eb8e7a519c
3 files changed
+21 -16

No files matched your search

@@ -0,0 +1,20 @@
Disable OpenGL accumulation buffer when running under XWayland
diff --git a/Tcl/custom-definitions b/Tcl/custom-definitions
index 5267760..2635452 100644
--- a/Tcl/custom-definitions
+++ b/Tcl/custom-definitions
@@ -18,7 +18,12 @@
# $XCRYSDEN_TOPDIR/Tcl/toglOpt.tcl
# ------------------------------------------------------------------------
-#set toglOpt(accum) false
+if {[info exists ::env(XDG_SESSION_TYPE)] &&
+ $::env(XDG_SESSION_TYPE) eq "wayland"} {
+ set toglOpt(accum) false
+} elseif {[info exists ::env(WAYLAND_DISPLAY)]} {
+ set toglOpt(accum) false
+}
#set toglOpt(stereo) none
@@ -1,15 +0,0 @@
Disable OpenGL accumulation buffer for XWayland compatibility
diff --git a/Tcl/custom-definitions b/Tcl/custom-definitions
index 5267760..1221749 100644
--- a/Tcl/custom-definitions
+++ b/Tcl/custom-definitions
@@ -18,7 +18,7 @@
# $XCRYSDEN_TOPDIR/Tcl/toglOpt.tcl
# ------------------------------------------------------------------------
-#set toglOpt(accum) false
+set toglOpt(accum) false
#set toglOpt(stereo) none
@@ -25,7 +25,7 @@ DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}/${P}-c23.patch"
"${FILESDIR}/${P}-disable-accum-buffer.patch"
"${FILESDIR}/${P}-accumulation-buffer.patch"
"${FILESDIR}/${P}-ext-bwidget.patch"
"${FILESDIR}/${P}-LDFLAGS.patch"
"${FILESDIR}/${P}-Togl-lib.patch"