aboutsummaryrefslogtreecommitdiff
path: root/i3-config-wizard
diff options
context:
space:
mode:
authorOrestis Floros <orestisf1993@gmail.com>2018-08-25 14:48:14 +0300
committerOrestis Floros <orestisf1993@gmail.com>2018-08-25 14:54:16 +0300
commitbf1cb39b4b85911e83e961f27367f3e91428ce73 (patch)
treee6d80093553b743e58af75b3580e72c76ccac56f /i3-config-wizard
parenta8b90317a0a20fb061ce97d73a7df4268cdd49d6 (diff)
downloadi3-bf1cb39b4b85911e83e961f27367f3e91428ce73.tar.gz
i3-bf1cb39b4b85911e83e961f27367f3e91428ce73.zip
Support startup-notification in i3-nagbar & i3-config-wizard
The default i3 config uses the `exec` command without `--no-startup-id` to launch: 1. i3-nagbar https://github.com/i3/i3/blob/4cba9fcbdab1487459014dbf8882f5f34e61435e/etc/config#L150 2. i3-config-wizard https://github.com/i3/i3/blob/4cba9fcbdab1487459014dbf8882f5f34e61435e/etc/config#L194 A user that opens i3 for the first time will be greeted with a "loading" cursor because of i3-config-wizard.
Diffstat (limited to 'i3-config-wizard')
-rw-r--r--i3-config-wizard/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/i3-config-wizard/main.c b/i3-config-wizard/main.c
index 0e0a3e65..013d1053 100644
--- a/i3-config-wizard/main.c
+++ b/i3-config-wizard/main.c
@@ -48,6 +48,9 @@
#include <xkbcommon/xkbcommon.h>
#include <xkbcommon/xkbcommon-x11.h>
+#define SN_API_NOT_YET_FROZEN 1
+#include <libsn/sn-launchee.h>
+
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <X11/XKBlib.h>
@@ -847,6 +850,10 @@ int main(int argc, char *argv[]) {
#include "atoms.xmacro"
#undef xmacro
+ /* Init startup notification. */
+ SnDisplay *sndisplay = sn_xcb_display_new(conn, NULL, NULL);
+ SnLauncheeContext *sncontext = sn_launchee_context_new_from_environment(sndisplay, screen);
+
root_screen = xcb_aux_get_screen(conn, screen);
root = root_screen->root;
@@ -879,6 +886,7 @@ int main(int argc, char *argv[]) {
0, /* back pixel: black */
XCB_EVENT_MASK_EXPOSURE |
XCB_EVENT_MASK_BUTTON_PRESS});
+ sn_launchee_context_setup_window(sncontext, win);
/* Map the window (make it visible) */
xcb_map_window(conn, win);
@@ -940,6 +948,11 @@ int main(int argc, char *argv[]) {
exit(-1);
}
+ /* Startup complete. */
+ sn_launchee_context_complete(sncontext);
+ sn_launchee_context_unref(sncontext);
+ sn_display_unref(sndisplay);
+
xcb_flush(conn);
xcb_generic_event_t *event;