diff --git a/include/i3ipc++/ipc.hpp b/include/i3ipc++/ipc.hpp index 7d656f8..b4c82f9 100644 --- a/include/i3ipc++/ipc.hpp +++ b/include/i3ipc++/ipc.hpp @@ -271,10 +271,21 @@ public: void handle_event(); /** - * Get the file descriptor associated to i3. - * @return the file descriptor associated to i3, -1 if not created yet. + * Get the fd of the main socket + * @return the file descriptor of the main socket. */ - int32_t get_file_descriptor(); + int32_t get_main_socket_fd(); + + /** + * Get the fd of the event socket + * @return the file descriptor of the event socket. + */ + int32_t get_event_socket_fd(); + + /** + * @deprecated Use get_event_socket() instead + */ + int32_t get_file_descriptor(); sigc::signal signal_workspace_event; ///< Workspace event signal sigc::signal signal_output_event; ///< Output event signal diff --git a/src/ipc.cpp b/src/ipc.cpp index 59a4723..a1c3f72 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -470,7 +470,12 @@ bool connection::send_command(const std::string& command) const { #undef i3IPC_TYPE_STR } +int32_t connection::get_main_socket_fd() { return m_main_socket; } + +int32_t connection::get_event_socket_fd() { return m_event_socket; } + int32_t connection::get_file_descriptor() { + I3IPC_WARN("connection::get_file_descriptor() is DEPRECATED") return m_event_socket; }