sway/common
mstoeckl 6a805aace0 Use stored commands for bindings
The preceding commit includes motivation; specifically,
invoking keyboard and mouse bindings should never fail
unless they perform an action which can fail. For instance,
a `bindcode Ctrl+9 exit` should always exit; of course,
`exec` may fail for external reasons.

The core changes are to bind.c and commands.c. As a single
command may actually, on being parsed, generate multiple
commands to be executed (consider `workspace 1; splith`),
the parsing code in execute_command is moved to a separate
function, parse_command, which returns a list_t of stored
commands; leaving execute_command to parse the command,
execute each resulting list element; and then cleanup.

An additional field for the list of parsed stored commands,
is added to struct sway_binding, usurping the name "command".
This is initialized via parse_command, and then
seat_execute_command is adjusted accordingly.

Side effects of this change include:
* Reference counting `struct criteria`, because a criterion
parsed once may apply to multiple stored commands, and
the alternative of duplicating criteria is even more
complicated.
* Adding reading and active arguments to config_handler,
because when bindsyms parse commands, they require handler
lookups to be performed as though it were runtime.
* Reference counting `struct sway_binding`, because the
alternative of updating sway_binding_dup is even more
complicated when allocation failures are be taken into
account.
2018-08-24 19:58:08 -04:00
..
background-image.c Update for swaywm/wlroots#1126 2018-07-09 22:54:30 +01:00
cairo.c Address review comments 2018-03-28 14:43:23 -04:00
ipc-client.c ipc-client: fix memory leaks in get_socketpath 2018-08-06 17:30:24 +01:00
list.c Use stored commands for bindings 2018-08-24 19:58:08 -04:00
log.c Update for swaywm/wlroots#1126 2018-07-09 22:54:30 +01:00
meson.build Add password buffer, refactor rendering/surfaces 2018-04-04 18:47:48 -04:00
pango.c Update for swaywm/wlroots#1126 2018-07-09 22:54:30 +01:00
readline.c Update for swaywm/wlroots#1126 2018-07-09 22:54:30 +01:00
stringop.c Clean up container title functions 2018-05-25 21:07:59 +10:00
unicode.c utf8_size: fix loop boundary 2018-07-02 08:03:41 +09:00
util.c Address review comments on parse_boolean 2018-07-23 21:37:53 -04:00