summaryrefslogtreecommitdiff
path: root/wm
diff options
context:
space:
mode:
authorgutteridge <gutteridge@pkgsrc.org>2022-10-20 00:39:50 +0000
committergutteridge <gutteridge@pkgsrc.org>2022-10-20 00:39:50 +0000
commit05fa772588e6d59d0401e77a9a957694702050bd (patch)
tree4a5e5b2825153fa7aa2b312945bcf8f6904dfebe /wm
parent7d813f783511bd460c4ba21d1e3acf7b7ed3003e (diff)
downloadpkgsrc-05fa772588e6d59d0401e77a9a957694702050bd.tar.gz
fvwm: backport fix for locking issues with libX11 1.8.1
Issue reported and patches tested by John D. Baker, on NetBSD-Users@.
Diffstat (limited to 'wm')
-rw-r--r--wm/fvwm/Makefile4
-rw-r--r--wm/fvwm/distinfo5
-rw-r--r--wm/fvwm/patches/patch-fvwm_events.c30
-rw-r--r--wm/fvwm/patches/patch-libs_FEvent.c36
-rw-r--r--wm/fvwm/patches/patch-libs_FEvent.h22
5 files changed, 94 insertions, 3 deletions
diff --git a/wm/fvwm/Makefile b/wm/fvwm/Makefile
index 0ad858df10e..17b307084a7 100644
--- a/wm/fvwm/Makefile
+++ b/wm/fvwm/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.61 2022/08/02 01:05:02 gutteridge Exp $
+# $NetBSD: Makefile,v 1.62 2022/10/20 00:39:50 gutteridge Exp $
DISTNAME= fvwm-${FVWM_VER}
-PKGREVISION= 14
+PKGREVISION= 15
CATEGORIES= wm x11
MASTER_SITES= ${MASTER_SITE_GITHUB:=fvwmorg/}
GITHUB_RELEASE= ${FVWM_VER}
diff --git a/wm/fvwm/distinfo b/wm/fvwm/distinfo
index bc342a8e69f..16ca43d0abb 100644
--- a/wm/fvwm/distinfo
+++ b/wm/fvwm/distinfo
@@ -1,7 +1,10 @@
-$NetBSD: distinfo,v 1.9 2021/10/26 11:25:13 nia Exp $
+$NetBSD: distinfo,v 1.10 2022/10/20 00:39:50 gutteridge Exp $
BLAKE2s (fvwm-2.6.9.tar.gz) = 59e97f514d9192e4d8c6de287ab63a78ba6f742dfbce87597f26f6f5cf642915
SHA512 (fvwm-2.6.9.tar.gz) = a9c2214ad19edd17da81446a6d4250284cc50b59b53c233212f2a9354c01143dbb870521392752f272f00af50bee2dd8f0b6bf6176b0d4b3075694d2a61a623e
Size (fvwm-2.6.9.tar.gz) = 3942859 bytes
SHA1 (patch-ab) = d9e960ed7be624a36af5a8a3ad4422f4ed4ce64e
+SHA1 (patch-fvwm_events.c) = effd8fd31a3c1f28a3e71dbcb9569621d996cc31
SHA1 (patch-fvwm_fvwm-reproducible.c) = 96515959482750a25bfe59e9a370d0ef0295bc89
+SHA1 (patch-libs_FEvent.c) = 358243d198251c6ea0bf546e31a94cb089355e45
+SHA1 (patch-libs_FEvent.h) = 0dae96a21839945ac9627269608aa1bbafaa8d65
diff --git a/wm/fvwm/patches/patch-fvwm_events.c b/wm/fvwm/patches/patch-fvwm_events.c
new file mode 100644
index 00000000000..ca4a976b4b7
--- /dev/null
+++ b/wm/fvwm/patches/patch-fvwm_events.c
@@ -0,0 +1,30 @@
+$NetBSD: patch-fvwm_events.c,v 1.1 2022/10/20 00:39:50 gutteridge Exp $
+
+Backport "Fix for lock recusion in handle_all_expose()"
+https://github.com/fvwmorg/fvwm3/pull/683
+
+--- fvwm/events.c.orig 2018-05-26 11:35:26.000000000 +0000
++++ fvwm/events.c
+@@ -258,6 +258,12 @@ static int _pred_weed_accumulate_expose(
+ return 1;
+ }
+
++static int _pred_weed_is_expose(
++ Display *display, XEvent *event, XPointer arg)
++{
++ return (event->type == Expose);
++}
++
+ static int _pred_weed_handle_expose(
+ Display *display, XEvent *event, XPointer arg)
+ {
+@@ -4542,7 +4548,8 @@ void handle_all_expose(void)
+
+ saved_event = fev_save_event();
+ FPending(dpy);
+- FWeedIfEvents(dpy, _pred_weed_handle_expose, NULL);
++ FWeedAndHandleIfEvents(dpy, _pred_weed_is_expose,
++ _pred_weed_handle_expose, NULL);
+ fev_restore_event(saved_event);
+
+ return;
diff --git a/wm/fvwm/patches/patch-libs_FEvent.c b/wm/fvwm/patches/patch-libs_FEvent.c
new file mode 100644
index 00000000000..1d161f2e1a9
--- /dev/null
+++ b/wm/fvwm/patches/patch-libs_FEvent.c
@@ -0,0 +1,36 @@
+$NetBSD: patch-libs_FEvent.c,v 1.1 2022/10/20 00:39:50 gutteridge Exp $
+
+Backport "Fix for lock recusion in handle_all_expose()"
+https://github.com/fvwmorg/fvwm3/pull/683
+
+--- libs/FEvent.c.orig 2018-05-26 11:35:26.000000000 +0000
++++ libs/FEvent.c
+@@ -532,6 +532,28 @@ int FWeedIfEvents(
+ return weed_args.count;
+ }
+
++int FWeedAndHandleIfEvents(
++ Display *display,
++ int (*weed_predicate) (Display *display, XEvent *event, XPointer arg),
++ int (*handler) (Display *display, XEvent *event, XPointer arg),
++ XPointer arg)
++{
++ _fev_weed_args weed_args;
++ XEvent e;
++
++ assert(fev_is_invalid_event_type_set);
++ memset(&weed_args, 0, sizeof(weed_args));
++ weed_args.weed_predicate = weed_predicate;
++ weed_args.arg = arg;
++ if (FCheckPeekIfEvent(display, &e, _fev_pred_weed_if,
++ (XPointer)&weed_args)) {
++ handler(display, &e, arg);
++ }
++ _fev_pred_weed_if_finish(&weed_args);
++
++ return weed_args.count;
++}
++
+ int FWeedIfWindowEvents(
+ Display *display, Window window,
+ int (*weed_predicate) (
diff --git a/wm/fvwm/patches/patch-libs_FEvent.h b/wm/fvwm/patches/patch-libs_FEvent.h
new file mode 100644
index 00000000000..8f6ce90f7ee
--- /dev/null
+++ b/wm/fvwm/patches/patch-libs_FEvent.h
@@ -0,0 +1,22 @@
+$NetBSD: patch-libs_FEvent.h,v 1.1 2022/10/20 00:39:50 gutteridge Exp $
+
+Backport "Fix for lock recusion in handle_all_expose()"
+https://github.com/fvwmorg/fvwm3/pull/683
+
+--- libs/FEvent.h.orig 2016-10-15 14:51:45.000000000 +0000
++++ libs/FEvent.h
+@@ -113,6 +113,14 @@ int FWeedIfEvents(
+ Display *display, XEvent *current_event, XPointer arg),
+ XPointer arg);
+
++/* Same as FWeedIfEvents but with a second callback out of XLockDisplay()
++ * to handle events in a lock-safe manner */
++int FWeedAndHandleIfEvents(
++ Display *display,
++ int (*weed_predicate) (Display *display, XEvent *event, XPointer arg),
++ int (*handler) (Display *display, XEvent *event, XPointer arg),
++ XPointer arg);
++
+ /* Same as FWeedIfEvents but weeds only events for the given window. The
+ * weed_predicate is only called for events with a matching window. */
+ int FWeedIfWindowEvents(