Age | Commit message (Collapse) | Author |
|
This is necessary because commands in the config file (mode for
instance) emit ipc events, and if ipc_init has not been called the
ipc_clients_list is not initialized, and we segfault. This fixes that
bug.
|
|
This commit deals with issue #884. I consulted the following sources:
https://www.securecoding.cert.org/confluence/display/c/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges
and
https://www.securecoding.cert.org/confluence/display/c/POS37-C.+Ensure+that+privilege+relinquishment+is+successful
|
|
|
|
|
|
|
|
The include command (`include <path>`) makes it possible to include sub
config files from the main config file (or from within other sub config
files).
The include command uses the following rules for including config files:
* the `path` can be either a full path or a path that is relative to the
parent config. Shell expansion is supported, so it's possible to do
`include ~/.config/sway.d/*`.
* The same config file can only be included once (to prevent include
cycles). If a config is included multiple times it will just be
ignored after it has been included once.
* Including a sub config file is the same as inserting the content of
that file into the parent config, thus rules about overwriting
bindsyms etc. works the same as for a single config.
Implement #542
|
|
This makes sure that sway will gracefully exit if the config is not
found or sway is unable to read it.
|
|
|
|
|
|
|
|
Apart from freeing the sway_config struct, this also terminates the
swaybars spawned by sway, since they are linked by PID to the bar config
structs.
|
|
Calling `exit` in sway_terminate prevents sway from correctly shutting
down (freeing data, cleanly terminating the ipc server, etc.).
A better way is to exit straight away if the failure occurs before
`wlc_run` and use sway_abort as usual if it occur when wlc is running.
|
|
sway_terminate does an exit in case wlc_terminate doesn't
|
|
Sway used to attempt sending an IPC command composed of every argument
after the first non-option argument encountered.
Now, raises an error if an option is encountered before the intended command.
Some options such as -h or -v take effect when parsing, so they still
apply.
|
|
The get-socketpath long option had an undocumented short alternative
as `p`. It has been removed.
However, the code in the options array is still the 'p' char.
|
|
|
|
|
|
|
|
This makes sway handle and gracefully shut down everything when
receiving a SIGTERM.
Fix #416
|
|
|
|
As an alternative to invoking swaymsg.
|
|
main: Setup logging before wlc_init.
|
|
If `wlc_init` fails the error message will never be logged or printed
anywhere.
|
|
Using 'flag' results in duplicate code paths for short and long options.
This broke the -q short option in swaymsg, because there was:
{"quiet", no_argument, &quiet, 'q'}
Which will set quiet to 'q' and return 0, not 'q'.
|
|
|
|
|
|
|
|
First of all because it's not needed that early, and second of all
because there's a bug where calling `sway --get-socketpath` via `popen`
causes the child sway process to spin/hang instead of returning EOF.
(Specifically `(unset SWAYSOCK; swaymsg)` hangs.) This patch fixes that.
(Also note that this patch moves the "detailed review" comment, so I
guess this patch requires extra detailed review?)
|
|
|
|
|
|
After adding pid to the socket path the `--get-socketpath` command broke
because it doesn't know the pid of the running instance. Fix this by
setting and querying `SWAYSOCK`.
Also ignore `SWAYSOCK` upon normal startup if a socket exists at that
location (ie. from another sway instance), and don't overwrite `I3SOCK`
if it exists either.
|
|
|
|
|
|
|
|
|
|
|
|
Fixes #182
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- wlc_terminate() instead of exit(0)
- unlink IPC socket
|
|
simply executes the received data as command
|