pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Import wayland/sway



Module Name:	pkgsrc-wip
Committed By:	kikadf <kikadf.01%gmail.com@localhost>
Pushed By:	kikadf
Date:		Wed May 27 11:43:25 2026 +0200
Changeset:	35aa6a3ca7b3151f1e06e935a3361b11cff07a4c

Modified Files:
	Makefile
Added Files:
	sway/DESCR
	sway/Makefile
	sway/PLIST
	sway/distinfo
	sway/files/startsway.sh
	sway/patches/patch-common_stringop.c
	sway/patches/patch-common_util.c
	sway/patches/patch-meson.build
	sway/patches/patch-sway_commands.c
	sway/patches/patch-sway_commands_move.c
	sway/patches/patch-sway_commands_rename.c
	sway/patches/patch-sway_commands_workspace.c
	sway/patches/patch-sway_input_input-manager.c
	sway/patches/patch-sway_ipc-json.c
	sway/patches/patch-sway_tree_output.c
	sway/patches/patch-sway_tree_workspace.c
	sway/patches/patch-swaybar_i3bar.c
	sway/patches/patch-swaybar_tray_icon.c

Log Message:
Import wayland/sway

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=35aa6a3ca7b3151f1e06e935a3361b11cff07a4c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                      |  1 +
 sway/DESCR                                    |  8 +++++
 sway/Makefile                                 | 36 ++++++++++++++++++++
 sway/PLIST                                    | 34 +++++++++++++++++++
 sway/distinfo                                 | 18 ++++++++++
 sway/files/startsway.sh                       | 14 ++++++++
 sway/patches/patch-common_stringop.c          | 15 +++++++++
 sway/patches/patch-common_util.c              | 15 +++++++++
 sway/patches/patch-meson.build                | 15 +++++++++
 sway/patches/patch-sway_commands.c            | 30 +++++++++++++++++
 sway/patches/patch-sway_commands_move.c       | 15 +++++++++
 sway/patches/patch-sway_commands_rename.c     | 15 +++++++++
 sway/patches/patch-sway_commands_workspace.c  | 15 +++++++++
 sway/patches/patch-sway_input_input-manager.c | 15 +++++++++
 sway/patches/patch-sway_ipc-json.c            | 15 +++++++++
 sway/patches/patch-sway_tree_output.c         | 23 +++++++++++++
 sway/patches/patch-sway_tree_workspace.c      | 30 +++++++++++++++++
 sway/patches/patch-swaybar_i3bar.c            | 33 ++++++++++++++++++
 sway/patches/patch-swaybar_tray_icon.c        | 48 +++++++++++++++++++++++++++
 19 files changed, 395 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 10e2bead78..f201a243f7 100644
--- a/Makefile
+++ b/Makefile
@@ -5583,6 +5583,7 @@ SUBDIR+=	svrcore
 SUBDIR+=	svt-vp9
 SUBDIR+=	swami
 SUBDIR+=	swarp
+SUBDIR+=	sway
 SUBDIR+=	swfmill
 SUBDIR+=	swftools
 SUBDIR+=	swift
