aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands
Commit message (Collapse)AuthorAge
...
* xkb_switch_layout: fix relative layout switchesLibravatar Victor Makarov2022-04-28
| | | Fixes #6011
* Shuffle variables to satisfy -Werror=restrictLibravatar Daniel De Graaf2022-04-09
| | | | This also fixes an invalid strlen invocation on uninitialized memory.
* sway/input: follow up wlroots input device events renamingLibravatar Simon Zeni2022-03-17
|
* Remove WLR_SWITCH_STATE_TOGGLE usageLibravatar Simon Ser2022-03-08
| | | | | | Ref [1]. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/4792446ee8f50104bd207d9ccd8558a7e4eb4514
* commands/focus: fix segfault when no container is already focused.Libravatar Nicolas Avrutin2022-03-06
| | | | Fixes #6690.
* sway/commands: add missing wlr_keyboard interface include in xkb_switch_layoutLibravatar Simon Zeni2022-02-21
|
* Fix snprintf compiler warningLibravatar Muhamed Hobi2022-02-08
|
* chore: chase wlr_output_layout_get_box() updateLibravatar Kirill Primak2022-01-31
| | | | https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3439
* cmd/swap: error on swapping a container with itselfLibravatar Ronan Pigott2022-01-22
|
* treat fullscreen windows as 'tiled' for commands/focusLibravatar Patrick Hilhorst2022-01-18
|
* commands/focus: drop trailing whitespaceLibravatar Simon Ser2022-01-16
|
* commands/move: Fix crash when pos_y is omittedLibravatar David962022-01-09
| | | | Fixes #6737
* Add focused_tab_titleLibravatar Vsevolod2021-12-10
|
* sway: replace noop_output by fallback_outputLibravatar Simon Zeni2021-11-25
| | | | | wlroots removed the support for the noop backend. Instead we rely on the headless backend to provide the fallback output.
* ipc: make `bar <bar_id> mode|hidden_state` behave as documentedLibravatar Aleksei Bavshin2021-11-25
| | | | | | | | | | | sway-bar(5) says: > For compatibility with i3, bar mode <mode> [<bar-id>] syntax is > supported along with the sway only bar <bar-id> mode <mode> syntax. while the actual behavior is that `bar_cmd_mode` ignores already selected `config->current_bar` and applies the change to all the configured bars.
* Add 'output render_bit_depth [8|10]' commandLibravatar Manuel Stoeckl2021-11-23
| | | | | | | This makes it possible to hint to the renderer and backends how many bits per channel the buffers that the compositor draws windows onto should have. Renderers and backends may deviate from this if they do not support the formats with higher bit depth.
* Bump RLIMIT_NOFILELibravatar Simon Ser2021-10-30
| | | | | | | | Wayland compositors handle many file descriptors: client connections, DMA-BUFs, sync_files, wl_data_device pipes, and so on. Bump the limit to the max. Closes: https://github.com/swaywm/sway/issues/6285
* Add smart_gaps inverse_outer commandLibravatar bR3iN2021-10-29
| | | | | | Add a subcommand for `smart_gaps` that enables outer gaps only on workspaces with exactly one visible child. Also add documentation for `smart_gaps toggle`.
* commands/focus: focus view inside containerLibravatar siikamiika2021-10-21
| | | | | | seat_get_focus_inactive_floating and seat_get_focus_inactive_tiling do not always return a view, so get the previously focused view from the container with seat_get_focus_inactive_view. This is the i3 behavior.
* Avoid unecessary font metric calculationsLibravatar Hugo Osvaldo Barrera2021-09-20
| | | | | | | | | | | | | | | | | | | | | Prior to 62d90a8e, titlebar's font height (and other related values) would change any time any titlebar's content changed, so these values were recalculated each time any titlebar's content changed (or a new titlebar was created). However, since the above was merge, these values no longer change so often and we only need to recalculate them when the configured font changes (and stop calling `config_update_font_height` each time titlebars are rendered). This commit removes all the unecessary calls to this function and avoids all those unecessary calculations. Whenever the font strays from the default value, the `font` command is called, and it calls `config_update_font_height`, which is enough to keep the value always up to date. I've also added a default value to the `font_baseline` config, since otherwise that's zero for setups that don't explicitly specify a font.
* commands: update split none command for a047b5ee4Libravatar Ronan Pigott2021-09-04
|
* command: implement split noneLibravatar Ronan Pigott2021-09-03
|
* Add `output modeline` commandLibravatar David Rosca2021-08-31
| | | | Only works with DRM backend.
* Use fixed titlebar heightsLibravatar Hugo Osvaldo Barrera2021-08-26
| | | | | | | | | | | | | | | Use fixed titlebar heights. The default height is calculated based on font metrics for the configured font and current locale. Some testing with titles with emoji and CJK characters (which are substantially higher in my setup) shows that the titlebars retain their initial value, text does shift up or down, and all titlebars always remain aligned. Also drop some also now-unecessary title_height calculations. Makes also needed to be updated, since they should be positioned with the same rules.
* cmd_bind_or_unbind_switch: fix copy/paste typo error messageLibravatar Eric Engestrom2021-08-14
| | | | | `[0]` is the switch type, not its state; we want `[1]` for that, and it's a string not an int :)
* Add `gaps <type> <scope> toggle <px>` commandLibravatar bR3iN2021-07-22
| | | | | | | | Add a subcommand for `gaps` that allows to toggle gaps at runtime. This functionality is part of i3-gaps since [1] but is missing in sway. [1] https://github.com/Airblader/i3/pull/264
* Update wlr_box includesLibravatar Simon Ser2021-07-07
| | | | | | Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3011
* Revert "Add workspace {prev,next}_on_output --create"Libravatar Ragnar Groot Koerkamp2021-06-22
| | | | | | | This reverts commit 487c83f0de9ca2a7650ad636eed6fd694ddcb82e. The --create flag is undocumented, not in i3, and at least partially broken (#5913), so this removes the feature.
* Only call workspace_auto_back_and_forth when neededLibravatar Ragnar Groot Koerkamp2021-06-18
| | | | | | Instead of disabling it for some workspace subcommands, this explicitly calls it only in the 2 places it's actually needed: for switching to a named or numbered workspace.
* Move auto_back_and_forth logic out of workspace_switchLibravatar Ragnar Groot Koerkamp2021-06-18
| | | | | | | | This extracts the code to a separate workspace_auto_back_and_forth function. It also removes the bool argument by adding an extra if statement at the call site, and repurposes the no_auto_back_and_forth variable to auto_back_and_forth for simpler understanding.
* Fix #6299 Disable auto_back_and_forth for next_on_outputLibravatar Ragnar Groot Koerkamp2021-06-18
| | | | | | | | | | | | | | This forces no_auto_back_and_forth to true for `workspace next_on_output` and `workspace prev_on_output` to keep parity with i3. In i3, running next_on_output never changes focus to another output. In Sway currently, with workspace_auto_back_and_forth set to yet, running next_on_output on an output with only a single active workspace will typically end up focussing the other output: 1. next_on_output focusses the current workspace, because it's the only one 2. auto_back_and_forth focusses the last focussed workspace, because the current workspace to focus is the current one. This will usually be on the other monitor if the workspace there was last focussed.
* sway: commands: exec: restore SIGPIPE before exec:ingLibravatar Daniel Eklöf2021-06-05
| | | | | | | | | | | | Sway ignores SIGPIPE (by installing a SIG_IGN handler), in order to “prevent IPC from crashing Sway”. SIG_IGN handlers are the *only* signal handlers inherited in sub-processes. As such, we should be a good citizen and restore the SIGPIPE handler to its default handler. Original bug report: https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1806907.html
* config: Fix swaybar pango_markup inconsistencyLibravatar Daniel Otero2021-06-03
| | | | | | Until now, swaybar did not have pango markup enabled by default, even if the sway config had it on. This patch aims to mimic the i3 behavior, but maintaining the functionality of the "pango_markup" sway config command.
* Only defer seat attachment during initial startupLibravatar Bill Doyle2021-06-03
| | | | | | | | | Deferred commands are only run once, during sway startup. This means that deferring seat attachment based on whether we are reading the config prevents devices from being reattached to the correct seat during a config reload. Instead, only defer if the config is not yet active. Fixes #6048.
* commands/exec: stop truncating >4095-byte commandsLibravatar Manuel Stoeckl2021-05-10
|
* cmd_fullscreen: ignore fullscreen request on workspacesLibravatar Ronan Pigott2021-05-10
|
* commands/exec_always: log error on execlp failureLibravatar Simon Ser2021-04-22
| | | | And exit(1) instead of indicating success.
* Use execlp("sh") instead of execl("/bin/sh")Libravatar Simon Ser2021-04-22
| | | | This stops assuming the POSIX shell command is located in /bin.
* Prevent use-after-free on first bar subcommand errorLibravatar Michael Weiser2021-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If any error is encountered during execution of the first subcommand of a freshly created bar configuration, parsing apparently is to be aborted and the current bar config is freed. The pointer to that memory is left dangling though, leading to a use-after-free on successive bar subcommands. This quite reliably ends in a crash like so: sway -c reproducer.config 00:00:00.083 [sway/config.c:865] Error on line 2 'foo bar': Unknown/invalid command 'foo' (s) free(): double free detected in tcache 2 00:00:00.608 [swaynag/swaynag.c:451] failed to register with the wayland display Aborted (core dumped) Minimal reproducer config: bar { foo bar position top } Other messages: malloc(): unaligned fastbin chunk detected double free or corruption (fasttop) The invalid command has to be the first for a newly created bar config. Removing the command or switching order so it's not the first one masks the problem. Prevent this from occuring by resetting the pointer to NULL after freeing the memory. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
* cmd_fullscreen: allow fullscreen on fullscreen split containersLibravatar Ronan Pigott2021-04-16
| | | | | | Using the fullscreen command on a child of a fullscreen split container will now fullscreen the child instead of unfullscreening the parent.
* Add toggle logic inside DPMS handlerLibravatar Ivan Fedotov2021-03-25
| | | | | | | | | | | Logic that obtains current DPMS state is put inside the handler. sway_output from which the current DPMS state will be obtained is selected by the following logic: * For '-' and '--' the focused output is used; * For '*' error "Cannot apply toggle to all outputs" is reported; * For everything else all_output_by_name_or_id() is used. Fixes #5929.
* Fix for_window criteria and mouse button bindingsLibravatar ftilde2021-02-25
| | | | | | | | | | | | | | | | | | | Previously, the special case handling of scratchpad and unmark commands was (probably accidentally) limited to criteria directly handled in the execute_command function. This would exclude: 1. for_window criteria, as these are handled externally for views and 2. and mouse bindings which select target the node currently under the mouse cursor. As a concrete example `for_window [app_id="foobar"] move scratchpad, scratchpad show` would show (or hide due to the toggling functionality) another window from the scratchpad, instead of showing the window with app_id "foobar". This commit replaces the "using_criteria" flag with "node_overridden" with the more general notion of signifying that the node (and container/workspace) in the current command handler context of the sway config is not defined by the currently focused node, but instead overridden by other means, i.e., criteria or mouse position.
* focus: beyond fullscreen when focused explicitlyLibravatar lbonn2021-02-25
| | | | | | | When issuing a focus command on a specific container, users expect to proceed it even if is hidden by a fullscreen window. This matches the behavior of i3.
* container: Move pending state to state structLibravatar Kenny Levinsen2021-02-16
| | | | | | | | | Pending state is currently inlined directly in the container struct, while the current state is in a state struct. A side-effect of this is that it is not immediately obvious that pending double-buffered state is accessed, nor is it obvious what state is double-buffered. Instead, use the state struct for both current and pending.
* input: Only commit transactions when necessaryLibravatar Kenny Levinsen2021-02-14
| | | | | | | | | | | There is no need to check for transactions at the end of every user input, as the vast majority of input will not issue transactions. This implementation can also hide where changes are made without an appropriate transaction commit, as a future unrelated input would issue the commit instead. Instead, commit transactions in places where changes are made or are likely to be made.
* Declare all struct cmd_handler arrays constLibravatar Manuel Stoeckl2021-02-04
| | | | And make the functions handling these arrays use const types.
* cmd_move: update container representation in sibling swapsLibravatar Ronan Pigott2021-01-04
|
* commands/move: reset geometry of promoted containersLibravatar Ronan Pigott2020-12-20
|
* commands/move: squash workspace after directional con moveLibravatar Ronan Pigott2020-12-20
|
* commands/move: rework container_move_in_directionLibravatar Ronan Pigott2020-12-20
| | | | | | | | | | This changes the move command to better match i3 behavior after the layout changes. workspace_rejigger handled the case where containers would escape their workspace in an orthogonal move by changing the layout to accomodate them, but this case is now handled within the loop.