mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
remove getWindowData
This commit is contained in:
parent
9ee883ee1b
commit
f97c1c7136
@ -37,7 +37,6 @@ class Window : public waybar::ALabel, public EventHandler {
|
|||||||
|
|
||||||
auto getActiveWorkspace(const std::string&) -> Workspace;
|
auto getActiveWorkspace(const std::string&) -> Workspace;
|
||||||
auto getActiveWorkspace() -> Workspace;
|
auto getActiveWorkspace() -> Workspace;
|
||||||
auto getWindowData(const std::string& window_id) -> WindowData;
|
|
||||||
void onEvent(const std::string&) override;
|
void onEvent(const std::string&) override;
|
||||||
void queryActiveWorkspace();
|
void queryActiveWorkspace();
|
||||||
void setClass(const std::string&, bool enable);
|
void setClass(const std::string&, bool enable);
|
||||||
|
@ -122,19 +122,6 @@ auto Window::Workspace::parse(const Json::Value& value) -> Window::Workspace {
|
|||||||
value["lastwindowtitle"].asString()};
|
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 {
|
auto Window::WindowData::parse(const Json::Value& value) -> Window::WindowData {
|
||||||
return WindowData{value["floating"].asBool(), value["monitor"].asInt(),
|
return WindowData{value["floating"].asBool(), value["monitor"].asInt(),
|
||||||
value["class"].asString(), value["initialClass"].asString(),
|
value["class"].asString(), value["initialClass"].asString(),
|
||||||
|
Loading…
Reference in New Issue
Block a user