aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app.cpp5
-rw-r--r--src/applist.cpp13
-rw-r--r--src/applist.hpp7
-rw-r--r--src/wm_client.cpp2
-rw-r--r--src/wm_client.hpp1
-rw-r--r--src/wm_error.hpp1
6 files changed, 25 insertions, 4 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 7dbf397..64a1835 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -872,6 +872,11 @@ void App::api_activate_surface(char const *appid, char const *drawing_name, char
auto client = app_list->lookUpClient(id);
+ unsigned srfc = client->surfaceID(role);
+ if(srfc != INVALID_SURFACE_ID){
+ // remove floating surface
+ app_list->removeFloatingSurface(client->surfaceID(role));
+ }
/*
* Queueing Phase
*/
diff --git a/src/applist.cpp b/src/applist.cpp
index 5d7dce4..b5c1681 100644
--- a/src/applist.cpp
+++ b/src/applist.cpp
@@ -124,6 +124,19 @@ void AppList::addFloatingSurface(unsigned surface, unsigned pid)
this->floating_surfaces.push_back(fsurface);
}
+void AppList::removeFloatingSurface(unsigned surface)
+{
+ for (auto itr = this->floating_surfaces.begin(); itr != this->floating_surfaces.end(); ++itr)
+ {
+ if (surface == itr->surface_id)
+ {
+ HMI_DEBUG("wm", "Erase surface %d", itr->surface_id);
+ itr = this->floating_surfaces.erase(itr);
+ break;
+ }
+ }
+}
+
WMError AppList::appendRole(const std::string &id, const std::string &role, unsigned surface)
{
WMError wm_err = WMError::NO_ENTRY;
diff --git a/src/applist.hpp b/src/applist.hpp
index 23d6b5a..36134a2 100644
--- a/src/applist.hpp
+++ b/src/applist.hpp
@@ -51,11 +51,14 @@ class AppList
int countClient() const;
std::shared_ptr<WMClient> lookUpClient(const std::string &appid);
void removeSurface(unsigned surface);
- WMError popFloatingSurface(unsigned pid, unsigned *surface);
- WMError popFloatingSurface(const std::string &appid, unsigned *surface);
WMError appendRole(const std::string &appid, const std::string &role, unsigned surface);
+
+ // Floating surface & client control
void addFloatingClient(const std::string &appid, unsigned layer, const std::string &role);
void addFloatingSurface(unsigned surface, unsigned pid);
+ WMError popFloatingSurface(unsigned pid, unsigned *surface);
+ WMError popFloatingSurface(const std::string &appid, unsigned *surface);
+ void removeFloatingSurface(unsigned surface);
// Request Interface
unsigned
diff --git a/src/wm_client.cpp b/src/wm_client.cpp
index 6f1aa20..2194079 100644
--- a/src/wm_client.cpp
+++ b/src/wm_client.cpp
@@ -18,8 +18,6 @@
#include "wm_client.hpp"
#include "hmi-debug.h"
-#define INVALID_SURFACE_ID 0
-
using std::string;
using std::vector;
diff --git a/src/wm_client.hpp b/src/wm_client.hpp
index 5fa9444..fce323c 100644
--- a/src/wm_client.hpp
+++ b/src/wm_client.hpp
@@ -20,6 +20,7 @@
#include <vector>
#include <string>
#include <unordered_map>
+#include "wm_error.hpp"
extern "C"
{
diff --git a/src/wm_error.hpp b/src/wm_error.hpp
index 155d791..c314439 100644
--- a/src/wm_error.hpp
+++ b/src/wm_error.hpp
@@ -16,6 +16,7 @@
#ifndef WINDOW_MANAGER_ERROR
#define WINDOW_MANAGER_ERROR
+#define INVALID_SURFACE_ID 0
namespace wm {