mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-11-11 19:07:33 +08:00
[feat] remember remote display resolutions on mobile clients
This commit is contained in:
@@ -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() &&
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user