Commit graph

5342 commits

Author SHA1 Message Date
Ian Fan c8776fac42 Cleanup list code 2018-12-09 01:15:38 +00:00
Ian Fan 19e831ed3d list.c: Remove list_foreach
Most occurrences have been replaced by `free_flat_list` which has been
moved from stringop.c to list.c. The rest have been replaced by for loops.
2018-12-09 00:37:50 +00:00
Ryan Dwyer 0c3f0dfd16
Merge pull request #3260 from RedSoxFan/split-flatten
cmd_split: flatten when possible
2018-12-08 09:46:59 +10:00
Brian Ashworth 7b23a1a0d8 cmd_split: flatten when possible 2018-12-05 21:46:02 -05:00
mwenzkowski cf6edaf26a Fix command list execution
Determine the container/workspace a command is run on, each time when a
command of the command list will be run.
Previously the container/workspace was determined only once at the
beginning of command list execution, which led to wrong behaviour
because commands wouldn't take into account when a previous command
changed the focused container.
2018-12-05 11:32:23 +01:00
Brian Ashworth 6ccc836ebf
Merge pull request #3252 from hvenev/swaybar-rel
Add relative coordinates in JSON for i3bar click events
2018-12-04 23:55:55 -05:00
Hristo Venev 24e8ba048a Add relative coordinates in JSON for i3bar click events
Compatibility with i3 commit 161db6f17d734ac9deb0a20e81b78d4b2a92ce68.
2018-12-04 12:49:21 +02:00
Ian Fan bca21ee0cf config: do not set $XDG_CONFIG_HOME if unset or empty
Instead redefine the config paths to use the default $HOME/.config
2018-12-03 13:28:31 +01:00
Ian Fan de66ed4beb config: set $XDG_CONFIG_HOME if empty
Before, it was only set if it was not set, but it should also be done
when empty.
2018-12-03 12:12:21 +01:00
Brian Ashworth 9b41db32ec Fix identifier output configs on reload
When generating default output configs to reset the outputs to their
default settings on reload, the output name was being used.
Additionally when determining the output config to apply, if there was
an output config with the output name, that was being used without
checking for an identifier config. This caused sway to completely ignore
the users specified output config.

