Added the "primary" field for output.

This commit is contained in:
notfound404
2019-01-28 10:55:46 +01:00
parent e5492ab3a6
commit 1c2966e39c
2 changed files with 3 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ struct workspace_t {
struct output_t { struct output_t {
std::string name; ///< Name of the output std::string name; ///< Name of the output
bool active; ///< Is the output currently active bool active; ///< Is the output currently active
bool primary; ///< Is the output the primary output
std::string current_workspace; ///< Name of current workspace std::string current_workspace; ///< Name of current workspace
rect_t rect; ///< Size of the output rect_t rect; ///< Size of the output
}; };

View File

@@ -169,12 +169,14 @@ static std::shared_ptr<output_t> parse_output_from_json(const Json::Value& val
return std::shared_ptr<output_t>(); return std::shared_ptr<output_t>();
Json::Value name = value["name"]; Json::Value name = value["name"];
Json::Value active = value["active"]; Json::Value active = value["active"];
Json::Value primary = value["primary"];
Json::Value current_workspace = value["current_workspace"]; Json::Value current_workspace = value["current_workspace"];
Json::Value rect = value["rect"]; Json::Value rect = value["rect"];
std::shared_ptr<output_t> p (new output_t()); std::shared_ptr<output_t> p (new output_t());
p->name = name.asString(); p->name = name.asString();
p->active = active.asBool(); p->active = active.asBool();
p->primary = primary.asBool();
p->current_workspace = (current_workspace.isNull() ? std::string() : current_workspace.asString()); p->current_workspace = (current_workspace.isNull() ? std::string() : current_workspace.asString());
p->rect = parse_rect_from_json(rect); p->rect = parse_rect_from_json(rect);
return p; return p;