aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands
Commit message (Collapse)AuthorAge
* Restrict relative output transforms to runtime changesLibravatar Simon Ser2020-04-21
| | | | | | | | Prevent them from being used in the config file. This is a breaking config file change. References: https://github.com/swaywm/sway/issues/5236
* Fix a use-after-free error in switch bindingLibravatar Di Ma2020-04-14
|
* Fix a use-after-free error in switch bindingLibravatar Di Ma2020-04-14
|
* Implement create_output command for headless backendLibravatar Simon Ser2020-04-14
|
* add --no-repeat option for bindingsLibravatar Linus Heckemann2020-03-30
| | | | | | | | | This allows e.g. triggering one command while a key is held, then triggering another to undo the change performed by it afterwards. One use case for this is triggering push-to-talk functionality for VoIP tools without granting them full access to all input events. Fixes #3151
* check for workspace command name argLibravatar r-c-f2020-03-24
| | | | | | | | | | | | | | | | | | * check for workspace command name arg (fix #5131) For the 'workspace <name> output <output>' command, output_location must be greater than zero or the attempt to get the workspace name with join_args will segfault or abort() (depending on the flavor of sway_assert() in use). This checks and returns an error instead. * put workspace output error string on one line To ease grepping as requested * check for name in workspace gaps command as well A malformed command here will lead to the same result seen in #5131, so add a check. Done inside the cmd_workspace_gaps() function itself, to take advantage of the existing 'Expected...' string.
* commands/bind.c: remove unnecessary checkLibravatar Jason Nader2020-03-15
|
* commands: Adjust style in cursors commandLibravatar Michael Weiser2020-03-11
| | | | | | | Remove some unnecessary brackets in an error condition check identified during review of the shortcuts inhibitor command code (#5021). Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
* commands: Add shortcuts_inhibitor commandLibravatar Michael Weiser2020-03-11
| | | | | | | | | | | | | | | | | | | Add a command to influence keyboard shortcuts inhibitors. In its current form it can be used to activate, deactivate or toggle an existing inhibitor on the surface currently receiving input. This can be used to define an escape shortcut such as: bindsym --inhibited $mod+Escape seat - shortcuts_inhibitor deactivate It also allows the user to configure a per-seat default of whether keyboard inhibitors are honoured by default (the default) or not. Using the activate/toggle command they can then enable the lingering inhibitor at a later time of their choosing. As a side effect this allows to specifically address a named seat for actions as well, whatever use-case that might serve. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
* input: Add support for keyboard shortcuts inhibitLibravatar Michael Weiser2020-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adding support for the keyboard shortcuts inhibit protocol allows remote desktop and virtualisation software to receive all keyboard input in order to pass it through to their clients so users can fully interact the their remote/virtual session. The software usually provides its own key combination to release its "grab" to all keyboard input. The inhibitor can be deactivated by the user by removing focus from the surface using another input device such as the pointer. Use support for the procotol in wlroots to add support to sway. Extend the input manager with handlers for inhibitor creation and destruction and appropriate bookkeeping. Attach the inhibitors to the seats they apply to to avoid having to search the list of all currently existing inhibitors on every keystroke and passing the inhibitor manager around. Add a helper function to retrieve the inhibitor applying to the currently focused surface of a seat, if one exists. Extend bindsym with a flag for bindings that should be processed even if an inhibitor is active. Conversely this disables all normal shortcuts if an inhibitor is found for the currently focused surface in keyboard::handle_key_event() since they don't have that flag set. Use above helper function to determine if an inhibitor exists for the surface that would eventually receive input. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
* input: implement cycling through keyboard layout listLibravatar Bor Grošelj Simić2020-03-11
|
* Add an adaptive_sync output commandLibravatar Simon Ser2020-03-07
| | | | | | | | | This enables/disables adaptive synchronization on the output. For now, the default is disabled because it might cause flickering on some hardware if clients don't submit frames at regular enough intervals. In the future an "auto" option will only enable adaptive sync if a fullscreen client opts-in via a Wayland protocol.
* treewide: fix typosLibravatar Torstein Husebø2020-02-18
|
* input_cmd_events: add support for input typesLibravatar Brian Ashworth2020-02-18
| | | | | | | | | | | This adds support for input type configs to input_cmd_events. This works similar to the wildcard handling that existed where configs for the devices are stored and the type config is reset to INT_MIN so that it does not override. This also condenses the toggle_send_events and toggle_wildcard_send_events functions into a single function to reduce code duplication.
* Fix output transform rotation directionLibravatar Simon Ser2020-02-17
| | | | | | | | This patch makes it so users that have configured their screen with a transform don't have to update their config after the wlroots breaking change. References: https://github.com/swaywm/wlroots/pull/2023
* Fix output transform anticlockwiseLibravatar Simon Ser2020-02-17
| | | | This wouldn't have any effect if the transform was flipped.
* cmd_swap: fix test_mark conditionLibravatar Brian Ashworth2020-02-13
| | | | | | | The condition in test_mark was checking the negation of list_seq_find. This works fine for the first mark, but fails for every other mark. This fixes the condition to check for anything other than -1, which is the value returned from list_seq_find for index not found.
* config: fix validation exit code and log levelLibravatar Brian Ashworth2020-02-11
| | | | | | | | | This makes it so invalid configs will return the exit code 1 when the validation flag is given. This also reduces the log level to SWAY_ERROR, which makes it so only the errors are shown. If someone wants more verbose output, the can use the -V/--verbose or -d/--debug flags. Additionally, this also makes it so swaybg will not be spawned when validating the config.
* Add ability to remove the floating modifierLibravatar Alex Maese2020-01-20
|
* Check argc>0 before strcasecmp. Should shortcircuitLibravatar Jason Nader2020-01-18
|
* commands/move: Fix crash when required args not providedLibravatar Jason Nader2020-01-18
| | | | Fixes #4919.
* cmd_split: Refuse to split scratchpad hidden split containersLibravatar Ronan Pigott2020-01-16
|
* cmd_move: Fix crash when moving to scratchpad hidden split containersLibravatar Ronan Pigott2020-01-16
|
* Fix crash when showing scratchpad hidden split containersLibravatar Ronan Pigott2020-01-16
|
* commands/split: Fix error message typosLibravatar Ronan Pigott2020-01-16
|
* Avoid numerical instability in resizeLibravatar Pedro Côrte-Real2020-01-01
| | | | | | | | | | | | | | | | | | | Because the layout code rounds down the dimensions of the windows resizing would often be off by one pixel. The width/height fraction would not exactly reflect the final computed width and so the resize code would end up calculating things wrong. To fix this first snap the container size fractions to the pixel grid and only then do the resize. Also use round() instead of floor() during layout to avoid a slightly too small width. This applies in two cases: 1. For the container we are actually resizing using floor() might result in being 1px too small. 2. For the other containers it might result in resizing them down by 1px and then if the container being resized is the last all those extra pixels would make the resize too large. Fixes #4391
* cmd_client_*: support optional args for i3 compatLibravatar Brian Ashworth2019-12-29
| | | | | | For i3 compatibility, allow the indicator and child_border colors values to be optional. The indicator will fallback to sane defaults and child_border will fallback to the background color for the class.
* bar_cmd_colors: remove add_colorLibravatar Brian Ashworth2019-12-28
| | | | | | | | | | | | This is the third commit in a series of commits to refactor color handling in sway. This removes add_color from commands.c. It was only being used by bar_cmd_colors. This also changes the functions to use parse_color which is used to validate rgb(a) colors throughout the code base and is also what i3bar is using to parse the colors after they are passed over ipc. After parsing the color and ensuring it is valid, the rgba hex string is then generated using snprintf. This refactor also ensures that all the colors for the command are valid before applying any of them.
* cmd_client_*: refactor duplicated codeLibravatar Brian Ashworth2019-12-28
| | | | | | | | | | | | | This is the second in a series of commits to refactor the color handling in sway. This removes the duplicated color parsing code in sway/commands/client.c. Additionally, this combines the parsing of colors to float arrays with that in sway/config.c and introduces a color_to_rgba function in commom/util.c. As an added bonus, this also makes it so non of the colors in a border color class will be changed unless all of the colors specified are valid. This ensures that an invalid command does not get partially applied.
* seat_cmd_keyboard_grouping: change keymap to smartLibravatar Brian Ashworth2019-12-16
| | | | | | | | | | This removes `seat <seat> keyboard_grouping keymap` and replaces it with `seat <seat> keyboard_grouping smart`. The smart keyboard grouping will group based on both the keymap and repeat info. The reasoning for this is that deciding what the repeat info should be for a group is either arbitrary or non-deterministic when multiple keyboards in the group have repeat info configured (unless somehow exposed to the user in a reproducible uniquely identifiable fashion).
* Add seat <seat> idle_{inhibit,wake} <sources...>Libravatar Drew DeVault2019-12-12
| | | | | | | | | | This adds seat configuration options which can be used to configure what events affect the idle behavior of sway. An example use-case is mobile devices: you would remove touch from the list of idle_wake events. This allows the phone to stay on while you're actively using it, but doesn't wake from idle on touch events while it's sleeping in your pocket.
* add scale_filter output config optionLibravatar Ronan Pigott2019-11-29
|
* config: improvements to the reload validationLibravatar Brian Ashworth2019-11-27
| | | | | | | | For the validation pass of reloading, there is no need to touch swaybg, swaynag, inputs, outputs, or seats. This drastically improves the speed of a reload by skipping over the expensive I/O configuration and handling of wayland clients. As long as the syntax is valid, the CMD_FAILURE's can be relayed during the actual reload.
* Add support for wlr_keyboard_groupLibravatar Brian Ashworth2019-11-21
| | | | | | | | | | | | | | | | | A wlr_keyboard_group allows for multiple keyboard devices to be combined into one logical keyboard. This is useful for keyboards that are split into multiple input devices despite appearing as one physical keyboard in the user's mind. This adds support for wlr_keyboard_groups to sway. There are two keyboard groupings currently supported, which can be set on a per-seat basis. The first keyboard grouping is none, which disables all grouping and provides no functional change. The second is keymap, which groups the keyboard devices in the seat by their keymap. With this grouping, the effective layout and repeat info is also synced across keyboard devices in the seat. Device specific bindings will still be executed as normal, but everything else related to key and modifier events will be handled by the keyboard group's keyboard.
* input_cmd_xkb_file: allow shell path expansionLibravatar Brian Ashworth2019-11-21
| | | | | This allows for shell path expansion for input_cmd_xkb_file. The logic has been extracted from output_cmd_background
* view: add max_render_timeLibravatar Ivan Molodetskikh2019-11-17
|
* output: add max_render_timeLibravatar Ivan Molodetskikh2019-11-17
|
* Use an enum instead of a marker string for map_to_Libravatar Tadeo Kondrak2019-11-17
|
* Implement input map_to_region commandLibravatar Tadeo Kondrak2019-11-17
|
* smart_borders: separate smartness from edge typesLibravatar Ronan Pigott2019-11-04
|
* Add --custom to `output mode` commandLibravatar Simon Ser2019-11-04
| | | | This forces to set the mode as a custom mode.
* focus: do nothing on focus prev|next for workspacesLibravatar Ronan Pigott2019-11-04
|
* focus: add a NULL check in `focus <direction>`Libravatar lbonn2019-11-01
| | | | | container is checked for NULL in other conditions earlier, it's not obvious that it can't be undefined here.
* focus: support focus prev|next [sibling]Libravatar Ronan Pigott2019-10-27
|
* focus: support focus_wrapping workspaceLibravatar lbonn2019-10-17
| | | | Following i3 support: https://github.com/i3/i3/pull/3407
* swaybar: complete barconfig_update event handlingLibravatar Brian Ashworth2019-09-04
| | | | | | | | This adds complete support for the barconfig_update ipc event. This also changes the bar command and subcommand handlers to correctly emit the event. This makes it so all bar subcommands other than id and swaybar_command are dynamically changeable at runtime. sway-bar.5 has been updated accordingly
* Fix typo for the force/immediate option in xwayland_mode enumLibravatar Ben Brown2019-09-02
|
* cmd_mode: don't reset to default after subcommandLibravatar Brian Ashworth2019-08-27
| | | | | | In cmd_mode, the mode is currently being reset to the default mode after a mode subcommand handler is executed. This stores and restores the mode instead
* cmd_move: fix move to scratchpad hidden containerLibravatar Brian Ashworth2019-08-23
| | | | | | | | | When moving to a scratchpad hidden container (using `move [window|container] [to] mark <mark>`), this moves the container to the scratchpad (equivalent to `move [window|container] [to] scratchpad`). Previously, this would crash since the destination did not have a workspace.
* Allow moving a container hidden in scratchpadLibravatar lbonn2019-08-20
| | | | | | | (as i3 allows it) Just update the container's coordinates so that they will be applied at the next show.