summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libwindowmanager.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/libwindowmanager.cpp b/src/libwindowmanager.cpp
index 8e523b2..87a3988 100644
--- a/src/libwindowmanager.cpp
+++ b/src/libwindowmanager.cpp
@@ -838,19 +838,14 @@ void LibWindowmanager::Impl::event(char const *et, json_object *object) {
}
json_object *j_val;
std::string role = "";
- bool emit = false;
if(json_object_object_get_ex(object, g_kKeyDrawingName, &j_val)) {
role = json_object_get_string(j_val);
}
- if (this->labels.find(role) != this->labels.end()){
- emit = true;
- }
switch(oet.second) {
case Event_Active :
case Event_Inactive : {
bool active = ((oet.second == Event_Active) ? true : false);
- if(!emit) break;
if(this->_wmh.on_active) {
return this->_wmh.on_active(role.c_str(), active);
}
@@ -859,14 +854,13 @@ void LibWindowmanager::Impl::event(char const *et, json_object *object) {
case Event_Visible :
case Event_Invisible : {
bool visible = ((oet.second == Event_Visible) ? true : false);
- if(!emit) break;
if(this->_wmh.on_visible) {
return this->_wmh.on_visible(role.c_str(), visible);
}
break;
}
case Event_SyncDraw :
- if(this->_wmh.on_sync_draw && emit) {
+ if(this->_wmh.on_sync_draw) {
json_object_object_get_ex(object, g_kKeyDrawingArea, &j_val);
const char* area = json_object_get_string(j_val);
json_object *j_rect;
@@ -884,7 +878,7 @@ void LibWindowmanager::Impl::event(char const *et, json_object *object) {
}
break;
case Event_FlushDraw :
- if(this->_wmh.on_flush_draw && emit) {
+ if(this->_wmh.on_flush_draw) {
return this->_wmh.on_flush_draw(role.c_str());
}
break;
@@ -908,19 +902,7 @@ void LibWindowmanager::Impl::event(char const *et, json_object *object) {
auto i = this->handlers.find(oet.second);
if (i != this->handlers.end()) {
- json_object *val;
- const char *label;
- if (json_object_object_get_ex(object, g_kKeyDrawingName, &val)) {
- label = json_object_get_string(val);
- }
- else {
- i->second(object);
- return;
- }
-
- if (this->labels.find(label) != this->labels.end()) {
- i->second(object);
- }
+ i->second(object);
}
}