From 1c2966e39c47e13c06610553f3d8b43f32718d15 Mon Sep 17 00:00:00 2001 From: notfound404 Date: Mon, 28 Jan 2019 10:55:46 +0100 Subject: [PATCH] Added the "primary" field for output. --- include/i3ipc++/ipc.hpp | 1 + src/ipc.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/i3ipc++/ipc.hpp b/include/i3ipc++/ipc.hpp index b66b38b..edbe6b4 100644 --- a/include/i3ipc++/ipc.hpp +++ b/include/i3ipc++/ipc.hpp @@ -54,6 +54,7 @@ struct workspace_t { struct output_t { std::string name; ///< Name of the output bool active; ///< Is the output currently active + bool primary; ///< Is the output the primary output std::string current_workspace; ///< Name of current workspace rect_t rect; ///< Size of the output }; diff --git a/src/ipc.cpp b/src/ipc.cpp index eeab110..b062ed3 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -169,12 +169,14 @@ static std::shared_ptr parse_output_from_json(const Json::Value& val return std::shared_ptr(); Json::Value name = value["name"]; Json::Value active = value["active"]; + Json::Value primary = value["primary"]; Json::Value current_workspace = value["current_workspace"]; Json::Value rect = value["rect"]; std::shared_ptr p (new output_t()); p->name = name.asString(); p->active = active.asBool(); + p->primary = primary.asBool(); p->current_workspace = (current_workspace.isNull() ? std::string() : current_workspace.asString()); p->rect = parse_rect_from_json(rect); return p;