Enable scaling
[apps/agl-service-windowmanager.git] / src / layers.cpp
index 30828dd..8698e83 100644 (file)
@@ -24,6 +24,9 @@
 
 namespace wm {
 
+const int default_main_width = 1080;
+const int default_main_height = 1920;
+
 using json = nlohmann::json;
 
 layer::layer(nlohmann::json const &j) {
@@ -77,7 +80,7 @@ struct result<struct layer_map> to_layer_map(nlohmann::json const &j) {
                            j.value("layer_id", -1), layer(j));
                      });
 
-      // XXX: add sanity checks here?
+      // TODO: add sanity checks here?
       // * check for double IDs
       // * check for double names/roles
 
@@ -104,6 +107,8 @@ struct result<struct layer_map> to_layer_map(nlohmann::json const &j) {
       auto msi = j.find("main_surface");
       if (msi != j.end()) {
          stl.main_surface_name = msi->value("surface_role", "");
+         stl.main_surface_width = msi->value("width", default_main_width);
+         stl.main_surface_height = msi->value("height", default_main_height);
          stl.main_surface = -1;
       }