@@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
#include "ipc.hpp"
|
#include "ipc.hpp"
|
||||||
#include "util/SafeSignal.hpp"
|
#include "util/SafeSignal.hpp"
|
||||||
#include "util/sleeper_thread.hpp"
|
|
||||||
#include "util/scoped_fd.hpp"
|
#include "util/scoped_fd.hpp"
|
||||||
|
#include "util/sleeper_thread.hpp"
|
||||||
|
|
||||||
namespace waybar::modules::sway {
|
namespace waybar::modules::sway {
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "modules/custom.hpp"
|
#include "modules/custom.hpp"
|
||||||
|
|
||||||
#include <spdlog/spdlog.h>
|
#include <spdlog/spdlog.h>
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "util/scope_guard.hpp"
|
#include "util/scope_guard.hpp"
|
||||||
|
|||||||
@@ -189,8 +189,9 @@ void Window::queryActiveWorkspace() {
|
|||||||
if (workspace_.windows > 0) {
|
if (workspace_.windows > 0) {
|
||||||
const auto clients = m_ipc.getSocket1JsonReply("clients");
|
const auto clients = m_ipc.getSocket1JsonReply("clients");
|
||||||
if (clients.isArray()) {
|
if (clients.isArray()) {
|
||||||
auto activeWindow = std::ranges::find_if(
|
auto activeWindow = std::ranges::find_if(clients, [&](const Json::Value& window) {
|
||||||
clients, [&](const Json::Value& window) { return window["address"] == workspace_.last_window; });
|
return window["address"] == workspace_.last_window;
|
||||||
|
});
|
||||||
|
|
||||||
if (activeWindow == std::end(clients)) {
|
if (activeWindow == std::end(clients)) {
|
||||||
focused_ = false;
|
focused_ = false;
|
||||||
@@ -200,7 +201,8 @@ void Window::queryActiveWorkspace() {
|
|||||||
windowData_ = WindowData::parse(*activeWindow);
|
windowData_ = WindowData::parse(*activeWindow);
|
||||||
updateAppIconName(windowData_.class_name, windowData_.initial_class_name);
|
updateAppIconName(windowData_.class_name, windowData_.initial_class_name);
|
||||||
std::vector<Json::Value> workspaceWindows;
|
std::vector<Json::Value> workspaceWindows;
|
||||||
std::ranges::copy_if(clients, std::back_inserter(workspaceWindows), [&](const Json::Value& window) {
|
std::ranges::copy_if(
|
||||||
|
clients, std::back_inserter(workspaceWindows), [&](const Json::Value& window) {
|
||||||
return window["workspace"]["id"] == workspace_.id && window["mapped"].asBool();
|
return window["workspace"]["id"] == workspace_.id && window["mapped"].asBool();
|
||||||
});
|
});
|
||||||
swallowing_ = std::ranges::any_of(workspaceWindows, [&](const Json::Value& window) {
|
swallowing_ = std::ranges::any_of(workspaceWindows, [&](const Json::Value& window) {
|
||||||
@@ -209,7 +211,8 @@ void Window::queryActiveWorkspace() {
|
|||||||
std::vector<Json::Value> visibleWindows;
|
std::vector<Json::Value> visibleWindows;
|
||||||
std::ranges::copy_if(workspaceWindows, std::back_inserter(visibleWindows),
|
std::ranges::copy_if(workspaceWindows, std::back_inserter(visibleWindows),
|
||||||
[&](const Json::Value& window) { return !window["hidden"].asBool(); });
|
[&](const Json::Value& window) { return !window["hidden"].asBool(); });
|
||||||
solo_ = 1 == std::count_if(visibleWindows.begin(), visibleWindows.end(),
|
solo_ = 1 == std::count_if(
|
||||||
|
visibleWindows.begin(), visibleWindows.end(),
|
||||||
[&](const Json::Value& window) { return !window["floating"].asBool(); });
|
[&](const Json::Value& window) { return !window["floating"].asBool(); });
|
||||||
allFloating_ = std::ranges::all_of(
|
allFloating_ = std::ranges::all_of(
|
||||||
visibleWindows, [&](const Json::Value& window) { return window["floating"].asBool(); });
|
visibleWindows, [&](const Json::Value& window) { return window["floating"].asBool(); });
|
||||||
|
|||||||
@@ -13,11 +13,11 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include "util/scoped_fd.hpp"
|
|
||||||
#include "giomm/datainputstream.h"
|
#include "giomm/datainputstream.h"
|
||||||
#include "giomm/dataoutputstream.h"
|
#include "giomm/dataoutputstream.h"
|
||||||
#include "giomm/unixinputstream.h"
|
#include "giomm/unixinputstream.h"
|
||||||
#include "giomm/unixoutputstream.h"
|
#include "giomm/unixoutputstream.h"
|
||||||
|
#include "util/scoped_fd.hpp"
|
||||||
|
|
||||||
namespace waybar::modules::niri {
|
namespace waybar::modules::niri {
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,12 @@
|
|||||||
#include <catch2/catch.hpp>
|
#include <catch2/catch.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
std::mutex reap_mtx;
|
std::mutex reap_mtx;
|
||||||
std::list<pid_t> reap;
|
std::list<pid_t> reap;
|
||||||
|
|||||||
Reference in New Issue
Block a user