Implement support for startup notifications

This only sets up startup notifications for the 'exec' commands and directives.

Monitoring startups follows later.
This commit is contained in:
Michael Stapelberg
2011-10-09 18:21:59 +01:00
parent 2a29d9c2c1
commit b9db72dc8a
4 changed files with 43 additions and 0 deletions

View File

@ -22,6 +22,14 @@ xcb_connection_t *conn;
/* The screen (0 when you are using DISPLAY=:0) of the connection 'conn' */
int conn_screen;
/* Display handle for libstartup-notification */
SnDisplay *sndisplay;
/* The last timestamp we got from X11 (timestamps are included in some events
* and are used for some things, like determining a unique ID in startup
* notification). */
xcb_timestamp_t last_timestamp = XCB_CURRENT_TIME;
xcb_screen_t *root_screen;
xcb_window_t root;
uint8_t root_depth;
@ -362,6 +370,8 @@ int main(int argc, char *argv[]) {
if (xcb_connection_has_error(conn))
errx(EXIT_FAILURE, "Cannot open display\n");
sndisplay = sn_xcb_display_new(conn, NULL, NULL);
/* Initialize the libev event loop. This needs to be done before loading
* the config file because the parser will install an ev_child watcher
* for the nagbar when config errors are found. */