-
Notifications
You must be signed in to change notification settings - Fork 6k
Improve the names of Flutter processes. #3819
Conversation
content_handler/app.cc
Outdated
| void App::UpdateProcessLabel() { | ||
| std::string label = base_label_; | ||
| if (controllers_.size() >= 2) { | ||
| label += " (+" + std::to_string(controllers_.size() - 1) + ")"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the label would overflow with the added part, I'd truncate the label to MX_MAX_NAME_LEN - suffix.size() - 3 and then append "..." + suffix. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also do that in the case where controllers_.size() < 2, but obviously suffix would be empty in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jinks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| if (controllers_.size() >= 2) { | ||
| label += " (+" + std::to_string(controllers_.size() - 1) + ")"; | ||
| } | ||
| mx::process::self().set_property(MX_PROP_NAME, label.c_str(), label.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The kernel will truncate the name at MX_MAX_NAME_LEN - 1. Maybe there should be logic to truncate the base_label_ rather that losing the number of additional apps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
93dd183 to
c6ae158
Compare
|
LGTM. Do you want to add this logic to //apps/dart_runner too? If not I can copy & paste it myself. |
c6ae158 to
62d1f94
Compare
|
Go for it :) |

No description provided.