From aec40126b4335fbc39d0e1df220f11c21fd88f59 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 19 Mar 2010 22:40:43 +0100 Subject: [PATCH] ipc: implement output event --- docs/ipc | 14 ++++++++++++++ include/i3/ipc.h | 4 ++++ src/handlers.c | 2 ++ 3 files changed, 20 insertions(+) diff --git a/docs/ipc b/docs/ipc index 35a5fa03..5d70d7fe 100644 --- a/docs/ipc +++ b/docs/ipc @@ -260,6 +260,9 @@ workspace:: Sent when the user switches to a different workspace, when a new workspace is initialized or when a workspace is removed (because the last client vanished). +output:: + Sent when RandR issues a change notification (of either screens, + outputs, CRTCs or output properties). === workspace event @@ -272,6 +275,17 @@ This event consists of a single serialized map containing a property { "change": "focus" } --------------------- +=== output event + +This event consists of a single serialized map containing a property ++change (string)+ which indicates the type of the change (currently only +"unspecified"). + +*Example:* +--------------------------- +{ "change": "unspecified" } +--------------------------- + == See also For some languages, libraries are available (so you don’t have to implement diff --git a/include/i3/ipc.h b/include/i3/ipc.h index 56f22344..1ea39182 100644 --- a/include/i3/ipc.h +++ b/include/i3/ipc.h @@ -58,6 +58,10 @@ */ #define I3_IPC_EVENT_MASK (1 << 31) +/* The workspace event will be triggered upon changes in the workspace list */ #define I3_IPC_EVENT_WORKSPACE (I3_IPC_EVENT_MASK | 0) +/* The output event will be triggered upon changes in the output list */ +#define I3_IPC_EVENT_OUTPUT (I3_IPC_EVENT_MASK | 1) + #endif diff --git a/src/handlers.c b/src/handlers.c index b5c1cf1b..c2911942 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -447,6 +447,8 @@ int handle_screen_change(void *prophs, xcb_connection_t *conn, randr_query_outputs(conn); + ipc_send_event("output", I3_IPC_EVENT_OUTPUT, "{\"change\":\"unspecified\"}"); + return 1; } -- 2.39.5