Codebase list i3-gaps / bf1cb39
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. Orestis Floros 5 years ago
3 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
356356
357357 i3_nagbar_i3_nagbar_CFLAGS = \
358358 $(AM_CFLAGS) \
359 $(LIBSN_CFLAGS) \
359360 $(libi3_CFLAGS)
360361
361362 i3_nagbar_i3_nagbar_LDADD = \
362363 $(libi3_LIBS) \
364 $(LIBSN_LIBS) \
363365 $(XCB_UTIL_CURSOR_LIBS)
364366
365367 i3_nagbar_i3_nagbar_SOURCES = \
413415 i3_config_wizard_i3_config_wizard_CFLAGS = \
414416 $(AM_CFLAGS) \
415417 $(libi3_CFLAGS) \
418 $(LIBSN_CFLAGS) \
416419 $(XKBCOMMON_CFLAGS)
417420
418421 i3_config_wizard_i3_config_wizard_LDADD = \
419422 $(libi3_LIBS) \
423 $(LIBSN_LIBS) \
420424 $(XCB_UTIL_KEYSYMS_LIBS) \
421425 $(XKBCOMMON_LIBS)
422426
4646
4747 #include <xkbcommon/xkbcommon.h>
4848 #include <xkbcommon/xkbcommon-x11.h>
49
50 #define SN_API_NOT_YET_FROZEN 1
51 #include <libsn/sn-launchee.h>
4952
5053 #include <X11/Xlib.h>
5154 #include <X11/keysym.h>
846849 #include "atoms.xmacro"
847850 #undef xmacro
848851
852 /* Init startup notification. */
853 SnDisplay *sndisplay = sn_xcb_display_new(conn, NULL, NULL);
854 SnLauncheeContext *sncontext = sn_launchee_context_new_from_environment(sndisplay, screen);
855
849856 root_screen = xcb_aux_get_screen(conn, screen);
850857 root = root_screen->root;
851858
878885 0, /* back pixel: black */
879886 XCB_EVENT_MASK_EXPOSURE |
880887 XCB_EVENT_MASK_BUTTON_PRESS});
888 sn_launchee_context_setup_window(sncontext, win);
881889
882890 /* Map the window (make it visible) */
883891 xcb_map_window(conn, win);
939947 exit(-1);
940948 }
941949
950 /* Startup complete. */
951 sn_launchee_context_complete(sncontext);
952 sn_launchee_context_unref(sncontext);
953 sn_display_unref(sndisplay);
954
942955 xcb_flush(conn);
943956
944957 xcb_generic_event_t *event;
3030 #include <xcb/xcb_event.h>
3131 #include <xcb/randr.h>
3232 #include <xcb/xcb_cursor.h>
33
34 #define SN_API_NOT_YET_FROZEN 1
35 #include <libsn/sn-launchee.h>
3336
3437 #include "i3-nagbar.h"
3538
414417 #include "atoms.xmacro"
415418 #undef xmacro
416419
420 /* Init startup notification. */
421 SnDisplay *sndisplay = sn_xcb_display_new(conn, NULL, NULL);
422 SnLauncheeContext *sncontext = sn_launchee_context_new_from_environment(sndisplay, screens);
423
417424 root_screen = xcb_aux_get_screen(conn, screens);
418425 root = root_screen->root;
419426
483490 XCB_EVENT_MASK_BUTTON_PRESS |
484491 XCB_EVENT_MASK_BUTTON_RELEASE,
485492 cursor});
493 sn_launchee_context_setup_window(sncontext, win);
486494
487495 /* Map the window (make it visible) */
488496 xcb_map_window(conn, win);
543551 /* Initialize the drawable bar */
544552 draw_util_surface_init(conn, &bar, win, get_visualtype(root_screen), win_pos.width, win_pos.height);
545553
554 /* Startup complete. */
555 sn_launchee_context_complete(sncontext);
556 sn_launchee_context_unref(sncontext);
557 sn_display_unref(sndisplay);
558
546559 /* Grab the keyboard to get all input */
547560 xcb_flush(conn);
548561