aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
AgeCommit message (Collapse)Author
2018-11-18Add scroll factor config option.Spencer Michaels
2018-11-18Use #if instead of #ifdefemersion
2018-11-17Merge pull request #3142 from RyanDwyer/move-view-propertiesDrew DeVault
Move view {x,y,width,height} into container struct
2018-11-17Move view {x,y,width,height} into container structRyan Dwyer
This renames/moves the following properties: * sway_view.{x,y,width,height} -> sway_container.content_{x,y,width,height} * This is required to support placeholder containers as they don't have a view. * sway_container_state.view_{x,y,width,height} -> sway_container_state.content_{x,y,width,height} * To remain consistent with the above. * sway_container_state.con_{x,y,width,height} -> sway_container_state.{x,y,width,height} * The con prefix was there to give it contrast from the view properties, and is no longer useful. The function container_set_geometry_from_floating_view has also been renamed to container_set_geometry_from_content.
2018-11-17commands/resize: fix grow vars uninitializedCole Mickens
2018-11-16resize set: convert ppt to px for floating containersTrevor Slocum
2018-11-14Fix unused function in swap commandemersion
Also fixes a size_t cast to void *.
2018-11-12Use #if instead of #ifdef for WLR_HAS_*emersion
2018-11-11cmd_ws_auto_back_and_forth: fix negationBrian Ashworth
In the conversion to `parse_boolean` for `cmd_ws_auto_back_and_forth`, the `negation` was never removed causing the setting to be the opposite of what it should be.
2018-11-11Allow multiple outputs for workspace outputBrian Ashworth
`i3 4.16` allows users to list multiple outputs for a workspace and the first available will be used. The syntax is as follows: `workspace <workspace> output <outputs...>` Additionally when the workspace is created, the outputs get added to the output priority list in the order specified. This ensures that if a higher output gets connected, the workspace will move to the higher output. This works the same way as if the user had a workspace on an output, disconnected the output, and then later reconnected the output.
2018-11-10Use parse_boolean where possible.Connor E
2018-11-08resize set: implement width and height keywordsBrian Ashworth
This implements the following syntaxes from `i3 4.16`: * `resize set [width] <width> [px|ppt]` * `resize set height <height> [px|ppt]` * `resize set [width] <width> [px|ppt] [height] <height> [px|ppt]` Additionally, a bug was fixed that caused setting the height of a tiled container to change the width instead due to a typo.
2018-11-08Fix building with clangsghctoma
The "struct sway_container *other" variable in swap.c was potentially used uninitialized, depending on an "if" statement.
2018-11-07Implement per side and per direction outer gapsBrian Ashworth
This introduces the following command extensions from `i3-gaps`: * `gaps horizontal|vertical|top|right|bottom|left <amount>` * `gaps horizontal|vertical|top|right|bottom|left all|current set|plus|minus <amount>` * `workspace <ws> gaps horizontal|vertical|top|right|bottom|left <amount>` `inner` and `outer` are also still available as options for all three of the above commands. `outer` now acts as a shorthand to set/alter all sides. Additionally, this fixes two bugs with the prevention of invalid gap configurations for workspace configs: 1. If outer gaps were not set and inner gaps were, the outer gaps would be snapped to the negation of the inner gaps due to `INT_MIN` being less than the negation. This took precedence over the default outer gaps. 2. Similarly, if inner gaps were not set and outer gaps were, inner gaps would be set to zero, which would take precedence over the default inner gaps. Fixing both of the above items also requires checking the gaps again when creating a workspace since the default outer gaps can be smaller than the negation of the workspace specific inner gaps.
2018-11-06Add focus_follows_mouse always. (#3081)Connor E
* Add focus_follows_mouse_mode. * Fail if focus_follows_mouse is invalid. * Fix indentation.
2018-11-05Add relative output transformRyan Walklin
This commit enhances the output transform command with options for a relative transform, i.e. the provided transform will be applied as an offset to the current transform. Append `clockwise` to rotate clockwise from the current rotation, or `anticlockwise` to rotate in the opposite direction. For example, if the output LVDS-1 is rotated 90 degrees clockwise, the command `output LVDS-1 transform 90 clockwise` will rotate the display to 180 degrees. All transform options are supported, including flipped transforms. Relative transforms can only be applied to a single output and cannot be used with a wildcard (*) output specifier.
2018-11-05commands/exec_always: defer command on config validationRouven Czerwinski
The exec_always command was executed twice, since it was not checking for the config->validating variable. Fix this by defering the command if the configuration is validating. Fixes #3072
2018-11-05Fix focus_wrapping yesBrian Ashworth
It appears that the focus code that handles `focus_wrapping yes` was removed during the conversion to type safety. This re-implements the focus code for when `focus_wrapping` is set to `yes` (default). Neither the `no` or `force` options appear to be effected and should be working.
2018-11-04gaps: Improve error reportingmwenzkowski
Always raise an error if the runtime only gaps command is found in the config file.
2018-11-01Move view marks properties to container structRyan Dwyer
Like border properties, this will be needed to implement layout saving and restoring.
2018-11-01Merge pull request #3040 from RyanDwyer/border-props-to-containerDrew DeVault
Move view border properties to container struct
2018-11-01Wrap to fartherest output when running focus outputRyan Dwyer
Also moves the `opposite_direction` function into `util.c` as it's used in two places now.
2018-10-31Move view border properties to container structRyan Dwyer
This will be needed to implement layout saving and restoring, as we need to be able to configure borders on a placeholder container which has no view.
2018-10-30Remove enum movement_directionRyan Dwyer
There's no point having both movement_direction and wlr_direction. This replaces the former with the latter. As movement_direction also contained MOVE_PARENT and MOVE_CHILD items, these are now checked specifically in the focus command and handled in separate functions, just like the other focus variants.
2018-10-25Update workspace.cppascher
re-added missing output check after config load
2018-10-25Update workspace.cppascher
Remove output requirement for workspace command
2018-10-25Merge pull request #2975 from RyanDwyer/deny-commands-when-no-outputsDrew DeVault
Deny several commands when there's no outputs connected
2018-10-26Deny several commands when there's no outputs connectedRyan Dwyer
2018-10-25Rebase the cursor after applying transactionsRyan Dwyer
This approaches cursor rebasing from a different angle. Rather than littering the codebase with cursor_rebase calls and using transaction callbacks, this just runs cursor_rebase after applying every transaction - but only if there's outputs connected, because otherwise it causes a crash during shutdown. There is one known case where we still need to call cursor_rebase directly, and that's when running `seat seat0 cursor move ...`. This command doesn't set anything as dirty so no transaction occurs.
2018-10-24Rebase the cursor after focusing in a directionRyan Dwyer
Prior to this patch, creating a tabbed container with two views, switching tab and then scrolling without motion would cause the scroll events to be sent to the old focus. To fix this, rebasing the cursor is needed after changing focus.
2018-10-23commands: replace EXPECTED_LESS_THAN with EXPECTED_AT_MOSTIan Fan
This makes it a bit more obvious what the expected number of arguments is.
2018-10-23commands: remove EXPECTED_MORE_THANIan Fan
Its uses have been replaced with EXPECTED_AT_LEAST.
2018-10-23commands: print correct command on error for exec and opacityIan Fan
2018-10-22cmd_swaynag_command: fix typo in variableBrian Ashworth
The custom swaynag_command was being stored as config->swaybg_command instead of config->swaynag_command.
2018-10-23Fix crash when resizing container hidden in the scratchpadRyan Dwyer
Firstly, the container was wrongly identifying as a tiling container because it had no workspace. Secondly, when calculating the maximum possible size we can't use the workspace if it's not there, so we'll allow unlimited size in this case.
2018-10-22Merge pull request #2923 from RyanDwyer/fix-move-to-fullscreen-crashDrew DeVault
Fix crash when moving a container to a fullscreen workspace
2018-10-22Fix crash when moving a container to a fullscreen workspaceRyan Dwyer
Setting normal focus to the fullscreen view causes the old workspace to start destroying. We then set focus to the old workspace which is no longer attached in the tree. As we are only setting focus_inactive on the fullscreen container, the fix uses seat_set_raw_focus to avoid all the additional behaviour that comes with it such as destroying the old workspace.
2018-10-21cmd_reload: recalc font sizing + rebuild texturesBrian Ashworth
When the config gets reloaded, the font height and baseline get reset to 0. If the config does not have a font command in it, the variables will remain at 0 causing a transparent area where the title would be rendered. This makes it so the font height and baseline are recalculated. Additionally, since the font height and baseline may have changed due to the reload, the title and marks textures are rebuilt.
2018-10-21Make workspace back_and_forth seat-specificRyan Dwyer
* When using multiple seats, each seat has its own prev_workspace_name for the purpose of workspace back_and_forth. * Removes prev_workspace_name global variable. * Removes unused next_name_map function in tree/workspace.c. * Fixes memory leak in seat_destroy (seat was not freed).
2018-10-20Remove raise_floating directiveRyan Dwyer
The directive controlled whether floating views should raise to the top when the cursor is moved over it while using focus_follows_mouse. The default was enabled, which is undesirable. For example, if you have two floating views where one completely covers the other, the smaller one would be inaccessible because moving the mouse over the bigger one would raise it above the smaller one. There is no known use case for having raise_floating enabled, so this patch removes the directive and implements the raise_floating disabled behaviour instead.
2018-10-20Merge pull request #2870 from RyanDwyer/refactor-input-manageremersion
Minor refactor of input manager
2018-10-20Merge pull request #2879 from Emantor/fix/swaybar_positionemersion
swaybar: disallow left and right position and print error on default
2018-10-20commands/bar: remove left and right from allowed positionsRouven Czerwinski
"left" and "right" are not allowed positions for swaybar, remove them.
2018-10-20Minor refactor of input managerRyan Dwyer
The input manager is a singleton object. Passing the sway_input_manager argument to each of its functions is unnecessary, while removing the argument makes it obvious to the caller that it's a singleton. This patch removes the argument and makes the input manager use server.input instead. On a similar note: * sway_input_manager.server is removed in favour of using the server global. * seat.input is removed because it can get it from server.input. Due to a circular dependency, creating seat0 is now done directly in server_init rather than in input_manager_create. This is because creating seats must be done after server.input is set. Lastly, it now stores the default seat name using a constant and removes a second reference to seat0 (in input_manager_get_default_seat).
2018-10-19Introduce cursor_rebaseRyan Dwyer
This function "rebases" the cursor on top of whatever is underneath it, without triggering any focus changes.
2018-10-19Merge pull request #2875 from RedSoxFan/input-device-bindingsDrew DeVault
cmd_bind{sym,code}: Implement per-device bindings
2018-10-19Consider cursor warp when switching workspacesRyan Dwyer
Fixes a regression introduced in 24a90e5d86441fc345356eb3767e5a6880dcedbd. consider_warp_to_focus has been renamed to seat_consider_warp_to_focus, moved to seat.c and made public. It is now called when switching workspaces via `workspace <ws>`.
2018-10-18cmd_bind{sym,code}: Implement per-device bindingsBrian Ashworth
bindsym --input-device=<identifier> ... bindcode --input-device=<identifier> ...
2018-10-18Remove cursor warping from seat_set_focusRyan Dwyer
Because cursor warping was the default behaviour in seat_set_focus, there may be cases where we may have been warping the cursor unintentionally. This patch removes cursor warping from seat_set_focus and only does it in the focus command. This is managed by a static function in focus.c. To know whether to warp or not, we need to know which node had focus previously. To keep track of this easily, seat->prev_focus has been introduced and is set to the previous in seat_set_focus.
2018-10-17Merge pull request #2858 from RyanDwyer/fix-move-to-floating-wsDrew DeVault
Fix moving tiled containers to workspaces which only have floating views