mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 15:45:59 +01:00
hyprctl: add missing json string escapes (#5811)
This commit is contained in:
parent
62ae2b3f40
commit
801437cd54
1 changed files with 9 additions and 8 deletions
|
@ -107,9 +107,10 @@ std::string monitorsRequest(eHyprCtlOutputFormat format, std::string request) {
|
||||||
"currentFormat": "{}",
|
"currentFormat": "{}",
|
||||||
"availableModes": [{}]
|
"availableModes": [{}]
|
||||||
}},)#",
|
}},)#",
|
||||||
m->ID, escapeJSONStrings(m->szName), escapeJSONStrings(m->szShortDescription), (m->output->make ? m->output->make : ""), (m->output->model ? m->output->model : ""),
|
m->ID, escapeJSONStrings(m->szName), escapeJSONStrings(m->szShortDescription), escapeJSONStrings(m->output->make ? m->output->make : ""),
|
||||||
(m->output->serial ? m->output->serial : ""), (int)m->vecPixelSize.x, (int)m->vecPixelSize.y, m->refreshRate, (int)m->vecPosition.x, (int)m->vecPosition.y,
|
escapeJSONStrings(m->output->model ? m->output->model : ""), escapeJSONStrings(m->output->serial ? m->output->serial : ""), (int)m->vecPixelSize.x,
|
||||||
m->activeWorkspaceID(), (!m->activeWorkspace ? "" : escapeJSONStrings(m->activeWorkspace->m_szName)), m->activeSpecialWorkspaceID(),
|
(int)m->vecPixelSize.y, m->refreshRate, (int)m->vecPosition.x, (int)m->vecPosition.y, m->activeWorkspaceID(),
|
||||||
|
(!m->activeWorkspace ? "" : escapeJSONStrings(m->activeWorkspace->m_szName)), m->activeSpecialWorkspaceID(),
|
||||||
escapeJSONStrings(m->activeSpecialWorkspace ? m->activeSpecialWorkspace->m_szName : ""), (int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y,
|
escapeJSONStrings(m->activeSpecialWorkspace ? m->activeSpecialWorkspace->m_szName : ""), (int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y,
|
||||||
(int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y, m->scale, (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "true" : "false"),
|
(int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y, m->scale, (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "true" : "false"),
|
||||||
(m->dpmsStatus ? "true" : "false"), (m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED ? "true" : "false"),
|
(m->dpmsStatus ? "true" : "false"), (m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED ? "true" : "false"),
|
||||||
|
@ -595,7 +596,7 @@ std::string devicesRequest(eHyprCtlOutputFormat format, std::string request) {
|
||||||
"address": "0x{:x}",
|
"address": "0x{:x}",
|
||||||
"name": "{}"
|
"name": "{}"
|
||||||
}},)#",
|
}},)#",
|
||||||
(uintptr_t)&d, d.name);
|
(uintptr_t)&d, escapeJSONStrings(d.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
trimTrailingComma(result);
|
trimTrailingComma(result);
|
||||||
|
@ -609,7 +610,7 @@ std::string devicesRequest(eHyprCtlOutputFormat format, std::string request) {
|
||||||
"address": "0x{:x}",
|
"address": "0x{:x}",
|
||||||
"name": "{}"
|
"name": "{}"
|
||||||
}},)#",
|
}},)#",
|
||||||
(uintptr_t)&d, d.pWlrDevice ? d.pWlrDevice->name : "");
|
(uintptr_t)&d, escapeJSONStrings(d.pWlrDevice ? d.pWlrDevice->name : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
trimTrailingComma(result);
|
trimTrailingComma(result);
|
||||||
|
@ -694,8 +695,8 @@ std::string animationsRequest(eHyprCtlOutputFormat format, std::string request)
|
||||||
"speed": {:.2f},
|
"speed": {:.2f},
|
||||||
"style": "{}"
|
"style": "{}"
|
||||||
}},)#",
|
}},)#",
|
||||||
ac.first, ac.second.overridden ? "true" : "false", ac.second.internalBezier, ac.second.internalEnabled ? "true" : "false", ac.second.internalSpeed,
|
ac.first, ac.second.overridden ? "true" : "false", escapeJSONStrings(ac.second.internalBezier), ac.second.internalEnabled ? "true" : "false",
|
||||||
ac.second.internalStyle);
|
ac.second.internalSpeed, escapeJSONStrings(ac.second.internalStyle));
|
||||||
}
|
}
|
||||||
|
|
||||||
ret[ret.length() - 1] = ']';
|
ret[ret.length() - 1] = ']';
|
||||||
|
@ -707,7 +708,7 @@ std::string animationsRequest(eHyprCtlOutputFormat format, std::string request)
|
||||||
{{
|
{{
|
||||||
"name": "{}"
|
"name": "{}"
|
||||||
}},)#",
|
}},)#",
|
||||||
bz.first);
|
escapeJSONStrings(bz.first));
|
||||||
}
|
}
|
||||||
|
|
||||||
trimTrailingComma(ret);
|
trimTrailingComma(ret);
|
||||||
|
|
Loading…
Reference in a new issue