feat: Enhance widget discovery with telemetry data and improve output formatting
This commit is contained in:
@@ -519,11 +519,19 @@ absl::StatusOr<DiscoverWidgetsResult> GuiAutomationClient::DiscoverWidgets(
|
||||
widget.suggested_action = widget_proto.suggested_action();
|
||||
widget.visible = widget_proto.visible();
|
||||
widget.enabled = widget_proto.enabled();
|
||||
widget.bounds.min_x = widget_proto.bounds().min_x();
|
||||
widget.bounds.min_y = widget_proto.bounds().min_y();
|
||||
widget.bounds.max_x = widget_proto.bounds().max_x();
|
||||
widget.bounds.max_y = widget_proto.bounds().max_y();
|
||||
widget.has_bounds = widget_proto.has_bounds();
|
||||
if (widget.has_bounds) {
|
||||
widget.bounds.min_x = widget_proto.bounds().min_x();
|
||||
widget.bounds.min_y = widget_proto.bounds().min_y();
|
||||
widget.bounds.max_x = widget_proto.bounds().max_x();
|
||||
widget.bounds.max_y = widget_proto.bounds().max_y();
|
||||
} else {
|
||||
widget.bounds = WidgetBoundingBox();
|
||||
}
|
||||
widget.widget_id = widget_proto.widget_id();
|
||||
widget.last_seen_frame = widget_proto.last_seen_frame();
|
||||
widget.last_seen_at = OptionalTimeFromMillis(widget_proto.last_seen_at_ms());
|
||||
widget.stale = widget_proto.stale();
|
||||
window_info.widgets.push_back(std::move(widget));
|
||||
}
|
||||
|
||||
|
||||
@@ -152,6 +152,10 @@ struct WidgetDescriptor {
|
||||
bool enabled = true;
|
||||
WidgetBoundingBox bounds;
|
||||
uint32_t widget_id = 0;
|
||||
bool has_bounds = false;
|
||||
int64_t last_seen_frame = -1;
|
||||
std::optional<absl::Time> last_seen_at;
|
||||
bool stale = false;
|
||||
};
|
||||
|
||||
struct DiscoveredWindowInfo {
|
||||
|
||||
Reference in New Issue
Block a user