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
46 | 46 |
|
47 | 47 |
#include <xkbcommon/xkbcommon.h>
|
48 | 48 |
#include <xkbcommon/xkbcommon-x11.h>
|
|
49 |
|
|
50 |
#define SN_API_NOT_YET_FROZEN 1
|
|
51 |
#include <libsn/sn-launchee.h>
|
49 | 52 |
|
50 | 53 |
#include <X11/Xlib.h>
|
51 | 54 |
#include <X11/keysym.h>
|
|
846 | 849 |
#include "atoms.xmacro"
|
847 | 850 |
#undef xmacro
|
848 | 851 |
|
|
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 |
|
849 | 856 |
root_screen = xcb_aux_get_screen(conn, screen);
|
850 | 857 |
root = root_screen->root;
|
851 | 858 |
|
|
878 | 885 |
0, /* back pixel: black */
|
879 | 886 |
XCB_EVENT_MASK_EXPOSURE |
|
880 | 887 |
XCB_EVENT_MASK_BUTTON_PRESS});
|
|
888 |
sn_launchee_context_setup_window(sncontext, win);
|
881 | 889 |
|
882 | 890 |
/* Map the window (make it visible) */
|
883 | 891 |
xcb_map_window(conn, win);
|
|
939 | 947 |
exit(-1);
|
940 | 948 |
}
|
941 | 949 |
|
|
950 |
/* Startup complete. */
|
|
951 |
sn_launchee_context_complete(sncontext);
|
|
952 |
sn_launchee_context_unref(sncontext);
|
|
953 |
sn_display_unref(sndisplay);
|
|
954 |
|
942 | 955 |
xcb_flush(conn);
|
943 | 956 |
|
944 | 957 |
xcb_generic_event_t *event;
|
30 | 30 |
#include <xcb/xcb_event.h>
|
31 | 31 |
#include <xcb/randr.h>
|
32 | 32 |
#include <xcb/xcb_cursor.h>
|
|
33 |
|
|
34 |
#define SN_API_NOT_YET_FROZEN 1
|
|
35 |
#include <libsn/sn-launchee.h>
|
33 | 36 |
|
34 | 37 |
#include "i3-nagbar.h"
|
35 | 38 |
|
|
414 | 417 |
#include "atoms.xmacro"
|
415 | 418 |
#undef xmacro
|
416 | 419 |
|
|
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 |
|
417 | 424 |
root_screen = xcb_aux_get_screen(conn, screens);
|
418 | 425 |
root = root_screen->root;
|
419 | 426 |
|
|
483 | 490 |
XCB_EVENT_MASK_BUTTON_PRESS |
|
484 | 491 |
XCB_EVENT_MASK_BUTTON_RELEASE,
|
485 | 492 |
cursor});
|
|
493 |
sn_launchee_context_setup_window(sncontext, win);
|
486 | 494 |
|
487 | 495 |
/* Map the window (make it visible) */
|
488 | 496 |
xcb_map_window(conn, win);
|
|
543 | 551 |
/* Initialize the drawable bar */
|
544 | 552 |
draw_util_surface_init(conn, &bar, win, get_visualtype(root_screen), win_pos.width, win_pos.height);
|
545 | 553 |
|
|
554 |
/* Startup complete. */
|
|
555 |
sn_launchee_context_complete(sncontext);
|
|
556 |
sn_launchee_context_unref(sncontext);
|
|
557 |
sn_display_unref(sndisplay);
|
|
558 |
|
546 | 559 |
/* Grab the keyboard to get all input */
|
547 | 560 |
xcb_flush(conn);
|
548 | 561 |
|