From eb8e7a519caff49e028c09e9d77fa01f04fcbfcf Mon Sep 17 00:00:00 2001 From: "Patrick J. Taylor" Date: Mon, 3 Aug 2026 17:11:43 +0100 Subject: [PATCH] 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 --- .../xcrysden-1.6.2-accumulation-buffer.patch | 20 +++++++++++++++++++ .../xcrysden-1.6.2-disable-accum-buffer.patch | 15 -------------- ...6.2-r2.ebuild => xcrysden-1.6.2-r3.ebuild} | 2 +- 3 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 sci-chemistry/xcrysden/files/xcrysden-1.6.2-accumulation-buffer.patch delete mode 100644 sci-chemistry/xcrysden/files/xcrysden-1.6.2-disable-accum-buffer.patch rename sci-chemistry/xcrysden/{xcrysden-1.6.2-r2.ebuild => xcrysden-1.6.2-r3.ebuild} (96%) diff --git a/sci-chemistry/xcrysden/files/xcrysden-1.6.2-accumulation-buffer.patch b/sci-chemistry/xcrysden/files/xcrysden-1.6.2-accumulation-buffer.patch new file mode 100644 index 0000000000..d3a6abd0ea --- /dev/null +++ b/sci-chemistry/xcrysden/files/xcrysden-1.6.2-accumulation-buffer.patch @@ -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 + + diff --git a/sci-chemistry/xcrysden/files/xcrysden-1.6.2-disable-accum-buffer.patch b/sci-chemistry/xcrysden/files/xcrysden-1.6.2-disable-accum-buffer.patch deleted file mode 100644 index bb11ec7678..0000000000 --- a/sci-chemistry/xcrysden/files/xcrysden-1.6.2-disable-accum-buffer.patch +++ /dev/null @@ -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 - - diff --git a/sci-chemistry/xcrysden/xcrysden-1.6.2-r2.ebuild b/sci-chemistry/xcrysden/xcrysden-1.6.2-r3.ebuild similarity index 96% rename from sci-chemistry/xcrysden/xcrysden-1.6.2-r2.ebuild rename to sci-chemistry/xcrysden/xcrysden-1.6.2-r3.ebuild index a1c29be4c5..2a1d5111bd 100644 --- a/sci-chemistry/xcrysden/xcrysden-1.6.2-r2.ebuild +++ b/sci-chemistry/xcrysden/xcrysden-1.6.2-r3.ebuild @@ -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"