summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libwindowmanager.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libwindowmanager.cpp b/src/libwindowmanager.cpp
index 5f0f5e5..19cef6e 100644
--- a/src/libwindowmanager.cpp
+++ b/src/libwindowmanager.cpp
@@ -392,10 +392,11 @@ int LibWindowmanager::Impl::getDisplayInfo(json_object *object) {
int w_px, h_px, w_mm, h_mm;
int rc = -1;
+ double scale;
/* send the request */
int rc2 =
this->api_call("GetDisplayInfo", nullptr,
- [&rc, &w_px, &h_px, &w_mm, &h_mm](bool ok, json_object *j) {
+ [&rc, &w_px, &h_px, &w_mm, &h_mm, &scale](bool ok, json_object *j) {
if (ok) {
json_object *val;
if (json_object_object_get_ex(j, "response", &val)) {
@@ -432,6 +433,14 @@ int LibWindowmanager::Impl::getDisplayInfo(json_object *object) {
return;
}
h_mm = json_object_get_int(j_h_mm);
+
+ json_object *j_scale = nullptr;
+ if (!json_object_object_get_ex(val, "scale", &j_scale)) {
+ HMI_DEBUG("libwm:", "Not found key \"scale\"");
+ scale = 1.0; // for backward compatibility
+ } else {
+ scale = json_object_get_double(j_scale);
+ }
rc = 0;
}
else {
@@ -458,6 +467,7 @@ int LibWindowmanager::Impl::getDisplayInfo(json_object *object) {
json_object_object_add(object, "height_pixel", json_object_new_int(h_px));
json_object_object_add(object, "width_mm", json_object_new_int(w_mm));
json_object_object_add(object, "height_mm", json_object_new_int(h_mm));
+ json_object_object_add(object, "scale", json_object_new_double(scale));
}
return rc;