Shipping all payload in window event

This commit is contained in:
Sergey Naumov
2016-04-24 10:47:31 +03:00
parent b94c465327
commit 61cd3686da
2 changed files with 25 additions and 11 deletions

View File

@@ -216,30 +216,35 @@ connection::connection(const std::string& socket_path) : m_main_socket(i3_conne
signal_mode_event.emit();
break;
case ET_WINDOW: {
WindowEventType type;
window_event_t ev;
Json::Value root;
IPC_JSON_READ(root);
std::string change = root["change"].asString();
if (change == "new") {
type = WindowEventType::NEW;
ev.type = WindowEventType::NEW;
} else if (change == "close") {
type = WindowEventType::CLOSE;
ev.type = WindowEventType::CLOSE;
} else if (change == "focus") {
type = WindowEventType::FOCUS;
ev.type = WindowEventType::FOCUS;
} else if (change == "title") {
type = WindowEventType::TITLE;
ev.type = WindowEventType::TITLE;
} else if (change == "fullscreen_mode") {
type = WindowEventType::FULLSCREEN_MODE;
ev.type = WindowEventType::FULLSCREEN_MODE;
} else if (change == "move") {
type = WindowEventType::MOVE;
ev.type = WindowEventType::MOVE;
} else if (change == "floating") {
type = WindowEventType::FLOATING;
ev.type = WindowEventType::FLOATING;
} else if (change == "urgent") {
type = WindowEventType::URGENT;
ev.type = WindowEventType::URGENT;
}
I3IPC_DEBUG("WINDOW " << change)
signal_window_event.emit(type);
Json::Value container = root["container"];
if (!container.isNull()) {
ev.container = parse_container_from_json(container);
}
signal_window_event.emit(ev);
break;
}
case ET_BARCONFIG_UPDATE: