diff --git a/waybar-0.9.4-do-not-bind-to-unsupported-protocol-versions.patch b/waybar-0.9.4-do-not-bind-to-unsupported-protocol-versions.patch new file mode 100644 index 0000000..d0a9689 --- /dev/null +++ b/waybar-0.9.4-do-not-bind-to-unsupported-protocol-versions.patch @@ -0,0 +1,53 @@ +From 67d54ef3d53e5257e465ec556177ea569100263e Mon Sep 17 00:00:00 2001 +From: Aleksei Bavshin +Date: Sat, 24 Oct 2020 22:56:24 -0700 +Subject: [PATCH] fix(wlr/taskbar): do not bind to unsupported protocol + versions + +It's not allowed to bind to a higher version of a wayland protocol than +supported by the client. Binding wlr-foreign-toplevel-manager-v1 v3 to +a generated code for v2 causes errors in libwayland due to a missing +handler for `zwlr_foreign_toplevel_handle_v1.parent` event. +--- + src/client.cpp | 2 ++ + src/modules/wlr/taskbar.cpp | 5 ++++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/client.cpp b/src/client.cpp +index 70cc22cf..9dd93d81 100644 +--- a/src/client.cpp ++++ b/src/client.cpp +@@ -32,6 +32,8 @@ void waybar::Client::handleGlobal(void *data, struct wl_registry *registry, uint + const char *interface, uint32_t version) { + auto client = static_cast(data); + if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) { ++ // limit version to a highest supported by the client protocol file ++ version = std::min(version, zwlr_layer_shell_v1_interface.version); + client->layer_shell = static_cast( + wl_registry_bind(registry, name, &zwlr_layer_shell_v1_interface, version)); + } else if (strcmp(interface, zxdg_output_manager_v1_interface.name) == 0 && +diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp +index 45915dc6..8d6fa9b4 100644 +--- a/src/modules/wlr/taskbar.cpp ++++ b/src/modules/wlr/taskbar.cpp +@@ -653,9 +653,11 @@ void Taskbar::register_manager(struct wl_registry *registry, uint32_t name, uint + spdlog::warn("Register foreign toplevel manager again although already existing!"); + return; + } +- if (version != 2) { ++ if (version < ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_FULLSCREEN_SINCE_VERSION) { + spdlog::warn("Using different foreign toplevel manager protocol version: {}", version); + } ++ // limit version to a highest supported by the client protocol file ++ version = std::min(version, zwlr_foreign_toplevel_manager_v1_interface.version); + + manager_ = static_cast(wl_registry_bind(registry, name, + &zwlr_foreign_toplevel_manager_v1_interface, version)); +@@ -672,6 +674,7 @@ void Taskbar::register_seat(struct wl_registry *registry, uint32_t name, uint32_ + spdlog::warn("Register seat again although already existing!"); + return; + } ++ version = std::min(version, wl_seat_interface.version); + + seat_ = static_cast(wl_registry_bind(registry, name, &wl_seat_interface, version)); + } diff --git a/waybar.spec b/waybar.spec index fced436..65e2a3b 100644 --- a/waybar.spec +++ b/waybar.spec @@ -1,12 +1,13 @@ Name: waybar Version: 0.9.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Highly customizable Wayland bar for Sway and Wlroots based compositors # MIT for main package, Boost for bundled clara.hpp License: MIT and Boost URL: https://github.com/Alexays/Waybar Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Patch0: %{name}-gcc11.patch +Patch1: %{url}/pull/898.patch#/waybar-0.9.4-do-not-bind-to-unsupported-protocol-versions.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -64,6 +65,9 @@ Recommends: fontawesome-fonts %{_mandir}/man5/%{name}* %changelog +* Fri Nov 13 2020 Aleksei Bavshin - 0.9.4-3 +- Add patch for 'wlr/taskbar' protocol error with wlroots 0.12.0 + * Tue Nov 03 2020 Jeff Law - 0.9.4-2 - Fix mising #includes for gcc-11