summaryrefslogtreecommitdiffstats
path: root/src/wm_client.hpp
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2019-01-29 13:18:17 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2019-02-04 19:54:01 +0900
commita0fa6394c0d8b7997343d6f2a44d9c2868f4be5f (patch)
tree33dee52eb43bfbf77fafbcecbe5e96a062179853 /src/wm_client.hpp
parentb72e372690e677c38fa9b5ae90fb7fbe5a575c76 (diff)
Fix top surface becomes invisible when background surface is crashed.
Fix top surface becomes invisible when surface on same layer, such like application layer, is crashed. To fix this issue, I refactored attaching app to layer. Originally, window manager attached app to surface. This patch is the backport of master branch. Bug-AGL : SPEC-1635 Change-Id: Ie6713e669a25662e8547aa7782551ddae60c7e01 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/wm_client.hpp')
-rw-r--r--src/wm_client.hpp47
1 files changed, 28 insertions, 19 deletions
diff --git a/src/wm_client.hpp b/src/wm_client.hpp
index 259d504..3ffa786 100644
--- a/src/wm_client.hpp
+++ b/src/wm_client.hpp
@@ -20,21 +20,17 @@
#include <vector>
#include <string>
#include <unordered_map>
+#include "util.hpp"
+#include "wm_error.hpp"
extern "C"
{
-#define AFB_BINDING_VERSION 2
#include <afb/afb-binding.h>
}
namespace wm
{
-enum WM_CLIENT_ERROR_EVENT
-{
- UNKNOWN_ERROR
-};
-
class WMClient
{
public:
@@ -42,35 +38,48 @@ class WMClient
WMClient(const std::string &appid, unsigned layer,
unsigned surface, const std::string &role);
WMClient(const std::string &appid, const std::string &role);
- virtual ~WMClient();
+ WMClient(const std::string &appid, unsigned layer, const std::string &role);
+ WMClient(const std::string &appid, unsigned layer,
+ const std::string& layer_name, unsigned surface, const std::string &role);
+ ~WMClient() = default;
std::string appID() const;
- unsigned surfaceID(const std::string &role) const;
+ std::string role() const;
unsigned layerID() const;
- std::string role(unsigned surface) const;
- void registerLayer(unsigned layer);
- bool addSurface(const std::string& role, unsigned surface);
+ unsigned surfaceID() const;
+ void registerSurface(unsigned surface);
+ std::string area() const {return this->app_area;};
+ void setArea(const std::string area) {this->app_area = area;}
+ WMError addSurface(unsigned surface);
+ bool isSourceSizeSet();
+ void setSurfaceSizeCorrectly();
bool removeSurfaceIfExist(unsigned surface);
- bool removeRole(const std::string& role);
-#if GTEST_ENABLED
- bool subscribe(afb_req req, const std::string &event_name);
- void emitError(WM_CLIENT_ERROR_EVENT ev);
-#endif
+ bool subscribe(afb_req_t req, const std::string &event_name);
+ void emitActive(bool active);
+ void emitVisible(bool visible);
+ void emitSyncDraw(const std::string& area, struct rect& r);
+ void emitFlushDraw();
+ void emitError(WMError error);
void dumpInfo();
private:
std::string id;
unsigned layer;
+ bool is_source_set;
+ std::string main_role;
+ std::string app_area;
+ unsigned surface; // currently, main application has only one surface.
+ //std::vector<std::string> role_list;
std::unordered_map<std::string, unsigned> role2surface;
#if GTEST_ENABLED
// This is for unit test. afb_make_event occurs sig11 if call not in afb-binding
- std::unordered_map<std::string, std::string> event2list;
+ std::unordered_map<std::string, std::string> evname2afb_event;
#else
- std::unordered_map<std::string, struct afb_event> event2list;
+ std::unordered_map<std::string, afb_event_t> evname2afb_event;
#endif
};
} // namespace wm
-#endif \ No newline at end of file
+#endif