Fix for switching from half size to full size 51/13251/2
authorYuta Doi <yuta-d@witz-inc.co.jp>
Fri, 19 Jan 2018 08:00:42 +0000 (17:00 +0900)
committerYuta Doi <yuta-d@witz-inc.co.jp>
Fri, 19 Jan 2018 08:19:14 +0000 (08:19 +0000)
This patch is for eel only
because wayland-ivi-extension 2.x will be used in master.

According to the modification of wayland-ivi-extension 1.13,
WindowManager is fixed for correct switching from half size to full size.

Related commit:
https://gerrit.automotivelinux.org/gerrit/#/c/12399/

Bug-AGL: SPEC-986

Change-Id: If8fdae2206aa138f788d6c0929ab533c4123f153
Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
layers.json.split
src/app.cpp
src/wayland.cpp
src/wayland.hpp

index f83ac6b..91e563d 100644 (file)
@@ -7,6 +7,13 @@
    },
 
    "mappings": [
+      {
+         "role": "BackGroundLayer",
+         "name": "BackGroundLayer",
+         "layer_id": 999,
+         "area": { "type": "rect", "rect": { "x": 0, "y": 218, "width": -1, "height": -433 } },
+         "comment": "Single BackGround layer map for the Navigation, Radio and MediaPlayer"
+      },
       {
          "role": "^HomeScreen$",
          "name": "HomeScreen",
@@ -15,7 +22,7 @@
          "comment": "Single layer map for the HomeScreen"
       },
       {
-         "role": "MediaPlayer|Radio|Phone|Navigation|HVAC|Settings|Dashboard|POI|Mixer",
+         "role": "Music|Video|WebBrowser|MediaPlayer|Radio|Phone|Navigation|HVAC|Settings|Dashboard|POI|Mixer",
          "name": "apps",
          "layer_id": 1001,
          "area": { "type": "rect", "rect": { "x": 0, "y": 218, "width": -1, "height": -433 } },
index 254214e..838908c 100644 (file)
@@ -290,10 +290,6 @@ void App::surface_set_layout(int surface_id, optional<int> sub_surface_id) {
       HMI_DEBUG("wm", "surface_set_layout for sub surface %u on layer %u",
                *sub_surface_id, layer_id);
 
-      // configure surface to wxh dimensions
-      ss->set_configuration(w, h);
-      // set source reactangle, even if we should not need to set it.
-      ss->set_source_rectangle(0, 0, w, h);
       // set destination to the display rectangle
       ss->set_destination_rectangle(x + x_off, y + y_off, w, h);
 
@@ -302,11 +298,6 @@ void App::surface_set_layout(int surface_id, optional<int> sub_surface_id) {
    HMI_DEBUG("wm", "surface_set_layout for surface %u on layer %u", surface_id,
             layer_id);
 
-   // configure surface to wxh dimensions
-   s->set_configuration(w, h);
-   // set source reactangle, even if we should not need to set it.
-   s->set_source_rectangle(0, 0, w, h);
-
    // set destination to the display rectangle
    s->set_destination_rectangle(x, y, w, h);
 
@@ -382,14 +373,6 @@ char const *App::api_activate_surface(char const *drawing_name, char const *draw
             // Commit for configuraton
             this->layout_commit();
 
-            if (!(layer->is_normal_layout_only)) {
-               // Wait for configuration listener
-               controller->is_configured = false;
-               while (!(controller->is_configured)) {
-                  dispatch_pending_events();
-               }
-            }
-
             std::string str_area = std::string(kNameLayoutNormal) + "." + std::string(kNameAreaFull);
             this->emit_syncdraw(drawing_name, str_area.c_str());
             this->enqueue_flushdraw(state.main);
@@ -423,15 +406,9 @@ char const *App::api_activate_surface(char const *drawing_name, char const *draw
                   }
                   state = nl;
 
-                  // Commit for configuraton and visibility(0)
+                  // Commit for configuration and visibility(0)
                   this->layout_commit();
 
-                  // Wait for configuration listener
-                  controller->is_configured = false;
-                  while (!(controller->is_configured)) {
-                     dispatch_pending_events();
-                  }
-
                   std::string str_area_main = std::string(kNameLayoutSplit) + "." + std::string(kNameAreaMain);
                   std::string str_area_sub = std::string(kNameLayoutSplit) + "." + std::string(kNameAreaSub);
                   this->emit_syncdraw(main.c_str(), str_area_main.c_str());
@@ -458,14 +435,6 @@ char const *App::api_activate_surface(char const *drawing_name, char const *draw
                   // Commit for configuraton and visibility(0)
                   this->layout_commit();
 
-                  if (!(layer->is_normal_layout_only)) {
-                     // Wait for configuration listener
-                     controller->is_configured = false;
-                     while (!(controller->is_configured)) {
-                        dispatch_pending_events();
-                     }
-                  }
-
                   std::string str_area = std::string(kNameLayoutNormal) + "." + std::string(kNameAreaFull);
                   this->emit_syncdraw(drawing_name, str_area.c_str());
                   this->enqueue_flushdraw(state.main);
index 53668d2..9e7408c 100644 (file)
@@ -226,6 +226,9 @@ void controller::layer_create(uint32_t id, int32_t w, int32_t h) {
 
 void controller::surface_create(uint32_t id) {
    this->surfaces[id] = std::make_unique<struct surface>(id, this);
+
+   // configure surface to wxh dimensions
+   this->surfaces[id]->set_configuration(this->output_size.w, this->output_size.h);
 }
 
 void controller::controller_screen(uint32_t id,
@@ -251,6 +254,9 @@ void controller::controller_surface(uint32_t id) {
    if (this->surfaces.find(id) == this->surfaces.end()) {
       this->surfaces[id] = std::make_unique<struct surface>(id, this);
       this->chooks->surface_created(id);
+
+      // configure surface to wxh dimensions
+      this->surfaces[id]->set_configuration(this->output_size.w, this->output_size.h);
    }
 }
 
@@ -628,7 +634,6 @@ void controller::surface_configuration(struct surface *s, int32_t width,
    HMI_DEBUG("wm", "compositor::surface %s @ %d w %i h %i", __func__, s->id,
             width, height);
    this->sprops[s->id].size = size{uint32_t(width), uint32_t(height)};
-   is_configured = true;
 }
 
 void controller::surface_orientation(struct surface *s, int32_t orientation) {
index 59d7ade..619e47a 100644 (file)
@@ -254,8 +254,6 @@ struct controller : public wayland_proxy<struct ivi_controller> {
 
    wm::controller_hooks *chooks;
 
-   bool is_configured;
-
    void add_proxy_to_id_mapping(struct ivi_controller_surface *p, uint32_t id);
    void remove_proxy_to_id_mapping(struct ivi_controller_surface *p);
    void add_proxy_to_id_mapping(struct ivi_controller_layer *p, uint32_t id);