Shipping all payload in window event
This commit is contained in:
@@ -164,6 +164,15 @@ struct workspace_event_t {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A window event
|
||||||
|
*/
|
||||||
|
struct window_event_t {
|
||||||
|
WindowEventType type;
|
||||||
|
std::shared_ptr<container_t> container; ///< A container event associated with @note With some WindowEventType could be null
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@@ -245,7 +254,7 @@ public:
|
|||||||
sigc::signal<void, const workspace_event_t&> signal_workspace_event; ///< Workspace event signal
|
sigc::signal<void, const workspace_event_t&> signal_workspace_event; ///< Workspace event signal
|
||||||
sigc::signal<void> signal_output_event; ///< Output event signal
|
sigc::signal<void> signal_output_event; ///< Output event signal
|
||||||
sigc::signal<void> signal_mode_event; ///< Output mode event signal
|
sigc::signal<void> signal_mode_event; ///< Output mode event signal
|
||||||
sigc::signal<void, WindowEventType> signal_window_event; ///< Window event signal
|
sigc::signal<void, const window_event_t&> signal_window_event; ///< Window event signal
|
||||||
sigc::signal<void> signal_barconfig_update_event; ///< Barconfig update event signal
|
sigc::signal<void> signal_barconfig_update_event; ///< Barconfig update event signal
|
||||||
sigc::signal<void, EventType, const std::shared_ptr<const buf_t>&> signal_event; ///< i3 event signal @note Default handler routes event to signal according to type
|
sigc::signal<void, EventType, const std::shared_ptr<const buf_t>&> signal_event; ///< i3 event signal @note Default handler routes event to signal according to type
|
||||||
private:
|
private:
|
||||||
|
|||||||
25
src/ipc.cpp
25
src/ipc.cpp
@@ -216,30 +216,35 @@ connection::connection(const std::string& socket_path) : m_main_socket(i3_conne
|
|||||||
signal_mode_event.emit();
|
signal_mode_event.emit();
|
||||||
break;
|
break;
|
||||||
case ET_WINDOW: {
|
case ET_WINDOW: {
|
||||||
WindowEventType type;
|
window_event_t ev;
|
||||||
Json::Value root;
|
Json::Value root;
|
||||||
IPC_JSON_READ(root);
|
IPC_JSON_READ(root);
|
||||||
std::string change = root["change"].asString();
|
std::string change = root["change"].asString();
|
||||||
if (change == "new") {
|
if (change == "new") {
|
||||||
type = WindowEventType::NEW;
|
ev.type = WindowEventType::NEW;
|
||||||
} else if (change == "close") {
|
} else if (change == "close") {
|
||||||
type = WindowEventType::CLOSE;
|
ev.type = WindowEventType::CLOSE;
|
||||||
} else if (change == "focus") {
|
} else if (change == "focus") {
|
||||||
type = WindowEventType::FOCUS;
|
ev.type = WindowEventType::FOCUS;
|
||||||
} else if (change == "title") {
|
} else if (change == "title") {
|
||||||
type = WindowEventType::TITLE;
|
ev.type = WindowEventType::TITLE;
|
||||||
} else if (change == "fullscreen_mode") {
|
} else if (change == "fullscreen_mode") {
|
||||||
type = WindowEventType::FULLSCREEN_MODE;
|
ev.type = WindowEventType::FULLSCREEN_MODE;
|
||||||
} else if (change == "move") {
|
} else if (change == "move") {
|
||||||
type = WindowEventType::MOVE;
|
ev.type = WindowEventType::MOVE;
|
||||||
} else if (change == "floating") {
|
} else if (change == "floating") {
|
||||||
type = WindowEventType::FLOATING;
|
ev.type = WindowEventType::FLOATING;
|
||||||
} else if (change == "urgent") {
|
} else if (change == "urgent") {
|
||||||
type = WindowEventType::URGENT;
|
ev.type = WindowEventType::URGENT;
|
||||||
}
|
}
|
||||||
I3IPC_DEBUG("WINDOW " << change)
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case ET_BARCONFIG_UPDATE:
|
case ET_BARCONFIG_UPDATE:
|
||||||
|
|||||||
Reference in New Issue
Block a user