[feat] remember remote display resolutions on mobile clients

This commit is contained in:
dijunkun
2026-11-11 15:26:04 +08:00
parent 23f48dc761
commit 25fb2a3d7f
15 changed files with 253 additions and 33 deletions
+4
View File
@@ -58,6 +58,10 @@ struct DisplayResolutionPreference {
DisplayResolution resolution;
};
// JSON-free boundary for native bridges that do not expose the JSON library.
bool ParseDisplayResolutionPreferences(
const std::string &text, std::vector<DisplayResolutionPreference> &result);
inline bool ValidDisplayResolutionPreference(
const DisplayResolutionPreference &preference) {
return !preference.display_key.empty() &&
+6
View File
@@ -138,6 +138,12 @@ char* DuplicateString(const std::string& value) {
} // namespace
bool ParseDisplayResolutionPreferences(
const std::string& text, std::vector<DisplayResolutionPreference>& result) {
return text.size() <= 65536 &&
ReadDisplayResolutionPreferences(json::parse(text, nullptr, false), result);
}
const char* HostPlatformName(HostPlatform platform) {
switch (platform) {
case HostPlatform::Windows: return "windows";