summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2023-01-19 21:07:32 +0000
committer Eric Hameleers <alien@slackware.com>2023-01-19 22:32:40 +0100
commit14094b8867a3f7e7e1012a29da49d5b2cce683d5 (patch)
tree7fbbb6c6164d9d4c9377a325ba8e2d3dd7998ebe /source
parentf493ddecac957a63e0ffb71febc2fcf454113aa3 (diff)
downloadcurrent-14094b8867a3f7e7e1012a29da49d5b2cce683d5.tar.gz
current-14094b8867a3f7e7e1012a29da49d5b2cce683d5.tar.xz
Thu Jan 19 21:07:32 UTC 202320230119210732
a/pkgtools-15.1-noarch-4.txz: Rebuilt. makepkg: also let xz decide how many threads to use on ARM platforms aarch64 and riscv64. Thanks to Stuart Winter. installpkg: fix reversed test for if a --threads option was given. It appears that it's been wrong for years but since xz didn't support threaded decompression yet it wasn't noticed. a/xz-5.4.1-x86_64-2.txz: Rebuilt. Reduce default verbosity from V_WARNING to V_ERROR to avoid sending non-fatal memory usage information to stderr. kde/plasma-wayland-protocols-1.10.0-x86_64-1.txz: Upgraded. l/exiv2-0.27.6-x86_64-1.txz: Upgraded. l/tdb-1.4.8-x86_64-1.txz: Upgraded. x/igt-gpu-tools-1.27.1-x86_64-1.txz: Upgraded. x/libX11-1.8.3-x86_64-2.txz: Rebuilt. [PATCH] Fix a9e845 and 797755 Allow X*IfEvent() to reenter libX11 Thanks to marav.
Diffstat (limited to 'source')
-rwxr-xr-xsource/a/pkgtools/pkgtools.SlackBuild2
-rw-r--r--source/a/pkgtools/scripts/installpkg4
-rw-r--r--source/a/pkgtools/scripts/makepkg6
-rwxr-xr-xsource/a/xz/xz.SlackBuild7
-rw-r--r--source/a/xz/xz.default.verbosity.V_ERROR.diff11
-rw-r--r--source/installer/ChangeLog.txt9
-rwxr-xr-xsource/installer/build_installer.sh57
-rwxr-xr-xsource/installer/sources/bricktick/fetch-bricktick.sh52
-rw-r--r--source/x/x11/build/libX112
-rw-r--r--source/x/x11/patch/libX11.patch1
-rw-r--r--source/x/x11/patch/libX11/eb1c272ab5230d548077b9f59aca4b3457c3a8f8.patch205
11 files changed, 344 insertions, 12 deletions
diff --git a/source/a/pkgtools/pkgtools.SlackBuild b/source/a/pkgtools/pkgtools.SlackBuild
index 67058d409..ab2f57334 100755
--- a/source/a/pkgtools/pkgtools.SlackBuild
+++ b/source/a/pkgtools/pkgtools.SlackBuild
@@ -30,7 +30,7 @@ PKGNAM=pkgtools
# *** UPDATE THESE WITH EACH BUILD:
VERSION=15.1
ARCH=${ARCH:-noarch}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-4}
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
diff --git a/source/a/pkgtools/scripts/installpkg b/source/a/pkgtools/scripts/installpkg
index 64791afc6..c5c6ee2af 100644
--- a/source/a/pkgtools/scripts/installpkg
+++ b/source/a/pkgtools/scripts/installpkg
@@ -360,7 +360,7 @@ if [ "$MODE" = "warn" ]; then
fi
;;
'txz' )
- if [ ! "$XZ_THREADS_FORCED" = "yes" ]; then
+ if [ "$XZ_THREADS_FORCED" = "yes" ]; then
packagecompression="xz --threads=${THREADS}"
else
# Let xz determine how many threads to use:
@@ -449,7 +449,7 @@ for package in $* ; do
fi
;;
'txz' )
- if [ ! "$XZ_THREADS_FORCED" = "yes" ]; then
+ if [ "$XZ_THREADS_FORCED" = "yes" ]; then
packagecompression="xz --threads=${THREADS}"
else
# Let xz determine how many threads to use:
diff --git a/source/a/pkgtools/scripts/makepkg b/source/a/pkgtools/scripts/makepkg
index 72746fa84..7ddf5dbd4 100644
--- a/source/a/pkgtools/scripts/makepkg
+++ b/source/a/pkgtools/scripts/makepkg
@@ -251,8 +251,7 @@ elif [ ! "$(basename $PACKAGE_NAME .tar.lzma)" = "$PACKAGE_NAME" ]; then
elif [ ! "$(basename $PACKAGE_NAME .txz)" = "$PACKAGE_NAME" ]; then
EXTENSION="txz"
if [ ! "$XZ_THREADS_FORCED" = "yes" ]; then
- # TODO: Add ARM 64-bit $ARCHes to this test:
- if [ "$(uname -m)" = "x86_64" ]; then
+ if [[ "$(uname -m)" =~ (x86_64|aarch64|riscv64) ]]; then
# Allow xz to determine how many threads to use:
COMPRESSOR="xz ${COMPRESS_OPTION} --threads=0 -c"
else
@@ -269,8 +268,7 @@ elif [ ! "$(basename $PACKAGE_NAME .txz)" = "$PACKAGE_NAME" ]; then
elif [ ! "$(basename $PACKAGE_NAME .tar.xz)" = "$PACKAGE_NAME" ]; then
EXTENSION="tar.xz"
if [ ! "$XZ_THREADS_FORCED" = "yes" ]; then
- # TODO: Add ARM 64-bit $ARCHes to this test:
- if [ "$(uname -m)" = "x86_64" ]; then
+ if [[ "$(uname -m)" =~ (x86_64|aarch64|riscv64) ]]; then
# Allow xz to determine how many threads to use:
COMPRESSOR="xz ${COMPRESS_OPTION} --threads=0 -c"
else
diff --git a/source/a/xz/xz.SlackBuild b/source/a/xz/xz.SlackBuild
index c23d2d2b0..5a3284a79 100755
--- a/source/a/xz/xz.SlackBuild
+++ b/source/a/xz/xz.SlackBuild
@@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=xz
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -89,6 +89,11 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
+# Change default verbosity from V_WARNING to V_ERROR to prevent spamming
+# the screen with messages concerning steps that xz it taking to reduce
+# memory use (these aren't indicating any sort of failure, so...)
+zcat $CWD/xz.default.verbosity.V_ERROR.diff.gz | patch -p1 --verbose || exit 1
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
diff --git a/source/a/xz/xz.default.verbosity.V_ERROR.diff b/source/a/xz/xz.default.verbosity.V_ERROR.diff
new file mode 100644
index 000000000..c6c3aef45
--- /dev/null
+++ b/source/a/xz/xz.default.verbosity.V_ERROR.diff
@@ -0,0 +1,11 @@
+--- ./src/xz/message.c.orig 2023-01-11 10:51:42.000000000 -0600
++++ ./src/xz/message.c 2023-01-19 13:52:39.484987693 -0600
+@@ -22,7 +22,7 @@
+ static unsigned int files_total;
+
+ /// Verbosity level
+-static enum message_verbosity verbosity = V_WARNING;
++static enum message_verbosity verbosity = V_ERROR;
+
+ /// Filename which we will print with the verbose messages
+ static const char *filename;
diff --git a/source/installer/ChangeLog.txt b/source/installer/ChangeLog.txt
index a1f932521..584bb9bd0 100644
--- a/source/installer/ChangeLog.txt
+++ b/source/installer/ChangeLog.txt
@@ -1,3 +1,12 @@
+Thu Jan 19 20:44:24 UTC 2023
+ build_installer.sh: Switch /bin/dd from BusyBox's implementation to
+ Coreutils', which offers a richer feature set. For example, the command line
+ parameter 'status=progress' provides realtime visibility of critical metrics
+ (transfer speed, ETA, % complete). This helps when working with the storage,
+ where the installer is used as an preparation and test environment.
+ Thanks to Stuart Winter.
+ Added "bricktick", an ncurses based game (why not, it's only 31K)
++--------------------------+
Wed Jan 18 20:30:13 UTC 2023
/usr/lib/setup/INS-all-in-one: Added.
This detects the AiO (All in One Offline) partition labeled 'SLKins_aio-pkgs'
diff --git a/source/installer/build_installer.sh b/source/installer/build_installer.sh
index 0ded4adb1..80f4ca658 100755
--- a/source/installer/build_installer.sh
+++ b/source/installer/build_installer.sh
@@ -108,6 +108,7 @@ case $ARCH in
# The firmware we include by default is only for x86, but
ADD_NETFIRMWARE=1 # we'll probably want to include some at some stage. For now supply -nf to this script.
ADD_NANO=1
+ ADD_BRICKTICK=1
;;
x86_64)
ADD_NETMODS=1
@@ -124,6 +125,7 @@ case $ARCH in
VERBOSE=1
ADD_NETFIRMWARE=1 # Include the network card firmware
ADD_NANO=1
+ ADD_BRICKTICK=1
;;
i586)
ADD_NETMODS=1
@@ -140,6 +142,7 @@ case $ARCH in
VERBOSE=1
ADD_NETFIRMWARE=1 # Include the network card firmware
ADD_NANO=1
+ ADD_BRICKTICK=1
;;
*)
ADD_NETMODS=1 # add network modules
@@ -155,6 +158,7 @@ case $ARCH in
VERBOSE=1 # show a lot of additional output
ADD_NETFIRMWARE=1 # Include the network card firmware
ADD_NANO=1
+ ADD_BRICKTICK=1
;;
esac
@@ -235,6 +239,10 @@ while [ ! -z "$1" ]; do
ADD_NETMODS=1
shift
;;
+ -nb|--no-bricktick)
+ ADD_BRICKTICK=0
+ shift
+ ;;
-nc|--no-compressmods)
COMPRESS_MODS=0
shift
@@ -670,9 +678,9 @@ make $SILENTMAKE $NUMJOBS CFLAGS="$SLKCFLAGS" || exit 1
make $SILENTMAKE $NUMJOBS install || exit 1
cd _install
-# Since Slackware 's installer uses the 'date' from coreutils, and 'zcat'
-# script from gzip, we delete the busybox symlinks:
-rm -f${VERBOSE1} bin/date bin/zcat
+# Since Slackware's installer uses the 'date' and 'dd' from coreutils,
+# and the 'zcat' script from gzip, we delete the busybox symlinks:
+rm -f${VERBOSE1} bin/{date,dd,zcat}
# Likewise, we will remove the 'fdisk' applet which overwrites our shell script:
rm -f${VERBOSE1} sbin/fdisk
@@ -829,6 +837,43 @@ fi
}
+############### Build bricktick ################################################
+
+build_bricktick()
+{
+echo "--- Building bricktick ncurses game ---"
+# Extract source:
+cd $TMP
+if [ -d $CWD/sources/bricktick ]; then
+ echo "--- Using _your_ bricktick sources (not those in the Slacktree) ---"
+ BRICKTICKPATH=$CWD/sources/bricktick
+elif [ -d $SRCDIR/sources/bricktick ]; then
+ echo "--- Using _your_ bricktick sources (not those in the Slacktree) ---"
+ BRICKTICKPATH=$SRCDIR/sources/bricktick
+else
+ # Use the bricktick sources from the Slackware tree.
+ BRICKTICKPATH=$SLACKROOT/source/installer/bricktick
+fi
+[ ! -d $BRICKTICKPATH ] && ( echo "No directory '$BRICKTICKPATH'" ; exit 1 )
+BRICKTICKPKG=$(ls -1 $BRICKTICKPATH/bricktick-*.tar.?z | head -1)
+BRICKTICKVER=$(echo $BRICKTICKPKG | rev | cut -f 3- -d . | cut -f 1 -d - | rev)
+tar x${VERBOSE2}f $BRICKTICKPKG
+
+echo "--- Compiling BRICKTICK version '$BRICKTICKVER' ---"
+cd bricktick* || exit 1
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+
+# Build:
+make $NUMJOBS || make || exit 1
+
+# Install into installer's filesystem:
+mkdir -p $PKG/$ARCH-installer-filesystem/usr/bin
+cp -a bricktick $PKG/$ARCH-installer-filesystem/usr/bin/bricktick
+strip --strip-unneeded $PKG/$ARCH-installer-filesystem/usr/bin/bricktick
+
+}
+
############### Build dnsmasq ##################################################
build_dnsmasq()
@@ -1015,6 +1060,7 @@ cp --remove-destination -fa${VERBOSE1} ${EXTRA_PKGS_BIN} \
cp \
cut \
date \
+ dd \
dialog \
dircolors \
findmnt \
@@ -2380,6 +2426,11 @@ else
build_nano
fi
+ # Are we adding the bricktick game?
+ if [ $ADD_BRICKTICK -eq 1 ]; then
+ build_bricktick
+ fi
+
# Are we adding network modules?
if [ $ADD_NETMODS -eq 1 ]; then
add_netmods
diff --git a/source/installer/sources/bricktick/fetch-bricktick.sh b/source/installer/sources/bricktick/fetch-bricktick.sh
new file mode 100755
index 000000000..15a8e2b14
--- /dev/null
+++ b/source/installer/sources/bricktick/fetch-bricktick.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+# Copyright 2019, 2020 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+PKGNAM=bricktick
+
+# Pull a stable branch + patches
+BRANCH=${1:-master}
+
+# Clear download area:
+rm -rf ${PKGNAM}
+
+# Clone repository:
+git clone https://github.com/Subsentient/${PKGNAM}
+
+# checkout $BRANCH:
+( cd ${PKGNAM}
+ git checkout $BRANCH || exit 1
+)
+
+HEADISAT="$( cd ${PKGNAM} && git log -1 --format=%h )"
+DATE="$( cd ${PKGNAM} && git log -1 --format=%cd --date=format:%Y%m%d )"
+LONGDATE="$( cd ${PKGNAM} && git log -1 --format=%cd --date=format:%c )"
+# Cleanup. We're not packing up the whole git repo.
+( cd ${PKGNAM} && find . -type d -name ".git*" -exec rm -rf {} \; 2> /dev/null )
+mv ${PKGNAM} ${PKGNAM}-${DATE}_${HEADISAT}
+tar cf ${PKGNAM}-${DATE}_${HEADISAT}.tar ${PKGNAM}-${DATE}_${HEADISAT}
+plzip -9 -f ${PKGNAM}-${DATE}_${HEADISAT}.tar
+rm -rf ${PKGNAM}-${DATE}_${HEADISAT}
+touch -d "$LONGDATE" ${PKGNAM}-${DATE}_${HEADISAT}.tar.lz
+echo
+echo "${PKGNAM} branch $BRANCH with HEAD at $HEADISAT packaged as ${PKGNAM}-${DATE}_${HEADISAT}.tar.lz"
+echo
diff --git a/source/x/x11/build/libX11 b/source/x/x11/build/libX11
index d00491fd7..0cfbf0888 100644
--- a/source/x/x11/build/libX11
+++ b/source/x/x11/build/libX11
@@ -1 +1 @@
-1
+2
diff --git a/source/x/x11/patch/libX11.patch b/source/x/x11/patch/libX11.patch
new file mode 100644
index 000000000..4ba7a9dda
--- /dev/null
+++ b/source/x/x11/patch/libX11.patch
@@ -0,0 +1 @@
+zcat $CWD/patch/libX11/eb1c272ab5230d548077b9f59aca4b3457c3a8f8.patch.gz | patch -p1 --backup --suffix=.orig || { touch ${SLACK_X_BUILD_DIR}/${PKGNAME}.failed ; continue ; }
diff --git a/source/x/x11/patch/libX11/eb1c272ab5230d548077b9f59aca4b3457c3a8f8.patch b/source/x/x11/patch/libX11/eb1c272ab5230d548077b9f59aca4b3457c3a8f8.patch
new file mode 100644
index 000000000..badc4e5eb
--- /dev/null
+++ b/source/x/x11/patch/libX11/eb1c272ab5230d548077b9f59aca4b3457c3a8f8.patch
@@ -0,0 +1,205 @@
+From eb1c272ab5230d548077b9f59aca4b3457c3a8f8 Mon Sep 17 00:00:00 2001
+From: GaryOderNichts <garyodernichts@gmail.com>
+Date: Sat, 17 Dec 2022 16:28:40 +0100
+Subject: [PATCH] Fix a9e845 and 797755 Allow X*IfEvent() to reenter libX11
+
+---
+ include/X11/Xlibint.h | 9 +++++-
+ src/ChkIfEv.c | 5 +++-
+ src/IfEvent.c | 5 +++-
+ src/PeekIfEv.c | 5 +++-
+ src/locking.c | 65 +++++++++----------------------------------
+ 5 files changed, 33 insertions(+), 56 deletions(-)
+
+diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h
+index e20c4833..50099b43 100644
+--- a/include/X11/Xlibint.h
++++ b/include/X11/Xlibint.h
+@@ -43,6 +43,10 @@ from The Open Group.
+ #include <X11/Xproto.h> /* to declare xEvent */
+ #include <X11/XlibConf.h> /* for configured options like XTHREADS */
+
++#ifdef XTHREADS
++#include <X11/Xthreads.h>
++#endif
++
+ /* The Xlib structs are full of implicit padding to properly align members.
+ We can't clean that up without breaking ABI, so tell clang not to bother
+ complaining about it. */
+@@ -207,7 +211,10 @@ struct _XDisplay
+
+ XIOErrorExitHandler exit_handler;
+ void *exit_handler_data;
+- CARD32 in_ifevent;
++ CARD32 in_ifevent;
++#ifdef XTHREADS
++ xthread_t ifevent_thread;
++#endif
+ };
+
+ #define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n)
+diff --git a/src/ChkIfEv.c b/src/ChkIfEv.c
+index b32c2d3e..66636696 100644
+--- a/src/ChkIfEv.c
++++ b/src/ChkIfEv.c
+@@ -49,8 +49,11 @@ Bool XCheckIfEvent (
+ unsigned long qe_serial = 0;
+ int n; /* time through count */
+
+- dpy->in_ifevent++;
+ LockDisplay(dpy);
++#ifdef XTHREADS
++ dpy->ifevent_thread = xthread_self();
++#endif
++ dpy->in_ifevent++;
+ prev = NULL;
+ for (n = 3; --n >= 0;) {
+ for (qelt = prev ? prev->next : dpy->head;
+diff --git a/src/IfEvent.c b/src/IfEvent.c
+index 54c37f00..35c592e3 100644
+--- a/src/IfEvent.c
++++ b/src/IfEvent.c
+@@ -48,8 +48,11 @@ XIfEvent (
+ register _XQEvent *qelt, *prev;
+ unsigned long qe_serial = 0;
+
+- dpy->in_ifevent++;
+ LockDisplay(dpy);
++#ifdef XTHREADS
++ dpy->ifevent_thread = xthread_self();
++#endif
++ dpy->in_ifevent++;
+ prev = NULL;
+ while (1) {
+ for (qelt = prev ? prev->next : dpy->head;
+diff --git a/src/PeekIfEv.c b/src/PeekIfEv.c
+index 68c028b7..754749a7 100644
+--- a/src/PeekIfEv.c
++++ b/src/PeekIfEv.c
+@@ -49,8 +49,11 @@ XPeekIfEvent (
+ register _XQEvent *prev, *qelt;
+ unsigned long qe_serial = 0;
+
+- dpy->in_ifevent++;
+ LockDisplay(dpy);
++#ifdef XTHREADS
++ dpy->ifevent_thread = xthread_self();
++#endif
++ dpy->in_ifevent++;
+ prev = NULL;
+ while (1) {
+ for (qelt = prev ? prev->next : dpy->head;
+diff --git a/src/locking.c b/src/locking.c
+index c550603e..3625bd27 100644
+--- a/src/locking.c
++++ b/src/locking.c
+@@ -240,7 +240,9 @@ static void _XUnlockDisplay(
+ if (lock_hist_loc >= LOCK_HIST_SIZE)
+ lock_hist_loc = 0;
+ #endif /* XTHREADS_WARN */
+- xmutex_unlock(dpy->lock->mutex);
++
++ if (dpy->in_ifevent == 0 || !xthread_equal(dpy->ifevent_thread, xthread_self()))
++ xmutex_unlock(dpy->lock->mutex);
+ }
+
+
+@@ -453,63 +455,24 @@ static void _XDisplayLockWait(
+ }
+
+ static void _XLockDisplay(
+- Display *dpy
+- XTHREADS_FILE_LINE_ARGS
+- );
+-
+-static void _XIfEventLockDisplay(
+ Display *dpy
+ XTHREADS_FILE_LINE_ARGS
+ )
+ {
+- /* assert(dpy->in_ifevent); */
+-}
++ struct _XErrorThreadInfo *ti;
+
+-static void _XInternalLockDisplay(
+- Display *dpy,
+- Bool wskip
+- XTHREADS_FILE_LINE_ARGS
+- );
++ if (dpy->in_ifevent && xthread_equal(dpy->ifevent_thread, xthread_self()))
++ return;
+
+-static void _XIfEventInternalLockDisplay(
+- Display *dpy,
+- Bool wskip
+- XTHREADS_FILE_LINE_ARGS
+- )
+-{
+- /* assert(dpy->in_ifevent); */
+-}
+-
+-static void _XIfEventUnlockDisplay(
+- Display *dpy
+- XTHREADS_FILE_LINE_ARGS
+- )
+-{
+- if (dpy->in_ifevent == 0) {
+- dpy->lock_fns->lock_display = _XLockDisplay;
+- dpy->lock_fns->unlock_display = _XUnlockDisplay;
+- dpy->lock->internal_lock_display = _XInternalLockDisplay;
+- UnlockDisplay(dpy);
+- } else
+- return;
+-}
+-
+-static void _XLockDisplay(
+- Display *dpy
+- XTHREADS_FILE_LINE_ARGS
+- )
+-{
+-#ifdef XTHREADS
+- struct _XErrorThreadInfo *ti;
+-#endif
+ #ifdef XTHREADS_WARN
+ _XLockDisplayWarn(dpy, file, line);
+ #else
+ xmutex_lock(dpy->lock->mutex);
+ #endif
++
+ if (dpy->lock->locking_level > 0)
+- _XDisplayLockWait(dpy);
+-#ifdef XTHREADS
++ _XDisplayLockWait(dpy);
++
+ /*
+ * Skip the two function calls below which may generate requests
+ * when LockDisplay is called from within _XError.
+@@ -517,14 +480,9 @@ static void _XLockDisplay(
+ for (ti = dpy->error_threads; ti; ti = ti->next)
+ if (ti->error_thread == xthread_self())
+ return;
+-#endif
++
+ _XIDHandler(dpy);
+ _XSeqSyncFunction(dpy);
+- if (dpy->in_ifevent) {
+- dpy->lock_fns->lock_display = _XIfEventLockDisplay;
+- dpy->lock_fns->unlock_display = _XIfEventUnlockDisplay;
+- dpy->lock->internal_lock_display = _XIfEventInternalLockDisplay;
+- }
+ }
+
+ /*
+@@ -537,6 +495,9 @@ static void _XInternalLockDisplay(
+ XTHREADS_FILE_LINE_ARGS
+ )
+ {
++ if (dpy->in_ifevent && xthread_equal(dpy->ifevent_thread, xthread_self()))
++ return;
++
+ #ifdef XTHREADS_WARN
+ _XLockDisplayWarn(dpy, file, line);
+ #else
+--
+GitLab
+