i3
|
#include "all.h"
#include "sd-daemon.h"
#include <sys/types.h>
#include <sys/wait.h>
#include <libsn/sn-launcher.h>
Go to the source code of this file.
Defines | |
#define | SN_API_NOT_YET_FROZEN 1 |
Functions | |
static | TAILQ_HEAD (startup_sequence_head, Startup_Sequence) |
void | start_application (const char *command, bool no_startup_id) |
Starts the given application by passing it through a shell. | |
void | startup_monitor_event (SnMonitorEvent *event, void *userdata) |
Called by libstartup-notification when something happens. | |
char * | startup_workspace_for_window (i3Window *cwindow, xcb_get_property_reply_t *startup_id_reply) |
Checks if the given window belongs to a startup notification by checking if the _NET_STARTUP_ID property is set on the window (or on its leader, if it’s unset). |
void start_application | ( | const char * | command, |
bool | no_startup_id | ||
) |
Starts the given application by passing it through a shell.
We use double fork to avoid zombie processes. As the started application’s parent exits (immediately), the application is reparented to init (process-id 1), which correctly handles childs, so we don’t have to do it :-).
The shell is determined by looking for the SHELL environment variable. If it does not exist, /bin/sh is used.
The no_startup_id flag determines whether a startup notification context (and ID) should be created, which is the default and encouraged behavior.
Definition at line 71 of file startup.c.
References con_get_workspace(), conn_screen, Startup_Sequence::context, context, focused, Startup_Sequence::id, last_timestamp, listen_fds, LOG, main_loop, Con::name, original_rlimit_core, scalloc(), SD_LISTEN_FDS_START, sndisplay, sstrdup(), TAILQ_INSERT_TAIL, Startup_Sequence::workspace, xcb_set_root_cursor(), XCURSOR_CURSOR_WATCH, xcursor_set_root_cursor(), and xcursor_supported.
Referenced by cmd_exec(), and main().
void startup_monitor_event | ( | SnMonitorEvent * | event, |
void * | userdata | ||
) |
Called by libstartup-notification when something happens.
Definition at line 158 of file startup.c.
References Startup_Sequence::context, DLOG, Startup_Sequence::id, TAILQ_EMPTY, TAILQ_FOREACH, TAILQ_REMOVE, xcb_set_root_cursor(), XCURSOR_CURSOR_POINTER, xcursor_set_root_cursor(), and xcursor_supported.
Referenced by property_handlers_init().
char* startup_workspace_for_window | ( | i3Window * | cwindow, |
xcb_get_property_reply_t * | startup_id_reply | ||
) |
Checks if the given window belongs to a startup notification by checking if the _NET_STARTUP_ID property is set on the window (or on its leader, if it’s unset).
If so, returns the workspace on which the startup was initiated. Returns NULL otherwise.
Definition at line 212 of file startup.c.
References conn, DLOG, FREE, Startup_Sequence::id, Window::leader, TAILQ_FOREACH, and Startup_Sequence::workspace.
Referenced by manage_window().
static TAILQ_HEAD | ( | startup_sequence_head | , |
Startup_Sequence | |||
) | [static] |
Definition at line 22 of file startup.c.
References DLOG, Startup_Sequence::id, and TAILQ_FOREACH.