From: Michael Stapelberg Date: Fri, 19 Mar 2010 21:40:43 +0000 (+0100) Subject: ipc: implement output event X-Git-Tag: 3.e~6^2~49 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aec40126b4335fbc39d0e1df220f11c21fd88f59;p=i3%2Fi3 ipc: implement output event --- 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; }