diff --git a/sway/DESCR b/sway/DESCR
new file mode 100644
index 0000000000..f168f4abcf
--- /dev/null
+++ b/sway/DESCR
@@ -0,0 +1,8 @@
+Sway is a tiling Wayland compositor and a drop-in replacement
+for the i3 window manager for X11. It works with your existing
+i3 configuration and supports most of i3's features, plus
+a few extras.
+Sway allows you to arrange your application windows logically,
+rather than spatially. Windows are arranged into a grid by
+default which maximizes the efficiency of your screen and can
+be quickly manipulated using only the keyboard.
diff --git a/sway/Makefile b/sway/Makefile
new file mode 100644
index 0000000000..4fbace7b53
--- /dev/null
+++ b/sway/Makefile
@@ -0,0 +1,36 @@
+# $NetBSD: Makefile,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+DISTNAME=	sway-1.11
+CATEGORIES=	wayland
+MASTER_SITES=	${MASTER_SITE_GITHUB:=swaywm/}
+
+MAINTAINER=	dan%alt.md@localhost
+HOMEPAGE=	https://swaywm.org/
+COMMENT=	Tilling, i3-compatible Wayland compositor
+LICENSE=	mit
+
+USE_TOOLS+=	pkg-config
+
+EGDIR=		${PREFIX}/share/examples/sway
+OWN_DIRS+=	${PKG_SYSCONFDIR}/sway
+CONF_FILES=	${EGDIR}/config ${PKG_SYSCONFDIR}/sway/config
+
+post-install:
+	${INSTALL_SCRIPT} ${FILESDIR}/startsway.sh \
+		${DESTDIR}${PREFIX}/bin/startsway
+
+.include "../../devel/meson/build.mk"
+.include "../../textproc/scdoc/tool.mk"
+.include "../../devel/basu/buildlink3.mk"
+.include "../../devel/libevdev-chunk/buildlink3.mk"
+.include "../../devel/pango/buildlink3.mk"
+.include "../../devel/pcre/buildlink3.mk"
+.include "../../devel/wayland/buildlink3.mk"
+.include "../../devel/wayland-protocols/buildlink3.mk"
+.include "../../graphics/cairo/buildlink3.mk"
+.include "../../graphics/gdk-pixbuf2/buildlink3.mk"
+.include "../../sysutils/seatd/buildlink3.mk"
+.include "../../textproc/json-c/buildlink3.mk"
+.include "../../wayland/wlroots/buildlink3.mk"
+.include "../../x11/libxkbcommon/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/sway/PLIST b/sway/PLIST
new file mode 100644
index 0000000000..eaad4f6e8a
--- /dev/null
+++ b/sway/PLIST
@@ -0,0 +1,34 @@
+@comment $NetBSD: PLIST,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+bin/startsway
+bin/sway
+bin/swaybar
+bin/swaymsg
+bin/swaynag
+man/man1/sway.1
+man/man1/swaymsg.1
+man/man1/swaynag.1
+man/man5/sway-bar.5
+man/man5/sway-input.5
+man/man5/sway-output.5
+man/man5/sway.5
+man/man5/swaynag.5
+man/man7/sway-ipc.7
+man/man7/swaybar-protocol.7
+share/backgrounds/sway/Sway_Wallpaper_Blue_1136x640.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_1136x640_Portrait.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_1366x768.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_2048x1536.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_2048x1536_Portrait.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_768x1024.png
+share/backgrounds/sway/Sway_Wallpaper_Blue_768x1024_Portrait.png
+share/bash-completion/completions/sway
+share/bash-completion/completions/swaybar
+share/bash-completion/completions/swaymsg
+share/examples/sway/config
+share/fish/vendor_completions.d/sway.fish
+share/fish/vendor_completions.d/swaymsg.fish
+share/fish/vendor_completions.d/swaynag.fish
+share/wayland-sessions/sway.desktop
+share/zsh/site-functions/_sway
+share/zsh/site-functions/_swaymsg
diff --git a/sway/distinfo b/sway/distinfo
new file mode 100644
index 0000000000..6bc37b8d32
--- /dev/null
+++ b/sway/distinfo
@@ -0,0 +1,18 @@
+$NetBSD: distinfo,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+BLAKE2s (sway-1.11.tar.gz) = 08578ebdaaafd31f89219294389dcad8e918b80181444b47f927a09e1132c737
+SHA512 (sway-1.11.tar.gz) = 7366b494308b8773e6051a67286e7abe422bb390f58def8df143d6334b949ef4c5df7e8086332053ff57ec65518f5b04f11a2c31bb57a31dd234eda82457aed5
+Size (sway-1.11.tar.gz) = 5583731 bytes
+SHA1 (patch-common_stringop.c) = 1d89d81d0e665dec83b312e4d47645923dedbea3
+SHA1 (patch-common_util.c) = 6092b87d425096740409e00b0d9dac3bc5dae8f7
+SHA1 (patch-meson.build) = 40b74709af65b55b4f3e93a5fa45b783f88b6463
+SHA1 (patch-sway_commands.c) = 792b1746fcfccafa1ac2bb7386012a31e327d63a
+SHA1 (patch-sway_commands_move.c) = 8b5682f523ccc626e376c4dcceac53a2c2a739f3
+SHA1 (patch-sway_commands_rename.c) = 831cd230384eecba4bd86696163eb4fa385f4cf4
+SHA1 (patch-sway_commands_workspace.c) = ae2389a3d5d9ff453de3d55e5be5ff6fa447c1d3
+SHA1 (patch-sway_input_input-manager.c) = 911f6a14325ba87130cef81e5bc3ad4772e07613
+SHA1 (patch-sway_ipc-json.c) = 8baeb0f81994ec456161d164a28b3dc6a33953c7
+SHA1 (patch-sway_tree_output.c) = 5e8aa608a2a77013d7d0ceef7b74bf1c8a334bf3
+SHA1 (patch-sway_tree_workspace.c) = c62b76e90b3ae1cbaf958fb4cf42a5d8fee4705a
+SHA1 (patch-swaybar_i3bar.c) = b71e4c995ab4b64f76d6604f1010e83d459e4c29
+SHA1 (patch-swaybar_tray_icon.c) = 4cb661059fb46e207e0da1f3a716c1f8a63d8604
diff --git a/sway/files/startsway.sh b/sway/files/startsway.sh
new file mode 100644
index 0000000000..11c9d9189f
--- /dev/null
+++ b/sway/files/startsway.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -eu
+
+: ${XDG_CURRENT_DESKTOP:=sway}
+: ${XDG_RUNTIME_DIR:=/tmp/$(id -un)-runtime}
+: ${QT_QPA_PLATFORM:=wayland;xcb}
+
+export XDG_CURRENT_DESKTOP XDG_RUNTIME_DIR QT_QPA_PLATFORM
+
+[ -d "${XDG_RUNTIME_DIR}" ] || mkdir -p -m 700 "${XDG_RUNTIME_DIR}"
+
+exec /usr/pkg/bin/seatd-launch \
+     /usr/pkg/bin/dbus-run-session \
+     /usr/pkg/bin/sway "$@"
diff --git a/sway/patches/patch-common_stringop.c b/sway/patches/patch-common_stringop.c
new file mode 100644
index 0000000000..8ca4447ce3
--- /dev/null
+++ b/sway/patches/patch-common_stringop.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-common_stringop.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- common/stringop.c.orig	2026-02-06 15:04:53.573026504 +0000
++++ common/stringop.c
+@@ -18,7 +18,7 @@ void strip_whitespace(char *str) {
+ 	memmove(str, &str[start], len + 1 - start);
+ 
+ 	if (*str) {
+-		for (len -= start + 1; isspace(str[len]); --len) {}
++		for (len -= start + 1; isspace((unsigned char)str[len]); --len) {}
+ 		str[len + 1] = '\0';
+ 	}
+ }
diff --git a/sway/patches/patch-common_util.c b/sway/patches/patch-common_util.c
new file mode 100644
index 0000000000..e2ae59294b
--- /dev/null
+++ b/sway/patches/patch-common_util.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-common_util.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- common/util.c.orig	2026-02-06 14:12:13.396723268 +0000
++++ common/util.c
+@@ -18,7 +18,7 @@ bool parse_color(const char *color, uint
+ 		++color;
+ 	}
+ 	int len = strlen(color);
+-	if ((len != 6 && len != 8) || !isxdigit(color[0]) || !isxdigit(color[1])) {
++	if ((len != 6 && len != 8) || !isxdigit((unsigned char)color[0]) || !isxdigit((unsigned char)color[1])) {
+ 		return false;
+ 	}
+ 	char *ptr;
diff --git a/sway/patches/patch-meson.build b/sway/patches/patch-meson.build
new file mode 100644
index 0000000000..7b67af676d
--- /dev/null
+++ b/sway/patches/patch-meson.build
@@ -0,0 +1,15 @@
+$NetBSD: patch-meson.build,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Install config files to examples
+
+--- meson.build.orig	2025-12-13 15:37:00.995711394 +0000
++++ meson.build
+@@ -214,7 +214,7 @@ configure_file(
+ 	configuration: config,
+ 	input: 'config.in',
+ 	output: '@BASENAME@',
+-	install_dir: join_paths(sysconfdir, 'sway')
++	install_dir: join_paths(datadir, 'examples', 'sway')
+ )
+ 
+ install_data(
diff --git a/sway/patches/patch-sway_commands.c b/sway/patches/patch-sway_commands.c
new file mode 100644
index 0000000000..e3f8df91c6
--- /dev/null
+++ b/sway/patches/patch-sway_commands.c
@@ -0,0 +1,30 @@
+$NetBSD: patch-sway_commands.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/commands.c.orig	2026-02-06 14:32:11.294383795 +0000
++++ sway/commands.c
+@@ -228,7 +228,7 @@ list_t *execute_command(char *_exec, str
+ 	config->handler_context.seat = seat;
+ 
+ 	do {
+-		for (; isspace(*head); ++head) {}
++		for (; isspace((unsigned char)*head); ++head) {}
+ 		// Extract criteria (valid for this command list only).
+ 		if (matched_delim == ';') {
+ 			using_criteria = false;
+@@ -247,12 +247,12 @@ list_t *execute_command(char *_exec, str
+ 				criteria_destroy(criteria);
+ 				using_criteria = true;
+ 				// Skip leading whitespace
+-				for (; isspace(*head); ++head) {}
++				for (; isspace((unsigned char)*head); ++head) {}
+ 			}
+ 		}
+ 		// Split command list
+ 		cmd = argsep(&head, ";,", &matched_delim);
+-		for (; isspace(*cmd); ++cmd) {}
++		for (; isspace((unsigned char)*cmd); ++cmd) {}
+ 
+ 		if (strcmp(cmd, "") == 0) {
+ 			sway_log(SWAY_INFO, "Ignoring empty command.");
diff --git a/sway/patches/patch-sway_commands_move.c b/sway/patches/patch-sway_commands_move.c
new file mode 100644
index 0000000000..39cdf5cf39
--- /dev/null
+++ b/sway/patches/patch-sway_commands_move.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-sway_commands_move.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/commands/move.c.orig	2026-02-06 14:59:39.044165905 +0000
++++ sway/commands/move.c
+@@ -472,7 +472,7 @@ static struct cmd_results *cmd_move_cont
+ 				if (argc < 3) {
+ 					return cmd_results_new(CMD_INVALID, "%s", expected_syntax);
+ 				}
+-				if (!isdigit(argv[2][0])) {
++				if (!isdigit((unsigned char)argv[2][0])) {
+ 					return cmd_results_new(CMD_INVALID,
+ 							"Invalid workspace number '%s'", argv[2]);
+ 				}
diff --git a/sway/patches/patch-sway_commands_rename.c b/sway/patches/patch-sway_commands_rename.c
new file mode 100644
index 0000000000..24a92422ee
--- /dev/null
+++ b/sway/patches/patch-sway_commands_rename.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-sway_commands_rename.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/commands/rename.c.orig	2026-02-06 15:17:20.504788687 +0000
++++ sway/commands/rename.c
+@@ -37,7 +37,7 @@ struct cmd_results *cmd_rename(int argc,
+ 		workspace = config->handler_context.workspace;
+ 	} else if (strcasecmp(argv[1], "number") == 0) {
+ 		// 'rename workspace number x to new_name'
+-		if (!isdigit(argv[2][0])) {
++		if (!isdigit((unsigned char)argv[2][0])) {
+ 			return cmd_results_new(CMD_INVALID,
+ 					"Invalid workspace number '%s'", argv[2]);
+ 		}
diff --git a/sway/patches/patch-sway_commands_workspace.c b/sway/patches/patch-sway_commands_workspace.c
new file mode 100644
index 0000000000..c54c8bb65d
--- /dev/null
+++ b/sway/patches/patch-sway_commands_workspace.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-sway_commands_workspace.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/commands/workspace.c.orig	2026-02-06 14:28:42.650855570 +0000
++++ sway/commands/workspace.c
+@@ -194,7 +194,7 @@ struct cmd_results *cmd_workspace(int ar
+ 				return cmd_results_new(CMD_INVALID,
+ 						"Expected workspace number");
+ 			}
+-			if (!isdigit(argv[1][0])) {
++			if (!isdigit((unsigned char)argv[1][0])) {
+ 				return cmd_results_new(CMD_INVALID,
+ 						"Invalid workspace number '%s'", argv[1]);
+ 			}
diff --git a/sway/patches/patch-sway_input_input-manager.c b/sway/patches/patch-sway_input_input-manager.c
new file mode 100644
index 0000000000..4fb9194b48
--- /dev/null
+++ b/sway/patches/patch-sway_input_input-manager.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-sway_input_input-manager.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/input/input-manager.c.orig	2026-02-06 14:46:35.813870635 +0000
++++ sway/input/input-manager.c
+@@ -81,7 +81,7 @@ char *input_device_get_identifier(struct
+ 	char *p = name;
+ 	for (; *p; ++p) {
+ 		// There are in fact input devices with unprintable characters in its name
+-		if (*p == ' ' || !isprint(*p)) {
++		if (*p == ' ' || !isprint((unsigned char)*p)) {
+ 			*p = '_';
+ 		}
+ 	}
diff --git a/sway/patches/patch-sway_ipc-json.c b/sway/patches/patch-sway_ipc-json.c
new file mode 100644
index 0000000000..b869fdb085
--- /dev/null
+++ b/sway/patches/patch-sway_ipc-json.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-sway_ipc-json.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/ipc-json.c.orig	2026-02-06 14:36:33.994077551 +0000
++++ sway/ipc-json.c
+@@ -494,7 +494,7 @@ static json_object *ipc_json_describe_sc
+ static void ipc_json_describe_workspace(struct sway_workspace *workspace,
+ 		json_object *object) {
+ 	int num;
+-	if (isdigit(workspace->name[0])) {
++	if (isdigit((unsigned char)workspace->name[0])) {
+ 		errno = 0;
+ 		char *endptr = NULL;
+ 		long long parsed_num = strtoll(workspace->name, &endptr, 10);
diff --git a/sway/patches/patch-sway_tree_output.c b/sway/patches/patch-sway_tree_output.c
new file mode 100644
index 0000000000..a111284763
--- /dev/null
+++ b/sway/patches/patch-sway_tree_output.c
@@ -0,0 +1,23 @@
+$NetBSD: patch-sway_tree_output.c,v 1.1 2026/04/14 11:32:14 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/tree/output.c.orig	2026-02-06 15:15:06.294449317 +0000
++++ sway/tree/output.c
+@@ -381,13 +381,13 @@ static int sort_workspace_cmp_qsort(cons
+ 	struct sway_workspace *a = *(void **)_a;
+ 	struct sway_workspace *b = *(void **)_b;
+ 
+-	if (isdigit(a->name[0]) && isdigit(b->name[0])) {
++	if (isdigit((unsigned char)a->name[0]) && isdigit((unsigned char)b->name[0])) {
+ 		int a_num = strtol(a->name, NULL, 10);
+ 		int b_num = strtol(b->name, NULL, 10);
+ 		return (a_num < b_num) ? -1 : (a_num > b_num);
+-	} else if (isdigit(a->name[0])) {
++	} else if (isdigit((unsigned char)a->name[0])) {
+ 		return -1;
+-	} else if (isdigit(b->name[0])) {
++	} else if (isdigit((unsigned char)b->name[0])) {
+ 		return 1;
+ 	}
+ 	return 0;
diff --git a/sway/patches/patch-sway_tree_workspace.c b/sway/patches/patch-sway_tree_workspace.c
new file mode 100644
index 0000000000..8ec4897028
--- /dev/null
+++ b/sway/patches/patch-sway_tree_workspace.c
@@ -0,0 +1,30 @@
+$NetBSD: patch-sway_tree_workspace.c,v 1.1 2026/04/14 11:32:15 kikadf Exp $
+
+* Fix ctype usage
+
+--- sway/tree/workspace.c.orig	2026-02-06 15:19:36.101349296 +0000
++++ sway/tree/workspace.c
+@@ -256,7 +256,7 @@ static void workspace_name_from_binding(
+ 			sway_log(SWAY_DEBUG, "Isolated name from workspace number: '%s'", _target);
+ 
+ 			// Make sure the workspace number doesn't already exist
+-			if (isdigit(_target[0]) && workspace_by_number(_target)) {
++			if (isdigit((unsigned char)_target[0]) && workspace_by_number(_target)) {
+ 				free(_target);
+ 				free(dup);
+ 				return;
+@@ -346,12 +346,12 @@ char *workspace_next_name(const char *ou
+ static bool _workspace_by_number(struct sway_workspace *ws, void *data) {
+ 	char *name = data;
+ 	char *ws_name = ws->name;
+-	while (isdigit(*name)) {
++	while (isdigit((unsigned char)*name)) {
+ 		if (*name++ != *ws_name++) {
+ 			return false;
+ 		}
+ 	}
+-	return !isdigit(*ws_name);
++	return !isdigit((unsigned char)*ws_name);
+ }
+ 
+ struct sway_workspace *workspace_by_number(const char* name) {
diff --git a/sway/patches/patch-swaybar_i3bar.c b/sway/patches/patch-swaybar_i3bar.c
new file mode 100644
index 0000000000..769936055c
--- /dev/null
+++ b/sway/patches/patch-swaybar_i3bar.c
@@ -0,0 +1,33 @@
+$NetBSD: patch-swaybar_i3bar.c,v 1.1 2026/04/14 11:32:15 kikadf Exp $
+
+* Fix ctype usage
+
+--- swaybar/i3bar.c.orig	2026-02-06 15:09:17.576197045 +0000
++++ swaybar/i3bar.c
+@@ -126,7 +126,7 @@ bool i3bar_handle_readable(struct status
+ 				status->buffer_index -= ++c;
+ 				memmove(status->buffer, &status->buffer[c], status->buffer_index);
+ 				break;
+-			} else if (!isspace(status->buffer[c])) {
++			} else if (!isspace((unsigned char)status->buffer[c])) {
+ 				sway_log(SWAY_DEBUG, "Invalid i3bar json: expected '[' but encountered '%c'",
+ 						status->buffer[c]);
+ 				status_error(status, "[invalid i3bar json]");
+@@ -166,7 +166,7 @@ bool i3bar_handle_readable(struct status
+ 					status->expecting_comma = false;
+ 					++buffer_pos;
+ 					break;
+-				} else if (!isspace(status->buffer[buffer_pos])) {
++				} else if (!isspace((unsigned char)status->buffer[buffer_pos])) {
+ 					sway_log(SWAY_DEBUG, "Invalid i3bar json: expected ',' but encountered '%c'",
+ 							status->buffer[buffer_pos]);
+ 					status_error(status, "[invalid i3bar json]");
+@@ -197,7 +197,7 @@ bool i3bar_handle_readable(struct status
+ 				char *last_char_pos =
+ 					&status->buffer[buffer_pos + status->tokener->char_offset - 1];
+ 				char last_char = *last_char_pos;
+-				while (isspace(last_char)) {
++				while (isspace((unsigned char)last_char)) {
+ 					last_char = *--last_char_pos;
+ 				}
+ 				*last_char_pos = '\0';
diff --git a/sway/patches/patch-swaybar_tray_icon.c b/sway/patches/patch-swaybar_tray_icon.c
new file mode 100644
index 0000000000..039140126f
--- /dev/null
+++ b/sway/patches/patch-swaybar_tray_icon.c
@@ -0,0 +1,48 @@
+$NetBSD: patch-swaybar_tray_icon.c,v 1.1 2026/04/14 11:32:15 kikadf Exp $
+
+* Fix ctype usage
+
+--- swaybar/tray/icon.c.orig	2026-02-06 14:22:15.740453549 +0000
++++ swaybar/tray/icon.c
+@@ -228,17 +228,17 @@ static struct icon_theme *read_theme_fil
+ 		++line_no;
+ 
+ 		char *line = full_line - 1;
+-		while (isspace(*++line)) {} // remove leading whitespace
++		while (isspace((unsigned char)*++line)) {} // remove leading whitespace
+ 		if (!*line || line[0] == '#') continue; // ignore blank lines & comments
+ 
+ 		int len = nread - (line - full_line);
+-		while (isspace(line[--len])) {}
++		while (isspace((unsigned char)line[--len])) {}
+ 		line[++len] = '\0'; // remove trailing whitespace
+ 
+ 		if (line[0] == '[') { // group header
+ 			// check well-formed
+ 			int i = 1;
+-			for (; !iscntrl(line[i]) && line[i] != '[' && line[i] != ']'; ++i) {}
++			for (; !iscntrl((unsigned char)line[i]) && line[i] != '[' && line[i] != ']'; ++i) {}
+ 			if (i != --len || line[i] != ']') {
+ 				error = "malformed group header";
+ 				break;
+@@ -268,9 +268,9 @@ static struct icon_theme *read_theme_fil
+ 
+ 			// check well-formed
+ 			int eok = 0;
+-			for (; isalnum(line[eok]) || line[eok] == '-'; ++eok) {} // TODO locale?
++			for (; isalnum((unsigned char)line[eok]) || line[eok] == '-'; ++eok) {} // TODO locale?
+ 			int i = eok - 1;
+-			while (isspace(line[++i])) {}
++			while (isspace((unsigned char)line[++i])) {}
+ 			if (line[i] != '=') {
+ 				error = "malformed key-value pair";
+ 				break;
+@@ -278,7 +278,7 @@ static struct icon_theme *read_theme_fil
+ 
+ 			line[eok] = '\0'; // split into key-value pair
+ 			char *value = &line[i];
+-			while (isspace(*++value)) {}
++			while (isspace((unsigned char)*++value)) {}
+ 			// TODO unescape value
+ 
+ 			error = entry_handler(groups->items[groups->length - 1], line,


Home | Main Index | Thread Index | Old Index