git: dbe271ffcf38 - main - x11-wm/sway: revert 2 recent commits to redo with swayfx

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Mon, 15 Sep 2025 11:49:51 UTC
The branch main has been updated by jbeich:

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

commit dbe271ffcf3848376443a3e81213f47aed81135e
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2025-09-15 11:44:15 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2025-09-15 11:48:31 +0000

    x11-wm/sway: revert 2 recent commits to redo with swayfx
    
    This reverts commit 352b91f2c8f531378c1224b3a6f6210a88711b49.
    This reverts commit a873107d61d87133f66a9e56fbd7126f8504ced3.
---
 x11-wm/sway/Makefile                  |  1 -
 x11-wm/sway/files/extra-patch-wordexp | 60 +++++++++++++++++++----------------
 2 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/x11-wm/sway/Makefile b/x11-wm/sway/Makefile
index 120ae0e8cd0a..caf623eafae1 100644
--- a/x11-wm/sway/Makefile
+++ b/x11-wm/sway/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	sway
 DISTVERSION=	1.11
-PORTREVISION=	1
 CATEGORIES=	x11-wm wayland
 
 MAINTAINER=	jbeich@FreeBSD.org
diff --git a/x11-wm/sway/files/extra-patch-wordexp b/x11-wm/sway/files/extra-patch-wordexp
index eb1f79f130f5..5a9f187e11df 100644
--- a/x11-wm/sway/files/extra-patch-wordexp
+++ b/x11-wm/sway/files/extra-patch-wordexp
@@ -1,5 +1,4 @@
 https://github.com/swaywm/sway/issues/8673#issuecomment-2818260191
-https://github.com/swaywm/sway/issues/8828#issuecomment-3290045852
 
 --- common/stringop.c.orig	2025-04-20 11:31:10 UTC
 +++ common/stringop.c
@@ -12,38 +11,43 @@ https://github.com/swaywm/sway/issues/8828#issuecomment-3290045852
  #include "list.h"
  #include "log.h"
  #include "stringop.h"
-@@ -319,7 +321,33 @@ bool expand_path(char **path) {
+@@ -318,11 +320,34 @@ bool expand_path(char **path) {
+ 		char *ptr = strstr(*path, "  ") + 1;
  		memmove(ptr + 1, ptr, strlen(ptr) + 1);
  		*ptr = '\\';
- 	}
+-	}
 -	if (wordexp(*path, &p, 0) != 0 || p.we_wordv[0] == NULL) {
+-		wordfree(&p);
+-		return false;
+-	}
++       }
 +
-+	// FreeBSD wordexp bug workaround:
-+	// 1. Reset SIGCHLD handler
-+	// 2. Run wordexp
-+	// 3. Restore SIGCHLD handler and reap any processes that exited
-+	struct sigaction prev_action;
-+	struct sigaction new_action = {
-+		.sa_flags = SA_RESETHAND,
-+	};
-+	if (sigaction(SIGCHLD, &new_action, &prev_action) != 0) {
-+		sway_log(SWAY_ERROR, "Restoring sigchild before wordexp failed");
-+		return false;
-+	}
++       // FreeBSD wordexp bug workaround:
++       // 1. Reset SIGCHLD handler
++       // 2. Run wordexp
++       // 3. Restore SIGCHLD handler and reap any processes that exited
++       struct sigaction prev_action;
++       struct sigaction new_action = {
++               .sa_flags = SA_RESETHAND,
++       };
++       if (sigaction(SIGCHLD, &new_action, &prev_action) != 0) {
++               sway_log(SWAY_ERROR, "Restoring sigchild before wordexp failed");
++               return false;
++       }
 +
-+	int res = wordexp(*path, &p, 0);
++       int res = wordexp(*path, &p, 0);
 +
-+	if (sigaction(SIGCHLD, &prev_action, NULL) != 0) {
-+		sway_log(SWAY_ERROR, "Restoring sigchild after wordexp failed");
-+	}
++       if (sigaction(SIGCHLD, &prev_action, NULL) != 0) {
++               sway_log(SWAY_ERROR, "Restoring sigchild after wordexp failed");
++       }
 +
-+	int status;
-+	int wres;
-+	do {
-+		wres = waitpid(-1, &status, WNOHANG);
-+	} while (wres > 0 || (wres == -1 && errno == EINTR));
++       int status;
++       while (waitpid(-1, &status, WNOHANG) != -1 || errno == EINTR);
 +
-+	if (res != 0 || p.we_wordv[0] == NULL) {
- 		wordfree(&p);
- 		return false;
- 	}
++       if (res != 0 || p.we_wordv[0] == NULL) {
++               wordfree(&p);
++               return false;
++       }
+ 	free(*path);
+ 	*path = join_args(p.we_wordv, p.we_wordc);
+ 	wordfree(&p);