diff --git a/sources b/sources index 1b13b9f..44bdc9f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (sway-1.6.1.tar.gz) = 7f37fea99970db42c5485277df06d69bef5225fa03d25be179893b14d73c1d681f0355a1bc74091b4173bbccc88994a63ad0f9322e070811ba963648cf68cdeb -SHA512 (sway-1.6.1.tar.gz.sig) = 63cee298a3249410f2a6ec9f889713d6fa095eaa013963867bd3abef3ffcf52e6b31d6eac93bac29899271d9c9a43e825e10511a3e3a882917a4558718683ebb +SHA512 (sway-1.7-rc3.tar.gz) = 4dc2173a3fa8aa2a677f8016717bf587b18fca21e28e03fa2a7f310e02b4eaf850c8e00a9c27651bcf575dc285715c34b9ac9b7bfbd944fac6ce9282e5d04fe4 +SHA512 (sway-1.7-rc3.tar.gz.sig) = 28e29be93b1ab8752ed3fb382f86f12d358c192d34f5269cb95870c5f05d8b03c46a3afb9cf80831a0451b101e0aa6355424d7117c094444fbd5696bbb5b73c9 diff --git a/sway-1.6.1-Bump-RLIMIT_NOFILE.patch b/sway-1.6.1-Bump-RLIMIT_NOFILE.patch deleted file mode 100644 index 1ed5adf..0000000 --- a/sway-1.6.1-Bump-RLIMIT_NOFILE.patch +++ /dev/null @@ -1,154 +0,0 @@ -From 38020d157ddb58e756c654e9a2ff203c1562b25b Mon Sep 17 00:00:00 2001 -From: Simon Ser -Date: Thu, 21 Oct 2021 21:52:17 +0200 -Subject: [PATCH] Bump RLIMIT_NOFILE - -Wayland compositors handle many file descriptors: client -connections, DMA-BUFs, sync_files, wl_data_device pipes, and so -on. Bump the limit to the max. - -Closes: https://github.com/swaywm/sway/issues/6285 ---- - include/sway/server.h | 2 ++ - sway/commands/exec_always.c | 2 ++ - sway/config/bar.c | 2 ++ - sway/config/output.c | 2 ++ - sway/main.c | 31 +++++++++++++++++++++++++++++++ - sway/swaynag.c | 2 ++ - 6 files changed, 41 insertions(+) - -diff --git a/include/sway/server.h b/include/sway/server.h -index 88dda09754..f99bbda679 100644 ---- a/include/sway/server.h -+++ b/include/sway/server.h -@@ -137,6 +137,8 @@ void server_fini(struct sway_server *server); - bool server_start(struct sway_server *server); - void server_run(struct sway_server *server); - -+void restore_nofile_limit(void); -+ - void handle_compositor_new_surface(struct wl_listener *listener, void *data); - void handle_new_output(struct wl_listener *listener, void *data); - -diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c -index fce337d518..b35065c12c 100644 ---- a/sway/commands/exec_always.c -+++ b/sway/commands/exec_always.c -@@ -7,6 +7,7 @@ - #include - #include "sway/commands.h" - #include "sway/config.h" -+#include "sway/server.h" - #include "sway/tree/container.h" - #include "sway/tree/root.h" - #include "sway/tree/workspace.h" -@@ -53,6 +54,7 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) { - // Fork process - if ((pid = fork()) == 0) { - // Fork child process again -+ restore_nofile_limit(); - setsid(); - sigset_t set; - sigemptyset(&set); -diff --git a/sway/config/bar.c b/sway/config/bar.c -index e09add4415..d1b342e692 100644 ---- a/sway/config/bar.c -+++ b/sway/config/bar.c -@@ -218,6 +218,8 @@ static void invoke_swaybar(struct bar_config *bar) { - sigemptyset(&set); - sigprocmask(SIG_SETMASK, &set, NULL); - -+ restore_nofile_limit(); -+ - pid = fork(); - if (pid < 0) { - sway_log_errno(SWAY_ERROR, "fork failed"); -diff --git a/sway/config/output.c b/sway/config/output.c -index 8e937b2848..6d39c2f552 100644 ---- a/sway/config/output.c -+++ b/sway/config/output.c -@@ -750,6 +750,8 @@ static bool _spawn_swaybg(char **command) { - sway_log_errno(SWAY_ERROR, "fork failed"); - return false; - } else if (pid == 0) { -+ restore_nofile_limit(); -+ - pid = fork(); - if (pid < 0) { - sway_log_errno(SWAY_ERROR, "fork failed"); -diff --git a/sway/main.c b/sway/main.c -index 264fa8473f..2c760524fb 100644 ---- a/sway/main.c -+++ b/sway/main.c -@@ -6,6 +6,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -27,6 +28,7 @@ - - static bool terminate_request = false; - static int exit_value = 0; -+static struct rlimit original_nofile_rlimit = {0}; - struct sway_server server = {0}; - struct sway_debug debug = {0}; - -@@ -169,6 +171,33 @@ static bool drop_permissions(void) { - return true; - } - -+static void increase_nofile_limit(void) { -+ if (getrlimit(RLIMIT_NOFILE, &original_nofile_rlimit) != 0) { -+ sway_log_errno(SWAY_ERROR, "Failed to bump max open files limit: " -+ "getrlimit(NOFILE) failed"); -+ return; -+ } -+ -+ struct rlimit new_rlimit = original_nofile_rlimit; -+ new_rlimit.rlim_cur = new_rlimit.rlim_max; -+ if (setrlimit(RLIMIT_NOFILE, &new_rlimit) != 0) { -+ sway_log_errno(SWAY_ERROR, "Failed to bump max open files limit: " -+ "setrlimit(NOFILE) failed"); -+ sway_log(SWAY_INFO, "Running with %d max open files", -+ (int)original_nofile_rlimit.rlim_cur); -+ } -+} -+ -+void restore_nofile_limit(void) { -+ if (original_nofile_rlimit.rlim_cur == 0) { -+ return; -+ } -+ if (setrlimit(RLIMIT_NOFILE, &original_nofile_rlimit) != 0) { -+ sway_log_errno(SWAY_ERROR, "Failed to restore max open files limit: " -+ "setrlimit(NOFILE) failed"); -+ } -+} -+ - void enable_debug_flag(const char *flag) { - if (strcmp(flag, "damage=highlight") == 0) { - debug.damage = DAMAGE_HIGHLIGHT; -@@ -349,6 +378,8 @@ int main(int argc, char **argv) { - exit(EXIT_FAILURE); - } - -+ increase_nofile_limit(); -+ - // handle SIGTERM signals - signal(SIGTERM, sig_handler); - signal(SIGINT, sig_handler); -diff --git a/sway/swaynag.c b/sway/swaynag.c -index ba582989bd..4a0a6d305c 100644 ---- a/sway/swaynag.c -+++ b/sway/swaynag.c -@@ -64,6 +64,8 @@ bool swaynag_spawn(const char *swaynag_command, - sway_log(SWAY_ERROR, "Failed to create fork for swaynag"); - goto failed; - } else if (pid == 0) { -+ restore_nofile_limit(); -+ - pid = fork(); - if (pid < 0) { - sway_log_errno(SWAY_ERROR, "fork failed"); diff --git a/sway-1.6.1-desktop-render-remove-unused-wlr_gles2_texture_attri.patch b/sway-1.6.1-desktop-render-remove-unused-wlr_gles2_texture_attri.patch deleted file mode 100644 index b629f0c..0000000 --- a/sway-1.6.1-desktop-render-remove-unused-wlr_gles2_texture_attri.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 86b08e3257a4e3e204740f6252c5b1180ead8467 Mon Sep 17 00:00:00 2001 -From: Simon Ser -Date: Sun, 11 Apr 2021 12:15:51 +0200 -Subject: [PATCH] desktop/render: remove unused wlr_gles2_texture_attribs - -We were calling wlr_gles2_texture_get_attribs, but we were never -using the result. ---- - sway/desktop/render.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/sway/desktop/render.c b/sway/desktop/render.c -index 466222240f..56936d539e 100644 ---- a/sway/desktop/render.c -+++ b/sway/desktop/render.c -@@ -105,9 +105,6 @@ static void render_texture(struct wlr_output *wlr_output, - wlr_backend_get_renderer(wlr_output->backend); - struct sway_output *output = wlr_output->data; - -- struct wlr_gles2_texture_attribs attribs; -- wlr_gles2_texture_get_attribs(texture, &attribs); -- - pixman_region32_t damage; - pixman_region32_init(&damage); - pixman_region32_union_rect(&damage, &damage, dst_box->x, dst_box->y, diff --git a/sway-1.7-meson-0.59-compat.patch b/sway-1.7-meson-0.59-compat.patch new file mode 100644 index 0000000..fef9d5e --- /dev/null +++ b/sway-1.7-meson-0.59-compat.patch @@ -0,0 +1,104 @@ +From dbde51b7e3c0d85b7e5c9669b8c9b88735bbc979 Mon Sep 17 00:00:00 2001 +From: Aleksei Bavshin +Date: Sun, 16 Jan 2022 11:09:00 -0800 +Subject: [PATCH 1/2] Revert "build: fix building with basu" + +This reverts commit 6bb3e7ee0570b768032bcaa501cc812b77ce53e6. +--- + meson.build | 13 +++---------- + 1 file changed, 3 insertions(+), 10 deletions(-) + +diff --git a/meson.build b/meson.build +index 49ae4b7a..ebf6e76e 100644 +--- a/meson.build ++++ b/meson.build +@@ -92,22 +92,15 @@ if get_option('sd-bus-provider') == 'auto' + if not get_option('tray').disabled() + assert(get_option('auto_features').auto(), 'sd-bus-provider must not be set to auto since auto_features != auto') + endif +- sdbus = dependency(['libsystemd', 'libelogind'], +- required: false, ++ sdbus = dependency(['libsystemd', 'libelogind', 'basu'], ++ required: get_option('tray'), + version: '>=239', + ) +- if not sdbus.found() +- sdbus = dependency('basu', required: false) +- endif + else + sdbus = dependency(get_option('sd-bus-provider'), required: get_option('tray')) + endif + +-tray_deps_found = sdbus.found() +-if get_option('tray').enabled() and not tray_deps_found +- error('Building with -Dtray=enabled, but sd-bus has not been not found') +-endif +-have_tray = (not get_option('tray').disabled()) and tray_deps_found ++have_tray = sdbus.found() + + conf_data = configuration_data() + +-- +2.34.1 + + +From 1090f85659f2eea69ed72764e1c78647b5c30225 Mon Sep 17 00:00:00 2001 +From: Aleksei Bavshin +Date: Sun, 16 Jan 2022 11:09:31 -0800 +Subject: [PATCH 2/2] Revert "build: use list for sdbus dep" + +This reverts commit 02b412a3d4e930237a1d16554af6e1e7d1855c89. +--- + meson.build | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +diff --git a/meson.build b/meson.build +index ebf6e76e..8dc9120b 100644 +--- a/meson.build ++++ b/meson.build +@@ -3,7 +3,7 @@ project( + 'c', + version: '1.7-rc3', + license: 'MIT', +- meson_version: '>=0.60.0', ++ meson_version: '>=0.59.0', + default_options: [ + 'c_std=c11', + 'warning_level=2', +@@ -92,15 +92,30 @@ if get_option('sd-bus-provider') == 'auto' + if not get_option('tray').disabled() + assert(get_option('auto_features').auto(), 'sd-bus-provider must not be set to auto since auto_features != auto') + endif +- sdbus = dependency(['libsystemd', 'libelogind', 'basu'], +- required: get_option('tray'), ++ sdbus = dependency('libsystemd', ++ required: false, + version: '>=239', ++ not_found_message: 'libsystemd not found, trying libelogind', + ) ++ if not sdbus.found() ++ sdbus = dependency('libelogind', ++ required: false, ++ version: '>=239', ++ not_found_message: 'libelogind not found, trying basu', ++ ) ++ endif ++ if not sdbus.found() ++ sdbus = dependency('basu', required: false) ++ endif + else + sdbus = dependency(get_option('sd-bus-provider'), required: get_option('tray')) + endif + +-have_tray = sdbus.found() ++tray_deps_found = sdbus.found() ++if get_option('tray').enabled() and not tray_deps_found ++ error('Building with -Dtray=enabled, but sd-bus has not been not found') ++endif ++have_tray = (not get_option('tray').disabled()) and tray_deps_found + + conf_data = configuration_data() + +-- +2.34.1 + diff --git a/sway-1.7-wayland-1.19-compat.patch b/sway-1.7-wayland-1.19-compat.patch new file mode 100644 index 0000000..7316a56 --- /dev/null +++ b/sway-1.7-wayland-1.19-compat.patch @@ -0,0 +1,171 @@ +From 1e6703576a854065641bfc75154398230a80e555 Mon Sep 17 00:00:00 2001 +From: Aleksei Bavshin +Date: Tue, 14 Dec 2021 06:14:27 -0800 +Subject: [PATCH] Revert "swaynag: remove xdg-output logic" + +This reverts commit 57a7b3998ea62616223000eb6369c999b4cd1a94. +--- + include/swaynag/swaynag.h | 3 ++ + meson.build | 2 +- + swaybar/bar.c | 1 + + swaynag/swaynag.c | 59 ++++++++++++++++++++++++++------------- + 4 files changed, 45 insertions(+), 20 deletions(-) + +diff --git a/include/swaynag/swaynag.h b/include/swaynag/swaynag.h +index baa6ee8b..9e39e716 100644 +--- a/include/swaynag/swaynag.h ++++ b/include/swaynag/swaynag.h +@@ -5,6 +5,7 @@ + #include "list.h" + #include "pool-buffer.h" + #include "swaynag/types.h" ++#include "xdg-output-unstable-v1-client-protocol.h" + + #define SWAYNAG_MAX_HEIGHT 500 + +@@ -74,11 +75,13 @@ struct swaynag_details { + + struct swaynag { + bool run_display; ++ int querying_outputs; + + struct wl_display *display; + struct wl_compositor *compositor; + struct wl_seat *seat; + struct wl_shm *shm; ++ struct zxdg_output_manager_v1 *xdg_output_manager; + struct wl_list outputs; // swaynag_output::link + struct wl_list seats; // swaynag_seat::link + struct swaynag_output *output; +diff --git a/meson.build b/meson.build +index 452502ff..01e778e0 100644 +--- a/meson.build ++++ b/meson.build +@@ -37,7 +37,7 @@ endif + + jsonc = dependency('json-c', version: '>=0.13') + pcre = dependency('libpcre') +-wayland_server = dependency('wayland-server', version: '>=1.20.0') ++wayland_server = dependency('wayland-server') + wayland_client = dependency('wayland-client') + wayland_cursor = dependency('wayland-cursor') + wayland_egl = dependency('wayland-egl') +diff --git a/swaybar/bar.c b/swaybar/bar.c +index 6ffdc9b4..18b87e6d 100644 +--- a/swaybar/bar.c ++++ b/swaybar/bar.c +@@ -54,6 +54,7 @@ static void swaybar_output_free(struct swaybar_output *output) { + if (output->input_region != NULL) { + wl_region_destroy(output->input_region); + } ++ zxdg_output_v1_destroy(output->xdg_output); + wl_output_destroy(output->output); + destroy_buffer(&output->buffers[0]); + destroy_buffer(&output->buffers[1]); +diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c +index 9b57d578..6d4a7a58 100644 +--- a/swaynag/swaynag.c ++++ b/swaynag/swaynag.c +@@ -307,25 +307,33 @@ static void output_scale(void *data, struct wl_output *output, + } + } + +-static void output_name(void *data, struct wl_output *output, +- const char *name) { +- struct swaynag_output *swaynag_output = data; +- swaynag_output->name = strdup(name); ++static const struct wl_output_listener output_listener = { ++ .geometry = nop, ++ .mode = nop, ++ .done = nop, ++ .scale = output_scale, ++}; + +- const char *outname = swaynag_output->swaynag->type->output; +- if (!swaynag_output->swaynag->output && outname && +- strcmp(outname, name) == 0) { ++static void xdg_output_handle_name(void *data, ++ struct zxdg_output_v1 *xdg_output, const char *name) { ++ struct swaynag_output *swaynag_output = data; ++ char *outname = swaynag_output->swaynag->type->output; ++ sway_log(SWAY_DEBUG, "Checking against output %s for %s", name, outname); ++ if (!swaynag_output->swaynag->output && outname && name ++ && strcmp(outname, name) == 0) { + sway_log(SWAY_DEBUG, "Using output %s", name); + swaynag_output->swaynag->output = swaynag_output; + } ++ swaynag_output->name = strdup(name); ++ zxdg_output_v1_destroy(xdg_output); ++ swaynag_output->swaynag->querying_outputs--; + } + +-static const struct wl_output_listener output_listener = { +- .geometry = nop, +- .mode = nop, ++static const struct zxdg_output_v1_listener xdg_output_listener = { ++ .logical_position = nop, ++ .logical_size = nop, + .done = nop, +- .scale = output_scale, +- .name = output_name, ++ .name = xdg_output_handle_name, + .description = nop, + }; + +@@ -353,21 +361,33 @@ static void handle_global(void *data, struct wl_registry *registry, + } else if (strcmp(interface, wl_shm_interface.name) == 0) { + swaynag->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); + } else if (strcmp(interface, wl_output_interface.name) == 0) { +- if (!swaynag->output) { ++ if (!swaynag->output && swaynag->xdg_output_manager) { ++ swaynag->querying_outputs++; + struct swaynag_output *output = + calloc(1, sizeof(struct swaynag_output)); + output->wl_output = wl_registry_bind(registry, name, +- &wl_output_interface, 4); ++ &wl_output_interface, 3); + output->wl_name = name; + output->scale = 1; + output->swaynag = swaynag; + wl_list_insert(&swaynag->outputs, &output->link); + wl_output_add_listener(output->wl_output, + &output_listener, output); ++ ++ struct zxdg_output_v1 *xdg_output; ++ xdg_output = zxdg_output_manager_v1_get_xdg_output( ++ swaynag->xdg_output_manager, output->wl_output); ++ zxdg_output_v1_add_listener(xdg_output, ++ &xdg_output_listener, output); + } + } else if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) { + swaynag->layer_shell = wl_registry_bind( + registry, name, &zwlr_layer_shell_v1_interface, 1); ++ } else if (strcmp(interface, zxdg_output_manager_v1_interface.name) == 0 ++ && version >= ZXDG_OUTPUT_V1_NAME_SINCE_VERSION) { ++ swaynag->xdg_output_manager = wl_registry_bind(registry, name, ++ &zxdg_output_manager_v1_interface, ++ ZXDG_OUTPUT_V1_NAME_SINCE_VERSION); + } + } + +@@ -433,11 +453,12 @@ void swaynag_setup(struct swaynag *swaynag) { + + assert(swaynag->compositor && swaynag->layer_shell && swaynag->shm); + +- // Second roundtrip to get wl_output properties +- if (wl_display_roundtrip(swaynag->display) < 0) { +- sway_log(SWAY_ERROR, "Error during outputs init."); +- swaynag_destroy(swaynag); +- exit(EXIT_FAILURE); ++ while (swaynag->querying_outputs > 0) { ++ if (wl_display_roundtrip(swaynag->display) < 0) { ++ sway_log(SWAY_ERROR, "Error during outputs init."); ++ swaynag_destroy(swaynag); ++ exit(EXIT_FAILURE); ++ } + } + + if (!swaynag->output && swaynag->type->output) { +-- +2.33.1 + diff --git a/sway.spec b/sway.spec index cf1fa11..c280d3c 100644 --- a/sway.spec +++ b/sway.spec @@ -1,23 +1,26 @@ +%global tag 1.7-rc3 + Name: sway -Version: 1.6.1 -Release: 4%{?dist} +Version: %(echo %{tag} | tr '-' '~') +Release: 1%{?dist} Summary: i3-compatible window manager for Wayland License: MIT URL: https://github.com/swaywm/sway -Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.gz -Source1: %{url}/releases/download/%{version}/%{name}-%{version}.tar.gz.sig +Source0: %{url}/releases/download/%{tag}/%{name}-%{tag}.tar.gz +Source1: %{url}/releases/download/%{tag}/%{name}-%{tag}.tar.gz.sig # 0FDE7BE0E88F5E48: emersion Source2: https://emersion.fr/.well-known/openpgpkey/hu/dj3498u4hyyarh35rkjfnghbjxug6b19#/gpgkey-0FDE7BE0E88F5E48.gpg -# Fixes initialization of pixman renderer, swaywm/sway#6355 -Patch0: %{url}/commit/86b08e3.patch#/sway-1.6.1-desktop-render-remove-unused-wlr_gles2_texture_attri.patch -# Fixes various issues caused by reaching the limit of available file descriptors -# Backported from 38020d1, swaywm/sway#6629 -Patch1: sway-1.6.1-Bump-RLIMIT_NOFILE.patch +%if 0%{?fedora} < 36 +# Revert the commits that require wayland 1.20 and meson 0.60 +# Allows module builds on f34 and f35 +Patch100: sway-1.7-meson-0.59-compat.patch +Patch101: sway-1.7-wayland-1.19-compat.patch +%endif BuildRequires: gcc-c++ BuildRequires: gnupg2 -BuildRequires: meson >= 0.53.0 +BuildRequires: meson >= 0.59.0 BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(gdk-pixbuf-2.0) BuildRequires: pkgconfig(json-c) >= 0.13 @@ -34,8 +37,8 @@ BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-cursor) BuildRequires: pkgconfig(wayland-egl) BuildRequires: pkgconfig(wayland-server) -BuildRequires: pkgconfig(wayland-protocols) >= 1.14 -BuildRequires: pkgconfig(wlroots) >= 0.14.0 +BuildRequires: pkgconfig(wayland-protocols) >= 1.24 +BuildRequires: (pkgconfig(wlroots) >= 0.15.0 with pkgconfig(wlroots) < 0.16) BuildRequires: pkgconfig(xcb) BuildRequires: pkgconfig(xkbcommon) # Dmenu is the default launcher in sway @@ -59,8 +62,8 @@ Recommends: (qt6-qtwayland if qt6-qtbase-gui) # dmenu (as well as rxvt any many others) requires XWayland on Sway Requires: xorg-x11-server-Xwayland -# Sway binds the terminal shortcut to one specific terminal. In our case alacritty -Recommends: alacritty +# Sway binds the terminal shortcut to one specific terminal. In our case foot +Recommends: foot # grim is the recommended way to take screenshots on sway 1.0+ Recommends: grim @@ -83,11 +86,12 @@ interface. %prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' -%autosetup -p1 +%autosetup -p1 -n %{name}-%{tag} %build %meson \ - -Dsd-bus-provider=libsystemd + -Dsd-bus-provider=libsystemd \ + -Dwerror=false %meson_build %install @@ -131,6 +135,11 @@ install -D -m755 -pv contrib/grimshot %{buildroot}%{_bindir}/grimshot %{_mandir}/man1/grimshot.1* %changelog +* Sun Jan 16 2022 Aleksei Bavshin - 1.7~rc3-1 +- Update to 1.7-rc3 +- Change default terminal dependency to foot +- Disable `werror` to work around a couple of new warnings in GCC 12 + * Mon Jan 10 2022 Aleksei Bavshin - 1.6.1-4 - Add upstream patch to increase RLIMIT_NOFILE