From fd7f4788d499e357bd323f38b1aa23d20c95d129 Mon Sep 17 00:00:00 2001 From: flupe Date: Tue, 11 Jan 2022 02:11:01 +0100 Subject: [PATCH] Waybar: update to 0.9.9. --- srcpkgs/Waybar/patches/river-tags.patch | 164 ------------------------ srcpkgs/Waybar/template | 6 +- 2 files changed, 3 insertions(+), 167 deletions(-) delete mode 100644 srcpkgs/Waybar/patches/river-tags.patch diff --git a/srcpkgs/Waybar/patches/river-tags.patch b/srcpkgs/Waybar/patches/river-tags.patch deleted file mode 100644 index 63491535e0f0..000000000000 --- a/srcpkgs/Waybar/patches/river-tags.patch +++ /dev/null @@ -1,164 +0,0 @@ -From 024fd42e272f79cb08e594eb3af86c93b1446c91 Mon Sep 17 00:00:00 2001 -From: Isaac Freund -Date: Thu, 19 Aug 2021 14:59:25 +0200 -Subject: [PATCH] river/tags: support urgent tags - -Upstream river has a concept of urgent views/tags as of commit e59c2a73. -Introduce a new urgent style to expose this in the waybar module. ---- - include/modules/river/tags.hpp | 1 + - man/waybar-river-tags.5.scd | 6 ++++-- - protocol/river-status-unstable-v1.xml | 17 +++++++++++++---- - src/modules/river/tags.cpp | 27 +++++++++++++++++++++++++-- - 4 files changed, 43 insertions(+), 8 deletions(-) - -diff --git a/include/modules/river/tags.hpp b/include/modules/river/tags.hpp -index f80b3c591..9b75fbd3b 100644 ---- a/include/modules/river/tags.hpp -+++ b/include/modules/river/tags.hpp -@@ -18,6 +18,7 @@ class Tags : public waybar::AModule { - // Handlers for wayland events - void handle_focused_tags(uint32_t tags); - void handle_view_tags(struct wl_array *tags); -+ void handle_urgent_tags(uint32_t tags); - - struct zriver_status_manager_v1 *status_manager_; - -diff --git a/man/waybar-river-tags.5.scd b/man/waybar-river-tags.5.scd -index 0f0272491..65b90332a 100644 ---- a/man/waybar-river-tags.5.scd -+++ b/man/waybar-river-tags.5.scd -@@ -15,7 +15,7 @@ Addressed by *river/tags* - *num-tags*: ++ - typeof: uint ++ - default: 9 ++ -- The number of tags that should be displayed. -+ The number of tags that should be displayed. Max 32. - - *tag-labels*: ++ - typeof: array ++ -@@ -34,8 +34,10 @@ Addressed by *river/tags* - - *#tags button* - - *#tags button.occupied* - - *#tags button.focused* -+- *#tags button.urgent* - --Note that a tag can be both occupied and focused at the same time. -+Note that occupied/focused/urgent status may overlap. That is, a tag may be -+both occupied and focused at the same time. - - # SEE ALSO - -diff --git a/protocol/river-status-unstable-v1.xml b/protocol/river-status-unstable-v1.xml -index a4d6f4e57..13affaa77 100644 ---- a/protocol/river-status-unstable-v1.xml -+++ b/protocol/river-status-unstable-v1.xml -@@ -1,7 +1,7 @@ - - - -- Copyright 2020 Isaac Freund -+ Copyright 2020 The River Developers - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above -@@ -16,7 +16,7 @@ - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - -- -+ - - A global factory for objects that receive status information specific - to river. It could be used to implement, for example, a status bar. -@@ -47,7 +47,7 @@ - - - -- -+ - - This interface allows clients to receive information about the current - windowing state of an output. -@@ -75,12 +75,21 @@ - - - -+ -+ -+ -+ Sent once on binding the interface and again whenever the set of -+ tags with at least one urgent view changes. -+ -+ -+ - - - - - This interface allows clients to receive information about the current -- focus of a seat. -+ focus of a seat. Note that (un)focused_output events will only be sent -+ if the client has bound the relevant wl_output globals. - - - -diff --git a/src/modules/river/tags.cpp b/src/modules/river/tags.cpp -index e96b20169..2628af2db 100644 ---- a/src/modules/river/tags.cpp -+++ b/src/modules/river/tags.cpp -@@ -22,14 +22,24 @@ static void listen_view_tags(void *data, struct zriver_output_status_v1 *zriver_ - static_cast(data)->handle_view_tags(tags); - } - -+static void listen_urgent_tags(void *data, struct zriver_output_status_v1 *zriver_output_status_v1, -+ uint32_t tags) { -+ static_cast(data)->handle_urgent_tags(tags); -+} -+ - static const zriver_output_status_v1_listener output_status_listener_impl{ - .focused_tags = listen_focused_tags, - .view_tags = listen_view_tags, -+ .urgent_tags = listen_urgent_tags, - }; - - static void handle_global(void *data, struct wl_registry *registry, uint32_t name, - const char *interface, uint32_t version) { - if (std::strcmp(interface, zriver_status_manager_v1_interface.name) == 0) { -+ version = std::min(version, 2); -+ if (version < ZRIVER_OUTPUT_STATUS_V1_URGENT_TAGS_SINCE_VERSION) { -+ spdlog::warn("river server does not support urgent tags"); -+ } - static_cast(data)->status_manager_ = static_cast( - wl_registry_bind(registry, name, &zriver_status_manager_v1_interface, version)); - } -@@ -64,8 +74,9 @@ Tags::Tags(const std::string &id, const waybar::Bar &bar, const Json::Value &con - } - event_box_.add(box_); - -- // Default to 9 tags -- const uint32_t num_tags = config["num-tags"].isUInt() ? config_["num-tags"].asUInt() : 9; -+ // Default to 9 tags, cap at 32 -+ const uint32_t num_tags = -+ config["num-tags"].isUInt() ? std::min(32, config_["num-tags"].asUInt()) : 9; - - std::vector tag_labels(num_tags); - for (uint32_t tag = 0; tag < num_tags; ++tag) { -@@ -129,4 +140,16 @@ void Tags::handle_view_tags(struct wl_array *view_tags) { - } - } - -+void Tags::handle_urgent_tags(uint32_t tags) { -+ uint32_t i = 0; -+ for (auto &button : buttons_) { -+ if ((1 << i) & tags) { -+ button.get_style_context()->add_class("urgent"); -+ } else { -+ button.get_style_context()->remove_class("urgent"); -+ } -+ ++i; -+ } -+} -+ - } /* namespace waybar::modules::river */ - diff --git a/srcpkgs/Waybar/template b/srcpkgs/Waybar/template index 23d5b8221e13..c6470c6d330d 100644 --- a/srcpkgs/Waybar/template +++ b/srcpkgs/Waybar/template @@ -1,7 +1,7 @@ # Template file for 'Waybar' pkgname=Waybar -version=0.9.8 -revision=2 +version=0.9.9 +revision=1 _date_version=3.0.0 build_style=meson configure_args="-Dgtk-layer-shell=enabled -Dlibudev=enabled -Dman-pages=enabled @@ -29,7 +29,7 @@ changelog="https://github.com/Alexays/Waybar/releases" distfiles="https://github.com/Alexays/Waybar/archive/${version}.tar.gz https://github.com/HowardHinnant/date/archive/v${_date_version}.tar.gz https://github.com/mesonbuild/hinnant-date/releases/download/${_date_version}-1/hinnant-date.zip" -checksum="3f067c484aaee3e7d8ded382e72c280a92913b0c4e8a20d0ac9afdf8baf19405 +checksum="23a94538538f43a6db4c1c5f7e09e75ab743ded1ccfc737e1f3e0971fe4cdd87 87bba2eaf0ebc7ec539e5e62fc317cb80671a337c1fb1b84cb9e4d42c6dbebe3 6ccaf70732d8bdbd1b6d5fdf3e1b935c23bf269bda12fdfd0e561276f63432fe"