From: Marcus Fritzsch Date: Mon, 4 Sep 2017 16:00:24 +0000 (+0200) Subject: App: cleanup requestSurface API method. X-Git-Tag: 4.99.1~138 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=371d55bbcdfe064e391b13b28eed800a57b4adf9;hp=304210e597abbc99117b1db03b96edf89c4069f6;p=staging%2Fwindowmanager.git App: cleanup requestSurface API method. * Use lookup_id(). * Do not call activate_surface() as the surface does not yet exist. Signed-off-by: Marcus Fritzsch --- diff --git a/src/app.cpp b/src/app.cpp index 89b3f29..527fe01 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -515,17 +515,17 @@ result App::request_surface(char const *drawing_name) { return Err("Drawing name does not match any role"); } - auto rname = this->id_alloc.lookup(drawing_name); + auto rname = this->lookup_id(drawing_name); if (!rname) { // name does not exist yet, allocate surface id... auto id = int(this->id_alloc.generate_id(drawing_name)); this->layers.add_surface(id, lid.value()); - // XXX: you should fix this! + // XXX: we set the main_surface[_name] here and now, + // not sure if we want this, but it worked so far. if (!this->layers.main_surface_name.empty() && this->layers.main_surface_name == drawing_name) { this->layers.main_surface = id; - this->activate_surface(drawing_name); logdebug("Set main_surface id to %u", id); } diff --git a/src/app.hpp b/src/app.hpp index 370c65d..79498c2 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -113,6 +113,7 @@ struct App { layouts_type layouts; layer_map layers; + // ID allocation and proxy methods for lookup struct id_allocator id_alloc; optional lookup_id(char const *name) { return this->id_alloc.lookup(std::string(name));