To fix this issue, the following changes have been made:
1. Default output configs as created for the identifier now instead of
name. This actually makes more sense anyway since you could hotplug
multiple different outputs to the same port.
2. In get_output_config, which is only used to determine which output
config to apply, output configs for both the name and identifier are
queried. If both are found, a new output config is generated with the
identifier config merged on top of the name config. If just one is found,
a copy of that config is returned. This change also requires that the
result from get_output_config be freed after use to prevent memory
leaks, which required some minor changes to logic in
apply_output_config_to_outputs.
2018-12-03 08:51:27 +01:00
Brian Ashworth 2942bbbc60 cmd_focus: show scratchpad if hidden
If a scratchpad container is hidden, it is still focusable using
criteria and should be shown. This fixes a segfault when attempting to
rebase the cursor since previously the scratchpad container would not be
on any output.
2018-12-03 08:49:26 +01:00
Brian Ashworth 6788910fd7
Merge pull request #3239 from ForTheReallys/bindsym-no-warn
Add option to bindsym/bindcode to suppress warning on override
2018-12-02 22:41:22 -05:00
Alex Maese 1a1a2d96cb Add option to bindsym/bindcode to suppress warning on override 2018-12-02 21:35:44 -06:00
bschacht bf11a77884 fix typo
tranform -> transform
2018-12-02 20:48:53 +01:00
bschacht c4406c206e fix typo
bahavior -> behavior
2018-12-02 20:48:29 +01:00
Drew DeVault 974a3fbc59
Merge pull request #3227 from emersion/swap-buffers-damage-coords
Update for swaywm/wlroots#1403
2018-12-02 13:17:37 -05:00
emersion 20e7584c3a
Merge pull request #3228 from ianyfan/swayidle
meson.build: remove obsolete definition of swayidle_deps
2018-12-02 03:49:08 +01:00
Brian Ashworth 7702943e58
Merge pull request #3229 from mwenzkowski/fix-fullscreen-cmd
Fix fullscreen command and improve documentation
2018-12-01 14:33:36 -05:00
Ian Fan 49502494e7 meson.build: remove obsolete definition of swayidle_deps 2018-12-01 13:55:19 +00:00
emersion ed7bd683a7
Update for swaywm/wlroots#1403 2018-12-01 11:01:08 +01:00
emersion d5678a147f
Merge pull request #3226 from CameronNemo/musl
swaylock: fix build with musl libc
2018-12-01 08:35:22 +01:00
Cameron Nemo c6b2ee7291
swaylock: fix build with musl libc
Signed-off-by: Cameron Nemo <camerontnorman@gmail.com>
2018-11-30 23:22:09 -08:00
mwenzkowski 68668c22e5 sway.5: Improve documentation
Document the optional arguments of the fullscreen command.
2018-11-30 18:15:26 +01:00
mwenzkowski b5c92e5d3b Fix the error result of the fullscreen command
Changes the error result from CMD_INVALID to CMD_FAILURE, since
CMD_INVALID indicates an unknown command or parser error and neither
occurs where CMD_INVALID was used.
2018-11-29 17:03:04 +01:00
emersion fd37ded3a3
Merge pull request #3219 from RedSoxFan/swaymsg-object-success
swaymsg: parse success of single object
2018-11-29 09:10:00 +01:00
Brian Ashworth cf1793b4f1
Merge pull request #3218 from johnae/master
Fix json object ipc success return
2018-11-29 02:37:27 -05:00
John Axel Eriksson aef52154ec
Fix json object ipc return 2018-11-29 08:28:42 +01:00
Brian Ashworth e62ab6ddbd swaymsg: parse success of single object
Allows swaymsg to parse the success attribute of a single object
response. This is needed for the subscribe event.
2018-11-28 21:41:58 -05:00
emersion 9d18d81d48
Merge pull request #3216 from RedSoxFan/fix-empty-titlebars
Fix titlebar when no title or marks
2018-11-28 21:05:59 +01:00
emersion 659ab79b66
Merge pull request #3214 from RedSoxFan/fix-3156
Fix default_orientation auto
2018-11-28 21:00:34 +01:00
Brian Ashworth 14cb39c772 Fix titlebar when no title or marks
This fixes the rendering of the titlebar when there is no title or marks.
2018-11-28 14:20:58 -05:00
Brian Ashworth 71ae08530a Fix default_orientation auto
Since the output config is no longer applied before creating the default
workspace, the layout for default workspaces on an output may not be
correct. Due to the ordering of calls in output_enable being changed in
several bug fix PRs, this just fixes the layout after the call to
apply_output_config.
2018-11-28 13:52:54 -05:00
emersion 9924d72ab2
Merge pull request #3213 from RedSoxFan/fix-3203
Fix scratchpad segfault - NULL focused workspace
2018-11-28 19:16:01 +01:00
Brian Ashworth f52277f66e Fix scratchpad segfault - NULL focused workspace
When adding a container to the scratchpad, it was possible for focus to
be removed from the seat. This occurred when a single child was moved
from it's parent to the scratchpad due to the focus_inactive for the
parent being NULL. If the focus_inactive for the parent is NULL, the
focus_inactive for the workspace should be focused.
2018-11-28 13:02:54 -05:00
emersion 67c7cc53ae
Merge pull request #3206 from RedSoxFan/ipc-subscribe
Implement support for swaymsg -t SUBSCRIBE [-m]
2018-11-28 17:58:36 +01:00
emersion 2c31e82675
Merge pull request #3208 from RedSoxFan/bar-gaps
Implement bar gaps
2018-11-28 17:57:35 +01:00
Brian Ashworth 1bd8463481 Implement bar gaps
Adds the bar subcommand `gaps <amount>|<horizontal> <vertical>|<top>
<right> <bottom> <left>` to set gaps for swaybar. Due to restrictions on
margins for a layer_surface, only the sides that are anchored to an edge
of the screen can have gaps. Since there is support for per-side outer
gaps for workspaces, those should be able to be used instead for the
last side.
2018-11-28 11:24:14 -05:00
Brian Ashworth bf9a52bab0 Implement support for swaymsg -t SUBSCRIBE [-m]
In `i3 4.16`, `i3-msg` can be used with the message type `subscribe`
and has the ability to monitor for responses until killed. This adds
support for both to swaymsg.

