2011-10-10 06:36:21 -04:00
|
|
|
|
/*
|
|
|
|
|
* vim:ts=4:sw=4:expandtab
|
|
|
|
|
*
|
|
|
|
|
* i3 - an improved dynamic tiling window manager
|
2011-10-25 16:19:38 -04:00
|
|
|
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
2011-10-10 06:36:21 -04:00
|
|
|
|
*
|
2011-10-25 16:19:38 -04:00
|
|
|
|
* startup.c: Startup notification code. Ensures a startup notification context
|
|
|
|
|
* is setup when launching applications. We store the current
|
|
|
|
|
* workspace to open windows in that startup notification context on
|
|
|
|
|
* the appropriate workspace.
|
2011-10-10 06:36:21 -04:00
|
|
|
|
*
|
|
|
|
|
*/
|
2012-09-21 09:36:25 -04:00
|
|
|
|
#ifndef I3_STARTUP_H
|
|
|
|
|
#define I3_STARTUP_H
|
2011-10-10 06:36:21 -04:00
|
|
|
|
|
|
|
|
|
#define SN_API_NOT_YET_FROZEN 1
|
|
|
|
|
#include <libsn/sn-monitor.h>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
2011-10-25 17:18:17 -04:00
|
|
|
|
* The no_startup_id flag determines whether a startup notification context
|
|
|
|
|
* (and ID) should be created, which is the default and encouraged behavior.
|
|
|
|
|
*
|
2011-10-10 06:36:21 -04:00
|
|
|
|
*/
|
2011-10-25 17:18:17 -04:00
|
|
|
|
void start_application(const char *command, bool no_startup_id);
|
2011-10-10 06:36:21 -04:00
|
|
|
|
|
2012-10-03 21:06:04 -04:00
|
|
|
|
/**
|
|
|
|
|
* Deletes a startup sequence, ignoring whether its timeout has elapsed.
|
|
|
|
|
* Useful when e.g. a window is moved between workspaces and its children
|
|
|
|
|
* shouldn't spawn on the original workspace.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void startup_sequence_delete(struct Startup_Sequence *sequence);
|
|
|
|
|
|
2011-10-10 06:36:21 -04:00
|
|
|
|
/**
|
|
|
|
|
* Called by libstartup-notification when something happens
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void startup_monitor_event(SnMonitorEvent *event, void *userdata);
|
|
|
|
|
|
2012-10-03 21:06:04 -04:00
|
|
|
|
/**
|
|
|
|
|
* Gets the stored startup sequence for the _NET_STARTUP_ID of a given window.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
struct Startup_Sequence *startup_sequence_get(i3Window *cwindow,
|
|
|
|
|
xcb_get_property_reply_t *startup_id_reply, bool ignore_mapped_leader);
|
|
|
|
|
|
2011-10-10 07:48:43 -04:00
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
char *startup_workspace_for_window(i3Window *cwindow, xcb_get_property_reply_t *startup_id_reply);
|
|
|
|
|
|
2011-10-10 06:36:21 -04:00
|
|
|
|
#endif
|