From f97c1c7136528798f17f5f1b621e41ae46d66aaf Mon Sep 17 00:00:00 2001 From: MisterPine Date: Sat, 8 Jul 2023 23:22:29 +0200 Subject: [PATCH] remove getWindowData --- include/modules/hyprland/window.hpp | 1 - src/modules/hyprland/window.cpp | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/include/modules/hyprland/window.hpp b/include/modules/hyprland/window.hpp index 3f9b89bf..44253e1f 100644 --- a/include/modules/hyprland/window.hpp +++ b/include/modules/hyprland/window.hpp @@ -37,7 +37,6 @@ class Window : public waybar::ALabel, public EventHandler { auto getActiveWorkspace(const std::string&) -> Workspace; auto getActiveWorkspace() -> Workspace; - auto getWindowData(const std::string& window_id) -> WindowData; void onEvent(const std::string&) override; void queryActiveWorkspace(); void setClass(const std::string&, bool enable); diff --git a/src/modules/hyprland/window.cpp b/src/modules/hyprland/window.cpp index 01f672a4..7fc7fe28 100644 --- a/src/modules/hyprland/window.cpp +++ b/src/modules/hyprland/window.cpp @@ -122,19 +122,6 @@ auto Window::Workspace::parse(const Json::Value& value) -> Window::Workspace { value["lastwindowtitle"].asString()}; } -auto Window::getWindowData(const std::string& window_address) -> WindowData { - const auto clients = gIPC->getSocket1JsonReply("clients"); - assert(clients.isArray()); - auto window = std::find_if(clients.begin(), clients.end(), [&](Json::Value window) { - return window["address"] == window_address; - }); - if (window == std::end(clients)) { - spdlog::warn("No client with address {}", window_address); - return WindowData{false, -1, "", "", "", ""}; - } - return WindowData::parse(*window); -} - auto Window::WindowData::parse(const Json::Value& value) -> Window::WindowData { return WindowData{value["floating"].asBool(), value["monitor"].asInt(), value["class"].asString(), value["initialClass"].asString(),