If the JSON array of event types is malformed or contains an invalid
event, sway will send a response with `success` set to `false`. If
swaymsg sees this, it will not display the failure and exit.

If the `subscribe` event is successful, swaymsg will wait for the first
response and display that instead of the success message. If
`-m/--monitor` is given, swaymsg will continue monitor for responses
until killed or a malformed response is received.

For the `subscribe` event, the responses will always be printed as JSON.
If `-r/--raw` is given, the JSON will not be pretty printed, which may
be preferred when monitoring due to there being multiple responses.

Example: `swaymsg -t SUBSCRIBE -m "['window']"`
2018-11-28 11:19:18 -05:00
Brian Ashworth 5341e034df
Merge pull request #3212 from martinetd/move_floating
move to workspace: fix moving floating container to non-empty workspace
2018-11-28 11:16:14 -05:00
emersion ef18745951
Merge pull request #3202 from RedSoxFan/swaynag-config-warnings
Introduce a way to show config warnings in swaynag
2018-11-28 17:13:24 +01:00
Brian Ashworth e5f90f25d7 Introduce a way to show config warnings in swaynag
Adds the function `config_add_swaynag_warning(char *fmt, ...)` so that
handlers can add warnings to the swaynag config log in a uniform way.
The formatting is identical to errors and include the line number, line,
and config path.

This also alters the background file access warning to use the function
and introduces a warning for duplicate bindings.
2018-11-28 11:09:01 -05:00
Dominique Martinet 2543834172 move to workspace: fix moving floating container to non-empty workspace
moving a container to a non-empty workspace will find a container to move
to in the destination workspace and call container_move_to_container,
which must not just skip floating containers
2018-11-29 00:08:43 +09:00
Ryan Dwyer a22d0c0ff6
Merge pull request #3211 from emersion/child-view-unmapped-segfault
Fix segfault when destroying unmapped child view
2018-11-28 23:27:46 +10:00
emersion b98563d2d7
Fix segfault when destroying unmapped child view 2018-11-28 14:08:20 +01:00
Ryan Dwyer f737854e30
Merge pull request #3199 from emersion/handle-subsurface-destroy
Handle destroyed subsurfaces
2018-11-28 20:46:22 +10:00
emersion c931a13af9
Merge pull request #3207 from RedSoxFan/swaynag-no-term-buttons
Implement swaynag -B/--button-no-terminal
2018-11-28 09:44:26 +01:00
emersion 048b96a56d
Merge pull request #3204 from RedSoxFan/cmd-res-list
Change execute_command to return a list of results
2018-11-28 09:26:47 +01:00
emersion 60e1fb547c
Merge pull request #3209 from RedSoxFan/fix-3146
Do not strip quotes for cmd_mode
2018-11-28 08:01:17 +01:00
Brian Ashworth 315bca176c Do not strip quotes for cmd_mode
Like with cmd_bindsym and cmd_bindcode, the quotes should not be
stripped for cmd_mode. cmd_mode performs its own stripping for the mode
name and the only valid subcommands are cmd_bindsym and cmd_bindcode.
2018-11-28 01:28:03 -05:00
Brian Ashworth 673da83260 Implement swaynag -B/--button-no-terminal
In `i3 4.16`, `i3-nagbar` introduces the flags `-B/--button-no-terminal`
to run the action directly instead of inside a terminal. This implements
the flags for swaynag for compatibility.

Since swaynag does not use an equivalent to `i3-sensible-terminal`, the
flags `-b/--button` only uses a terminal when the environment variable
`TERMINAL` is set, otherwise it acts the same as these new flags.
2018-11-27 23:34:51 -05:00