git: ebd43103a866 - main - x11-toolkits/open-motif*: Don't share cached Xft renditions across display connections

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Tue, 05 Dec 2023 00:09:25 UTC
The branch main has been updated by cy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ebd43103a86630e2f6a55b73b538e039aa066dbf

commit ebd43103a86630e2f6a55b73b538e039aa066dbf
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2023-12-04 23:44:53 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-12-05 00:02:05 +0000

    x11-toolkits/open-motif*: Don't share cached Xft renditions across display connections
    
    Xft rendition caching added with the fix #1414 won't check whether the
    matching rendition was allocated trough a different display connection.
    This causes a forked process that creates Motif widgets on a separate
    display connection to fail with RenderBadGlyphSet X error as soon as
    the parent process closes its display, thus invalidating the associated
    Xft font resource.
    
    Obtained from:  https://sourceforge.net/p/motif/code/merge-requests/4/
---
 x11-toolkits/open-motif-devel/Makefile                    |  2 +-
 .../open-motif-devel/files/patch-lib_Xm_XmRenderT.c       | 15 +++++++++++++++
 x11-toolkits/open-motif/Makefile                          |  2 +-
 x11-toolkits/open-motif/files/patch-lib_Xm_XmRenderT.c    | 15 +++++++++++++++
 4 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/x11-toolkits/open-motif-devel/Makefile b/x11-toolkits/open-motif-devel/Makefile
index d34714852e78..298f7c6f06f1 100644
--- a/x11-toolkits/open-motif-devel/Makefile
+++ b/x11-toolkits/open-motif-devel/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	open-motif
 PORTVERSION=	${COMMIT_DATE}
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	x11-toolkits
 PKGNAMESUFFIX=	-devel
 
diff --git a/x11-toolkits/open-motif-devel/files/patch-lib_Xm_XmRenderT.c b/x11-toolkits/open-motif-devel/files/patch-lib_Xm_XmRenderT.c
new file mode 100644
index 000000000000..45fe127e420c
--- /dev/null
+++ b/x11-toolkits/open-motif-devel/files/patch-lib_Xm_XmRenderT.c
@@ -0,0 +1,15 @@
+--- lib/Xm/XmRenderT.c.orig	2023-02-15 16:42:34.000000000 -0800
++++ lib/Xm/XmRenderT.c	2023-12-04 15:42:20.894104000 -0800
+@@ -2091,10 +2091,9 @@
+ 						  static int count_rend=0, num_rend;
+ 						  num_rend = GetSameRenditions(rend_cache, rend, count_rend);
+ 
+-						  if (num_rend>=0)
++						  if(num_rend >= 0 && (display == _XmRendDisplay(rend_cache[num_rend]))) {
+ 							  _XmRendXftFont(rend) = _XmRendXftFont(rend_cache[num_rend]);
+-						  else
+-						  {
++						  } else {
+ #endif
+ 		    _XmRendPattern(rend) = FcPatternCreate();
+ 		    if (_XmRendFontName(rend))
diff --git a/x11-toolkits/open-motif/Makefile b/x11-toolkits/open-motif/Makefile
index 47eb20ebd003..e90595a26679 100644
--- a/x11-toolkits/open-motif/Makefile
+++ b/x11-toolkits/open-motif/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	open-motif
 PORTVERSION=	2.3.8
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	x11-toolkits
 # MASTER_SITES=	SF/${PORTNAME}/Motif%202.3.4%20Source%20Code/
 MASTER_SITES=	SF/motif/Motif%20${PORTVERSION}%20Source%20Code/
diff --git a/x11-toolkits/open-motif/files/patch-lib_Xm_XmRenderT.c b/x11-toolkits/open-motif/files/patch-lib_Xm_XmRenderT.c
new file mode 100644
index 000000000000..84b92bd900b7
--- /dev/null
+++ b/x11-toolkits/open-motif/files/patch-lib_Xm_XmRenderT.c
@@ -0,0 +1,15 @@
+--- lib/Xm/XmRenderT.c.orig	2017-03-27 15:24:31.000000000 -0700
++++ lib/Xm/XmRenderT.c	2023-12-04 15:42:22.406098000 -0800
+@@ -2091,10 +2091,9 @@
+ 						  static int count_rend=0, num_rend;
+ 						  num_rend = GetSameRenditions(rend_cache, rend, count_rend);
+ 
+-						  if (num_rend>=0)
++						  if(num_rend >= 0 && (display == _XmRendDisplay(rend_cache[num_rend]))) {
+ 							  _XmRendXftFont(rend) = _XmRendXftFont(rend_cache[num_rend]);
+-						  else
+-						  {
++						  } else {
+ #endif
+ 		    _XmRendPattern(rend) = FcPatternCreate();
+ 		    if (_XmRendFontName(rend))