From c5a77cdbfbfb1eb21e7330bf113a9651e024025a Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sep 21 2020 14:45:56 +0000 Subject: Update to 0.9.4 --- diff --git a/Fix-crash-with-fmt.patch b/Fix-crash-with-fmt.patch deleted file mode 100644 index 73a2d87..0000000 --- a/Fix-crash-with-fmt.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 9b41b9593418772ce578a87de5984d4e37ef7f11 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Thorben=20G=C3=BCnther?= -Date: Mon, 10 Aug 2020 20:53:29 +0200 -Subject: [PATCH] Fix crash with fmt - ---- - include/util/format.hpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/util/format.hpp b/include/util/format.hpp -index 0147701b..288d8f0c 100644 ---- a/include/util/format.hpp -+++ b/include/util/format.hpp -@@ -23,7 +23,7 @@ namespace fmt { - constexpr auto parse(ParseContext& ctx) -> decltype (ctx.begin()) { - auto it = ctx.begin(), end = ctx.end(); - if (it != end && *it == ':') ++it; -- if (*it == '>' || *it == '<' || *it == '=') { -+ if (it && (*it == '>' || *it == '<' || *it == '=')) { - spec = *it; - ++it; - } diff --git a/Handle-SIGCHLD-for-exec-forkExec.patch b/Handle-SIGCHLD-for-exec-forkExec.patch deleted file mode 100644 index 7b6734f..0000000 --- a/Handle-SIGCHLD-for-exec-forkExec.patch +++ /dev/null @@ -1,276 +0,0 @@ -From 246f7bf555e17dcdb0f765aca3b852382b4075df Mon Sep 17 00:00:00 2001 -From: excellentname -Date: Tue, 21 Jul 2020 12:36:48 +1000 -Subject: [PATCH 1/2] Handle SIGCHLD for exec/forkExec - -When forkExec is called it begins to ignore all SIGCHLD signals for -the rest of the progam's execution so that they are automatically -reaped. However, this means that subsequent waitpid calls in the exec -function will always fail. So instead handle SIGCHLD by reaping any -processes created by forkExec and ignoring all others so that they can be -handled directly by the exec function. ---- - include/util/command.hpp | 12 ++++++++++-- - src/main.cpp | 26 ++++++++++++++++++++++++++ - 2 files changed, 36 insertions(+), 2 deletions(-) - -diff --git a/include/util/command.hpp b/include/util/command.hpp -index a72a8294..9db8d833 100644 ---- a/include/util/command.hpp -+++ b/include/util/command.hpp -@@ -7,6 +7,9 @@ - - #include - -+extern sig_atomic_t is_inserting_pid; -+extern std::list reap; -+ - namespace waybar::util::command { - - struct res { -@@ -32,10 +35,11 @@ inline std::string read(FILE* fp) { - - inline int close(FILE* fp, pid_t pid) { - int stat = -1; -+ pid_t ret; - - fclose(fp); - do { -- waitpid(pid, &stat, WCONTINUED | WUNTRACED); -+ ret = waitpid(pid, &stat, WCONTINUED | WUNTRACED); - - if (WIFEXITED(stat)) { - spdlog::debug("Cmd exited with code {}", WEXITSTATUS(stat)); -@@ -45,6 +49,8 @@ inline int close(FILE* fp, pid_t pid) { - spdlog::debug("Cmd stopped by {}", WSTOPSIG(stat)); - } else if (WIFCONTINUED(stat)) { - spdlog::debug("Cmd continued"); -+ } else if (ret == -1) { -+ spdlog::debug("waitpid failed: {}", strerror(errno)); - } else { - break; - } -@@ -111,7 +117,9 @@ inline int32_t forkExec(const std::string& cmd) { - execl("/bin/sh", "sh", "-c", cmd.c_str(), (char*)0); - exit(0); - } else { -- signal(SIGCHLD, SIG_IGN); -+ is_inserting_pid = true; -+ reap.push_back(pid); -+ is_inserting_pid = false; - } - - return pid; -diff --git a/src/main.cpp b/src/main.cpp -index f066cf85..5350ec09 100644 ---- a/src/main.cpp -+++ b/src/main.cpp -@@ -1,7 +1,32 @@ - #include -+#include -+#include -+#include - #include - #include "client.hpp" - -+sig_atomic_t is_inserting_pid = false; -+std::list reap; -+ -+static void handler(int sig) { -+ int saved_errno = errno; -+ if (!is_inserting_pid) { -+ for (auto it = reap.begin(); it != reap.end(); ++it) { -+ if (waitpid(*it, nullptr, WNOHANG) == *it) { -+ it = reap.erase(it); -+ } -+ } -+ } -+ errno = saved_errno; -+} -+ -+inline void installSigChldHandler(void) { -+ struct sigaction sa; -+ sigemptyset(&sa.sa_mask); -+ sa.sa_handler = handler; -+ sigaction(SIGCHLD, &sa, nullptr); -+} -+ - int main(int argc, char* argv[]) { - try { - auto client = waybar::Client::inst(); -@@ -18,6 +43,7 @@ int main(int argc, char* argv[]) { - } - }); - } -+ installSigChldHandler(); - - auto ret = client->main(argc, argv); - delete client; - -From c3359dec1b3a711f2912aab6c11009a8c46d2fe2 Mon Sep 17 00:00:00 2001 -From: excellentname -Date: Sat, 25 Jul 2020 21:02:59 +1000 -Subject: [PATCH 2/2] Replace signal handler with signal handling thread - ---- - include/util/command.hpp | 22 ++++++++++--- - src/main.cpp | 70 +++++++++++++++++++++++++++++++--------- - 2 files changed, 72 insertions(+), 20 deletions(-) - -diff --git a/include/util/command.hpp b/include/util/command.hpp -index 9db8d833..52655581 100644 ---- a/include/util/command.hpp -+++ b/include/util/command.hpp -@@ -7,7 +7,7 @@ - - #include - --extern sig_atomic_t is_inserting_pid; -+extern std::mutex reap_mtx; - extern std::list reap; - - namespace waybar::util::command { -@@ -71,6 +71,12 @@ inline FILE* open(const std::string& cmd, int& pid) { - } - - if (!child_pid) { -+ int err; -+ sigset_t mask; -+ sigfillset(&mask); -+ // Reset sigmask -+ err = pthread_sigmask(SIG_UNBLOCK, &mask, nullptr); -+ if (err != 0) spdlog::error("pthread_sigmask in open failed: {}", strerror(err)); - ::close(fd[0]); - dup2(fd[1], 1); - setpgid(child_pid, child_pid); -@@ -103,7 +109,7 @@ inline struct res execNoRead(const std::string& cmd) { - inline int32_t forkExec(const std::string& cmd) { - if (cmd == "") return -1; - -- int32_t pid = fork(); -+ pid_t pid = fork(); - - if (pid < 0) { - spdlog::error("Unable to exec cmd {}, error {}", cmd.c_str(), strerror(errno)); -@@ -112,14 +118,20 @@ inline int32_t forkExec(const std::string& cmd) { - - // Child executes the command - if (!pid) { -+ int err; -+ sigset_t mask; -+ sigfillset(&mask); -+ // Reset sigmask -+ err = pthread_sigmask(SIG_UNBLOCK, &mask, nullptr); -+ if (err != 0) spdlog::error("pthread_sigmask in forkExec failed: {}", strerror(err)); - setpgid(pid, pid); -- signal(SIGCHLD, SIG_DFL); - execl("/bin/sh", "sh", "-c", cmd.c_str(), (char*)0); - exit(0); - } else { -- is_inserting_pid = true; -+ reap_mtx.lock(); - reap.push_back(pid); -- is_inserting_pid = false; -+ reap_mtx.unlock(); -+ spdlog::debug("Added child to reap list: {}", pid); - } - - return pid; -diff --git a/src/main.cpp b/src/main.cpp -index 5350ec09..19a8de1e 100644 ---- a/src/main.cpp -+++ b/src/main.cpp -@@ -1,30 +1,70 @@ - #include - #include -+#include - #include - #include - #include - #include "client.hpp" - --sig_atomic_t is_inserting_pid = false; -+std::mutex reap_mtx; - std::list reap; - --static void handler(int sig) { -- int saved_errno = errno; -- if (!is_inserting_pid) { -- for (auto it = reap.begin(); it != reap.end(); ++it) { -- if (waitpid(*it, nullptr, WNOHANG) == *it) { -- it = reap.erase(it); -- } -+void* signalThread(void* args) { -+ int err, signum; -+ sigset_t mask; -+ sigemptyset(&mask); -+ sigaddset(&mask, SIGCHLD); -+ -+ while (true) { -+ err = sigwait(&mask, &signum); -+ if (err != 0) { -+ spdlog::error("sigwait failed: {}", strerror(errno)); -+ continue; -+ } -+ -+ switch (signum) { -+ case SIGCHLD: -+ spdlog::debug("Received SIGCHLD in signalThread"); -+ if (!reap.empty()) { -+ reap_mtx.lock(); -+ for (auto it = reap.begin(); it != reap.end(); ++it) { -+ if (waitpid(*it, nullptr, WNOHANG) == *it) { -+ spdlog::debug("Reaped child with PID: {}", *it); -+ it = reap.erase(it); -+ } -+ } -+ reap_mtx.unlock(); -+ } -+ break; -+ default: -+ spdlog::debug("Received signal with number {}, but not handling", -+ signum); -+ break; - } - } -- errno = saved_errno; - } - --inline void installSigChldHandler(void) { -- struct sigaction sa; -- sigemptyset(&sa.sa_mask); -- sa.sa_handler = handler; -- sigaction(SIGCHLD, &sa, nullptr); -+void startSignalThread(void) { -+ int err; -+ sigset_t mask; -+ sigemptyset(&mask); -+ sigaddset(&mask, SIGCHLD); -+ -+ // Block SIGCHLD so it can be handled by the signal thread -+ // Any threads created by this one (the main thread) should not -+ // modify their signal mask to unblock SIGCHLD -+ err = pthread_sigmask(SIG_BLOCK, &mask, nullptr); -+ if (err != 0) { -+ spdlog::error("pthread_sigmask failed in startSignalThread: {}", strerror(err)); -+ exit(1); -+ } -+ -+ pthread_t thread_id; -+ err = pthread_create(&thread_id, nullptr, signalThread, nullptr); -+ if (err != 0) { -+ spdlog::error("pthread_create failed in startSignalThread: {}", strerror(err)); -+ exit(1); -+ } - } - - int main(int argc, char* argv[]) { -@@ -43,7 +83,7 @@ int main(int argc, char* argv[]) { - } - }); - } -- installSigChldHandler(); -+ startSignalThread(); - - auto ret = client->main(argc, argv); - delete client; diff --git a/minor-string-fixes-to-wlr-taskbar.patch b/minor-string-fixes-to-wlr-taskbar.patch deleted file mode 100644 index ef3ffc4..0000000 --- a/minor-string-fixes-to-wlr-taskbar.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 6a2d214b55cb1e8517afccb18c3799b22e16a57e Mon Sep 17 00:00:00 2001 -From: Daniel De Graaf -Date: Wed, 5 Aug 2020 20:31:57 -0400 -Subject: [PATCH 1/2] Fix titles containing & and other HTML entities - ---- - src/modules/wlr/taskbar.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp -index 23a91661..025e5c19 100644 ---- a/src/modules/wlr/taskbar.cpp -+++ b/src/modules/wlr/taskbar.cpp -@@ -306,7 +306,7 @@ std::string Task::state_string(bool shortened) const - - void Task::handle_title(const char *title) - { -- title_ = title; -+ title_ = Glib::Markup::escape_text(title); - } - - void Task::handle_app_id(const char *app_id) - -From 4cd31cf3c36db71c04eabf3dad1f12b877991015 Mon Sep 17 00:00:00 2001 -From: Daniel De Graaf -Date: Wed, 5 Aug 2020 20:35:41 -0400 -Subject: [PATCH 2/2] Fix wlr/taskbar all-outputs config string - ---- - src/modules/wlr/taskbar.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp -index 025e5c19..f7e11df9 100644 ---- a/src/modules/wlr/taskbar.cpp -+++ b/src/modules/wlr/taskbar.cpp -@@ -709,7 +709,7 @@ bool Taskbar::show_output(struct wl_output *output) const - - bool Taskbar::all_outputs() const - { -- static bool result = config_["all_outputs"].isBool() ? config_["all_outputs"].asBool() : false; -+ static bool result = config_["all-outputs"].isBool() ? config_["all-outputs"].asBool() : false; - - return result; - } diff --git a/revert-fix-cancel-thread-and-fix-window-close.patch b/revert-fix-cancel-thread-and-fix-window-close.patch deleted file mode 100644 index c5e3e93..0000000 --- a/revert-fix-cancel-thread-and-fix-window-close.patch +++ /dev/null @@ -1,377 +0,0 @@ -From 98cb13e17f73f1c7346891506a366eca3d2b1f92 Mon Sep 17 00:00:00 2001 -From: Aleksei Bavshin -Date: Wed, 2 Sep 2020 09:54:26 -0700 -Subject: [PATCH] Revert "fix: cancel thread and fix window close" - -This reverts commit 6e7f22ac3ada6e27facee84fcbe2b3973eadbe1d. ---- - include/AModule.hpp | 6 ++--- - include/bar.hpp | 2 +- - include/modules/network.hpp | 2 ++ - include/util/rfkill.hpp | 4 +-- - include/util/sleeper_thread.hpp | 5 ---- - src/AModule.cpp | 5 ++-- - src/bar.cpp | 2 +- - src/client.cpp | 3 +-- - src/modules/mpd.cpp | 30 +++++++++++---------- - src/modules/network.cpp | 47 +++++++++++++++++++++++++++++++++ - src/util/rfkill.cpp | 33 +++++++++++++---------- - 11 files changed, 93 insertions(+), 46 deletions(-) - -diff --git a/include/AModule.hpp b/include/AModule.hpp -index c9f1ae2..f7cc484 100644 ---- a/include/AModule.hpp -+++ b/include/AModule.hpp -@@ -4,15 +4,14 @@ - #include - #include - #include -- - #include "IModule.hpp" - - namespace waybar { - - class AModule : public IModule { - public: -- AModule(const Json::Value &, const std::string &, const std::string &, bool enable_click = false, -- bool enable_scroll = false); -+ AModule(const Json::Value &, const std::string &, const std::string &, -+ bool enable_click = false, bool enable_scroll = false); - virtual ~AModule(); - virtual auto update() -> void; - virtual operator Gtk::Widget &(); -@@ -25,7 +24,6 @@ class AModule : public IModule { - SCROLL_DIR getScrollDir(GdkEventScroll *e); - bool tooltipEnabled(); - -- const std::string name_; - const Json::Value &config_; - Gtk::EventBox event_box_; - -diff --git a/include/bar.hpp b/include/bar.hpp -index 63f0e22..fb0cd59 100644 ---- a/include/bar.hpp -+++ b/include/bar.hpp -@@ -34,10 +34,10 @@ class Bar { - - struct waybar_output *output; - Json::Value config; -+ Gtk::Window window; - struct wl_surface * surface; - bool visible = true; - bool vertical = false; -- Gtk::Window window; - - private: - static constexpr const char *MIN_HEIGHT_MSG = -diff --git a/include/modules/network.hpp b/include/modules/network.hpp -index a0156fb..edb5aa6 100644 ---- a/include/modules/network.hpp -+++ b/include/modules/network.hpp -@@ -52,6 +52,8 @@ class Network : public ALabel { - struct sockaddr_nl nladdr_ = {0}; - struct nl_sock* sock_ = nullptr; - struct nl_sock* ev_sock_ = nullptr; -+ int efd_; -+ int ev_fd_; - int nl80211_id_; - std::mutex mutex_; - -diff --git a/include/util/rfkill.hpp b/include/util/rfkill.hpp -index ac3d406..5dbf3ce 100644 ---- a/include/util/rfkill.hpp -+++ b/include/util/rfkill.hpp -@@ -5,7 +5,7 @@ - namespace waybar::util { - - class Rfkill { -- public: -+ public:; - Rfkill(enum rfkill_type rfkill_type); - ~Rfkill() = default; - void waitForEvent(); -@@ -13,7 +13,7 @@ class Rfkill { - - private: - enum rfkill_type rfkill_type_; -- int state_ = 0; -+ int state_ = 0; - }; - - } // namespace waybar::util -diff --git a/include/util/sleeper_thread.hpp b/include/util/sleeper_thread.hpp -index 9adbe8f..642d47d 100644 ---- a/include/util/sleeper_thread.hpp -+++ b/include/util/sleeper_thread.hpp -@@ -59,11 +59,6 @@ class SleeperThread { - do_run_ = false; - } - condvar_.notify_all(); -- auto handle = thread_.native_handle(); -- if (handle != 0) { -- // TODO: find a proper way to terminate thread... -- pthread_cancel(handle); -- } - } - - ~SleeperThread() { -diff --git a/src/AModule.cpp b/src/AModule.cpp -index 10bd077..3066bfc 100644 ---- a/src/AModule.cpp -+++ b/src/AModule.cpp -@@ -6,7 +6,7 @@ namespace waybar { - - AModule::AModule(const Json::Value& config, const std::string& name, const std::string& id, - bool enable_click, bool enable_scroll) -- : name_(std::move(name)), config_(std::move(config)) { -+ : config_(std::move(config)) { - // configure events' user commands - if (config_["on-click"].isString() || config_["on-click-middle"].isString() || - config_["on-click-backward"].isString() || config_["on-click-forward"].isString() || -@@ -23,12 +23,11 @@ AModule::AModule(const Json::Value& config, const std::string& name, const std:: - AModule::~AModule() { - for (const auto& pid : pid_) { - if (pid != -1) { -- killpg(pid, SIGTERM); -+ kill(-pid, 9); - } - } - } - -- - auto AModule::update() -> void { - // Run user-provided update handler if configured - if (config_["on-update"].isString()) { -diff --git a/src/bar.cpp b/src/bar.cpp -index 3bbc2a3..72dc14b 100644 ---- a/src/bar.cpp -+++ b/src/bar.cpp -@@ -10,8 +10,8 @@ - waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) - : output(w_output), - config(w_config), -- surface(nullptr), - window{Gtk::WindowType::WINDOW_TOPLEVEL}, -+ surface(nullptr), - layer_surface_(nullptr), - anchor_(ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP), - left_(Gtk::ORIENTATION_HORIZONTAL, 0), -diff --git a/src/client.cpp b/src/client.cpp -index 316e7ec..dee28a4 100644 ---- a/src/client.cpp -+++ b/src/client.cpp -@@ -145,8 +145,7 @@ void waybar::Client::handleMonitorRemoved(Glib::RefPtr monitor) { - for (auto it = bars.begin(); it != bars.end();) { - if ((*it)->output->monitor == monitor) { - auto output_name = (*it)->output->name; -- (*it)->window.hide(); -- gtk_app->remove_window((*it)->window); -+ (*it)->window.close(); - it = bars.erase(it); - spdlog::info("Bar removed from output: {}", output_name); - } else { -diff --git a/src/modules/mpd.cpp b/src/modules/mpd.cpp -index 957b3c7..d2877f3 100644 ---- a/src/modules/mpd.cpp -+++ b/src/modules/mpd.cpp -@@ -63,20 +63,22 @@ auto waybar::modules::MPD::update() -> void { - - std::thread waybar::modules::MPD::event_listener() { - return std::thread([this] { -- try { -- if (connection_ == nullptr) { -- // Retry periodically if no connection -- dp.emit(); -- std::this_thread::sleep_for(interval_); -- } else { -- waitForEvent(); -- dp.emit(); -- } -- } catch (const std::exception& e) { -- if (strcmp(e.what(), "Connection to MPD closed") == 0) { -- spdlog::debug("{}: {}", module_name_, e.what()); -- } else { -- spdlog::warn("{}: {}", module_name_, e.what()); -+ while (true) { -+ try { -+ if (connection_ == nullptr) { -+ // Retry periodically if no connection -+ dp.emit(); -+ std::this_thread::sleep_for(interval_); -+ } else { -+ waitForEvent(); -+ dp.emit(); -+ } -+ } catch (const std::exception& e) { -+ if (strcmp(e.what(), "Connection to MPD closed") == 0) { -+ spdlog::debug("{}: {}", module_name_, e.what()); -+ } else { -+ spdlog::warn("{}: {}", module_name_, e.what()); -+ } - } - } - }); -diff --git a/src/modules/network.cpp b/src/modules/network.cpp -index 2c0562f..035454e 100644 ---- a/src/modules/network.cpp -+++ b/src/modules/network.cpp -@@ -81,6 +81,8 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf - : ALabel(config, "network", id, "{ifname}", 60), - ifid_(-1), - family_(config["family"] == "ipv6" ? AF_INET6 : AF_INET), -+ efd_(-1), -+ ev_fd_(-1), - cidr_(-1), - signal_strength_dbm_(0), - signal_strength_(0), -@@ -115,6 +117,14 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf - } - - waybar::modules::Network::~Network() { -+ if (ev_fd_ > -1) { -+ eventfd_write(ev_fd_, 1); -+ std::this_thread::sleep_for(std::chrono::milliseconds(150)); -+ close(ev_fd_); -+ } -+ if (efd_ > -1) { -+ close(efd_); -+ } - if (ev_sock_ != nullptr) { - nl_socket_drop_membership(ev_sock_, RTNLGRP_LINK); - if (family_ == AF_INET) { -@@ -146,6 +156,30 @@ void waybar::modules::Network::createEventSocket() { - } else { - nl_socket_add_membership(ev_sock_, RTNLGRP_IPV6_IFADDR); - } -+ efd_ = epoll_create1(EPOLL_CLOEXEC); -+ if (efd_ < 0) { -+ throw std::runtime_error("Can't create epoll"); -+ } -+ { -+ ev_fd_ = eventfd(0, EFD_NONBLOCK); -+ struct epoll_event event; -+ memset(&event, 0, sizeof(event)); -+ event.events = EPOLLIN | EPOLLET; -+ event.data.fd = ev_fd_; -+ if (epoll_ctl(efd_, EPOLL_CTL_ADD, ev_fd_, &event) == -1) { -+ throw std::runtime_error("Can't add epoll event"); -+ } -+ } -+ { -+ auto fd = nl_socket_get_fd(ev_sock_); -+ struct epoll_event event; -+ memset(&event, 0, sizeof(event)); -+ event.events = EPOLLIN | EPOLLET | EPOLLRDHUP; -+ event.data.fd = fd; -+ if (epoll_ctl(efd_, EPOLL_CTL_ADD, fd, &event) == -1) { -+ throw std::runtime_error("Can't add epoll event"); -+ } -+ } - } - - void waybar::modules::Network::createInfoSocket() { -@@ -184,6 +218,19 @@ void waybar::modules::Network::worker() { - } - } - }; -+ thread_ = [this] { -+ std::array events{}; -+ -+ int ec = epoll_wait(efd_, events.data(), EPOLL_MAX, -1); -+ if (ec > 0) { -+ for (auto i = 0; i < ec; i++) { -+ if (events[i].data.fd != nl_socket_get_fd(ev_sock_) || nl_recvmsgs_default(ev_sock_) < 0) { -+ thread_.stop(); -+ break; -+ } -+ } -+ } -+ }; - } - - const std::string waybar::modules::Network::getNetworkState() const { -diff --git a/src/util/rfkill.cpp b/src/util/rfkill.cpp -index f987f4c..df77598 100644 ---- a/src/util/rfkill.cpp -+++ b/src/util/rfkill.cpp -@@ -3,11 +3,11 @@ - * Copyright 2009 Johannes Berg - * Copyright 2009 Marcel Holtmann - * Copyright 2009 Tim Gardner -- * -+ * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. -- * -+ * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -@@ -17,24 +17,24 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - - #include "util/rfkill.hpp" -- --#include - #include -+#include - #include -+#include -+#include - #include --#include -- - #include --#include - #include - --waybar::util::Rfkill::Rfkill(const enum rfkill_type rfkill_type) : rfkill_type_(rfkill_type) {} -+waybar::util::Rfkill::Rfkill(const enum rfkill_type rfkill_type) -+ : rfkill_type_(rfkill_type) { -+} - - void waybar::util::Rfkill::waitForEvent() { - struct rfkill_event event; -- struct pollfd p; -- ssize_t len; -- int fd, n; -+ struct pollfd p; -+ ssize_t len; -+ int fd, n; - - fd = open("/dev/rfkill", O_RDONLY); - if (fd < 0) { -@@ -53,7 +53,8 @@ void waybar::util::Rfkill::waitForEvent() { - break; - } - -- if (n == 0) continue; -+ if (n == 0) -+ continue; - - len = read(fd, &event, sizeof(event)); - if (len < 0) { -@@ -66,13 +67,17 @@ void waybar::util::Rfkill::waitForEvent() { - continue; - } - -- if (event.type == rfkill_type_ && event.op == RFKILL_OP_CHANGE) { -+ if(event.type == rfkill_type_ && event.op == RFKILL_OP_CHANGE) { - state_ = event.soft || event.hard; - break; - } - } - - close(fd); -+ return; - } - --bool waybar::util::Rfkill::getState() const { return state_; } -+ -+bool waybar::util::Rfkill::getState() const { -+ return state_; -+} --- -2.26.2 - diff --git a/sources b/sources index 56bc195..0463d6d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (waybar-0.9.3.tar.gz) = 19dba92c5e430ce71567f149e5d208d594928a1d642584f606d55779d0a336ec4587e8a2e15698a25bdf0d26525f771d0a73b193f948bf9c1dfba5be350d4e78 +SHA512 (waybar-0.9.4.tar.gz) = 601eb9597089491d95bd5e055d9bffb0e33d637351ad41f9177fd4dd915b2a12587e96f922314aa7a009ccb4c1b5cf8da0553710b5ea84a9ba25c5755b9fa61a diff --git a/waybar.spec b/waybar.spec index 4567417..bbbeae6 100644 --- a/waybar.spec +++ b/waybar.spec @@ -1,20 +1,11 @@ Name: waybar -Version: 0.9.3 -Release: 2%{?dist} +Version: 0.9.4 +Release: 1%{?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 -# make wlr/taskbar config options match manual -Patch0: %{url}/pull/798.patch#/minor-string-fixes-to-wlr-taskbar.patch -# fix regression with custom module signal handling -Patch1: %{url}/pull/778.patch#/Handle-SIGCHLD-for-exec-forkExec.patch -# fix crash in network module -Patch2: %{url}/pull/813.patch#/Fix-crash-with-fmt.patch -# fix regression in network and mpd modules -# https://github.com/Alexays/Waybar/issues/838 -Patch3: revert-fix-cancel-thread-and-fix-window-close.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -72,6 +63,9 @@ Recommends: fontawesome-fonts %{_mandir}/man5/%{name}* %changelog +* Mon Sep 21 2020 Aleksei Bavshin - 0.9.4-1 +- Update to 0.9.4 + * Sun Sep 20 2020 Aleksei Bavshin - 0.9.3-2 - Add patch for custom module signal handling regression - Add patch for network module crash with fmt 7.0