aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-11-27 14:56:50 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-11-27 14:56:50 +0100
commit0a98360c38431ccea2679955dd0e43af129d0256 (patch)
tree53331240059fc8d660d869192001cd159b97506a
parent7fb167a27e9e12ef38c5942cf73679bff12a5b25 (diff)
Draft: Allow XDG to be displayed.
Change-Id: I962ae2f35ce8af6c4459982b4e8a1e25e9238252 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--layers.json7
-rw-r--r--src/app.cpp17
-rw-r--r--src/app.hpp2
3 files changed, 24 insertions, 2 deletions
diff --git a/layers.json b/layers.json
index 98d69e0..bf0a6f9 100644
--- a/layers.json
+++ b/layers.json
@@ -22,6 +22,13 @@
"comment": "Range of IDs that will always be placed on layer 1001, negative rect values are interpreted as output_size.dimension - $value"
},
{
+ "role": "^XDG$",
+ "name": "xdg-apps",
+ "layer_id": 1002,
+ "area": { "type": "rect", "rect": { "x": 0, "y": 218, "width": -1, "height": -433 } },
+ "comment": "Range of IDs dedicated for XDG apps that will always be placed on layer 1002, negative rect values are interpreted as output_size.dimension - $value"
+ },
+ {
"role": "^OnScreen.*",
"name": "popups",
"layer_id": 9999,
diff --git a/src/app.cpp b/src/app.cpp
index 307217e..324825f 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -596,9 +596,22 @@ void App::api_ping() { this->dispatch_pending_events(); }
void App::surface_created(uint32_t surface_id) {
auto layer_id = this->layers.get_layer_id(surface_id);
if (!layer_id) {
- HMI_DEBUG("wm", "Newly created surfce %d is not associated with any layer!",
+ HMI_DEBUG("wm", "Newly created surface %d is not associated with any layer! Must be a XDG apps",
surface_id);
- return;
+ auto layer_id = this->layers.get_layer_id(XDG_DRAWING_NAME);
+ if(!layer_id)
+ {
+ HMI_DEBUG("wm", "No role found for that XDG App");
+ return;
+ }
+
+ this->layers.add_surface(surface_id, *layer_id);
+ // set the main_surface[_name] here and now
+ if (!this->layers.main_surface_name.empty() &&
+ this->layers.main_surface_name == XDG_DRAWING_NAME) {
+ this->layers.main_surface = surface_id;
+ HMI_DEBUG("wm", "Set main_surface id to %u", surface_id);
+ }
}
HMI_DEBUG("wm", "surface_id is %u, layer_id is %u", surface_id, *layer_id);
diff --git a/src/app.hpp b/src/app.hpp
index 413d1c9..41642c1 100644
--- a/src/app.hpp
+++ b/src/app.hpp
@@ -35,6 +35,8 @@
#include "wayland.hpp"
#include "hmi-debug.h"
+#define XDG_DRAWING_NAME "XDG"
+
namespace wl {
struct display;
}