Skip to content

Commit 9200419

Browse files
authored
Merge pull request #24 from notfound4/dev
Added the "primary" field for output.
2 parents e5492ab + 1c2966e commit 9200419

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

include/i3ipc++/ipc.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ struct workspace_t {
5454
struct output_t {
5555
std::string name; ///< Name of the output
5656
bool active; ///< Is the output currently active
57+
bool primary; ///< Is the output the primary output
5758
std::string current_workspace; ///< Name of current workspace
5859
rect_t rect; ///< Size of the output
5960
};

src/ipc.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,14 @@ static std::shared_ptr<output_t> parse_output_from_json(const Json::Value& val
169169
return std::shared_ptr<output_t>();
170170
Json::Value name = value["name"];
171171
Json::Value active = value["active"];
172+
Json::Value primary = value["primary"];
172173
Json::Value current_workspace = value["current_workspace"];
173174
Json::Value rect = value["rect"];
174175

175176
std::shared_ptr<output_t> p (new output_t());
176177
p->name = name.asString();
177178
p->active = active.asBool();
179+
p->primary = primary.asBool();
178180
p->current_workspace = (current_workspace.isNull() ? std::string() : current_workspace.asString());
179181
p->rect = parse_rect_from_json(rect);
180182
return p;

0 commit comments

Comments
 (0)