Skip to content

Commit

Permalink
#1616 add query property
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Mar 12, 2024
1 parent 6489793 commit 07f9aec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Added new command `space --switch ..` to focus a space (substitute with current focus) regardless of its display [#549](https://github.com/koekeishiya/yabai/issues/549)
- Added new command `config display_arrangement_order ..` to change how yabai interprets arrangement indices used to select displays [#550](https://github.com/koekeishiya/yabai/issues/550)
- Added new command `display --label ..` and display query property `label` (works like space labels) [#1616](https://github.com/koekeishiya/yabai/issues/1616)
- Added display query property `has-focus` [#1616](https://github.com/koekeishiya/yabai/issues/1616)

### Changed
- Preserve relative space ordering when moving spaces to other displays [#2114](https://github.com/koekeishiya/yabai/issues/2114)
Expand Down
3 changes: 2 additions & 1 deletion doc/yabai.1
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,8 @@ DISPLAY
"w": number,
"h": number
},
"spaces": array of number
"spaces": array of number,
"has\-focus": bool
}
.fam
.fi
Expand Down
3 changes: 2 additions & 1 deletion doc/yabai.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ DISPLAY
"w": number,
"h": number
},
"spaces": array of number
"spaces": array of number,
"has-focus": bool
}
----

Expand Down
6 changes: 4 additions & 2 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ void display_serialize(FILE *rsp, uint32_t did)
"\t\"index\":%d,\n"
"\t\"label\":\"%s\",\n"
"\t\"frame\":{\n\t\t\"x\":%.4f,\n\t\t\"y\":%.4f,\n\t\t\"w\":%.4f,\n\t\t\"h\":%.4f\n\t},\n"
"\t\"spaces\":[%s]\n"
"\t\"spaces\":[%s],\n"
"\t\"has-focus\":%s\n"
"}",
did,
uuid ? uuid : "<unknown>",
display_manager_display_id_arrangement(did),
display_label ? display_label->label : "",
frame.origin.x, frame.origin.y, frame.size.width, frame.size.height,
buffer);
buffer,
json_bool(did == g_display_manager.current_display_id));
}

CFStringRef display_uuid(uint32_t did)
Expand Down

0 comments on commit 07f9aec

Please sign in to comment.