aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
AgeCommit message (Collapse)Author
2019-03-27bindings: fix overwrite log argument mismatchJan Pokorný
Thanks, @RedSoxFan, for the review spotting another instance.
2019-03-26Fix crash for floating command on scratchpad windowAshkan Kiani
2019-03-24Implement inhibit_idle commandBrian Ashworth
This implements the following command to set/unset a user idle inhibitor for a view: `inhibit_idle focus|fullscreen|open|none|visible` The modes are as follows: - focus: inhibited when the view is focused by any seat - fullscreen: inhibited when the view is fullscreen (or a descendant of a fullscreen container) and is visible on any output - open: inhibited until the view is closed or the inhibitor is unset or changed - none: unsets any user set idle inhibitors for the view - visible: inhibited when the view is visible on any output This should have no effect on idle inhibitors set by the applications themselves and those should still work as intended. Since this operates on the view in the handler context, it is possible to set it on the currently focused view, on any existing view with criteria, or for any future view with for_window.
2019-03-24Add support for manually setting subpixel hinting on outputs.Geoff Greer
Many laptop screens report unknown subpixel order. Allow users to manually set subpixel hinting to work around this. Addresses https://github.com/swaywm/sway/issues/3163
2019-03-23Allow for workspace renaming during exec handlingmliszcz
This change adds support for renaming a workspace when `exec` command is being processed by keeping sway_workspace and pid_workspace names in sync. The change can be verified by running following command: swaymsg exec <application>; swaymsg rename workspace number 1 to 5 Fixes: #3952
2019-03-23cmd_mode: allow cmd_set to be a subcommandBrian Ashworth
This allows set to be used in mode blocks
2019-03-20Support focus <direction> for floating containersRyan Dwyer
This kind of worked before in that focus would change, but it wasn't intentionally supported and had side effects such as not raising the container, and being unable to cycle through all floaters depending on the direction used. This commit makes it properly supported. The new focus is chosen based on the distance to the center point of each floating container in the workspace, and the container is raised. In a multi output setup, if both visible workspaces have floating containers, focus will NOT cross into the other output. It is assumed the user will use a workspace binding in this case. If two floating containers occupy the exact same center point and you try to focus in a direction, the behaviour is undefined.
2019-03-19Support WLR_INPUT_DEVICE_SWITCH in swayRyan Walklin
This commit adds support for laptop lid and tablet mode switches as provided by evdev/libinput and handled by wlroots. Adds a new bindswitch command with syntax: bindswitch <switch>:<state> <command> Where <switch> is one of: tablet for WLR_SWITCH_TYPE_TABLET_MODE lid for WLR_SWITCH_TYPE_LID <state> is one of: on for WLR_SWITCH_STATE_ON off for WLR_SWITCH_STATE_OFF toggle for WLR_SWITCH_STATE_TOGGLE (Note that WLR_SWITCH_STATE_TOGGLE doesn't map to libinput and will trigger at both on and off events)
2019-03-15output_cmd_background: validate colorsBrian Ashworth
This validates the color and fallback color in `output_cmd_background` to ensure that only colors of the form `#RRGGBB` are accepted.
2019-03-12Handle seat_get_focused_workspace returning NULLBrian Ashworth
This modifiers the callers of seat_get_focused_workspace to handle getting NULL as the return value, if they did not already.
2019-03-11commands: allow tiled sticky containers to be movedIan Fan
Namely, to a workspace on the same output. However, tiled sticky children of floating containers are still restricted.
2019-03-10Fix crash in cmd_workspace when layer surface has focusemersion
2019-03-02floating_maximum_size: change default behaviorBrian Ashworth
This changes the way zero (which is the default) is interpreted for both the width and height of `floating_maximum_size`. It now refers to the width and height of the entire output layout, which matches i3's behavior. This also removes duplicated code to calculate the floating constraints in three files. Before this, `container_init_floating` used two-thirds of the workspace width/height as the max and the entire workspace width/height was used everywhere else. Now, all callers use a single function `floating_calculate_constraints`.
2019-02-25Allow 0 degree transform (normal transform).Connor E
2019-02-24swaybar: add overlay mode (fix #1620)Milkey Mouse
Overlay mode puts the bar above normal windows and passes through/ignores any touch/mouse/keyboard events that would be sent to it.
2019-02-24add --i3 flag to hide_edge_bordersdb
Enables i3-compatible behavior regarding hiding the title bar on tabbed and stacked containers with one child. Related issues and merge requests: #3031, #3002, #2912, #2987.
2019-02-24Make load_include_configs void. Fix some cases where WD would not be restored.Connor E
2019-02-22move scratchpad: hide visible scratchpad containerBrian Ashworth
This makes it so running `move [to] scratchpad` on a container already in the scratchpad does not return an error. To match i3's behavior, a visible scratchpad container will be hidden and a hidden scratchpad container will be treated as a noop.
2019-02-22commands/move: reintroduce wrongly removed NULL checkRouven Czerwinski
Commit d3d7956576341bbbfb60d045175b0e8a44752e0b removed this NULL check, which leads to the following backtrace: #0 0x0000557bd201df46 in node_is_view (node=0x0) at ../sway/sway/tree/node.c:41 #1 0x0000557bd1ff5d4e in seat_get_focus_inactive (seat=0x557bd3fc7580, node=0x0) at ../sway/sway/input/seat.c:968 current = 0x557bd2033485 #2 0x0000557bd2009f24 in cmd_move_container (argc=3, argv=0x557bd46b19c0) at ../sway/sway/commands/move.c:557 new_output_last_focus = 0x0 error = 0x0 node = 0x557bd469f360 workspace = 0x557bd4572ee0 container = 0x557bd469f360 no_auto_back_and_forth = false seat = 0x557bd3fc7580 old_parent = 0x0 old_ws = 0x557bd4572ee0 old_output = 0x557bd411f740 destination = 0x557bd46a0cc0 new_output = 0x557bd411f740 new_output_last_ws = 0x0 focus = 0x557bd469f360 __PRETTY_FUNCTION__ = "cmd_move_container" new_workspace = 0x557bd4572ee0 […] Reintroduce the NULL check to fix the bug. Fixes #3746
2019-02-21Handle NULL from output_get_active_workspaceBrian Ashworth
This modifies the places where output_get_active_workspace is called to handle a NULL result. Some places already handled it and did not need a change, some just have guard off code blocks, others return errors, and some have sway_asserts since the case should never happen. A lot of this is probably just safety precautions since they probably will never be called when `output_get_active_workspace` is not fully configured with a workspace.
2019-02-19layout cmd: always operate on parent container, like i3Fixes #3724Eric Drechsel
2019-02-18Merge pull request #3712 from RedSoxFan/fix-typo-seat-cursorDrew DeVault
seat_cmd_cursor: fix typo in expected syntax
2019-02-17Use container under cursor for mouse bindingsBrian Ashworth
This matches i3's behavior of executing mouse bindings in regards to the container under the cursor instead of what is focused.
2019-02-17seat_cmd_cursor: fix typo in expected syntaxBrian Ashworth
This just fixes a typo in the expected syntax for seat_cmd_cursor
2019-02-17Add workspace {prev,next}_on_output --createDrew DeVault
This creates the next workspace if you hit the end.
2019-02-12Don't remove from scratchpad on move to workspaceathrungithub
on move container window to another workspace, not remove from scratchpad.
2019-02-11fix misc memory leaksBrian Ashworth
This fixes a few misc memory leaks reported by asan: - Items of `config->config_chain` are now freed instead of just the list itself - `bar->swaybar_command` is now freed - The result returned by a seat subcommand is now returned instead of leaked
2019-02-10fix double free for mode toggle if bar was invisibleRouven Czerwinski
If the bar was set to "invisible" and subsequently "toggle" was send twice, the new mode was never set and the bar->mode was double freed. Fix this by not requiring the bar->mode to be "hide" and instead show it unconditionally, because it was either hidden or invisible. Fixes #3637
2019-02-08bar_cmd_modifier: add support for noneBrian Ashworth
sway-bar(5) documents `modifier none`, which comes from i3. This implements the functionality for `modifier none` since it was not previously implemented. The bar modifier toggles visibility of the bar when the bar mode is set to hide. When the bar modifier is set to `none`, the ability to toggle visibility of the bar will be disabled.
2019-02-05output_cmd_background: fix no file + valid modeBrian Ashworth
If output_cmd_background is given a valid mode as the first argument, then there is no file given and an error should be returned. join_args should not be called with an argc of zero since it sets the last character to the null terminator. With an argc of zero, the length is zero causing a heap buffer overflow when setting the byte before the start of argv to '\0'. This probably will not ever generate a segfault, but may cause data corruption to whatever is directly before it in memory. To make other such cases easier to detect, this also adds a sway_assert in join_args when argc is zero.
2019-02-05cmd_workspace_gaps: fix double free on bad amountBrian Ashworth
This fixes a double free in cmd_workspace_gaps when the amount given is invalid. The end pointer from strtol is part of the argument and should not be freed. Freeing the end pointer could result in a double free or bad free depending on whether or not the end pointer was at the start of the argument
2019-02-03seat_cmd_cursor: do not create non-existing seatBrian Ashworth
If a seat does not exist in seat_cmd_cursor, do not create it. A seat without any attachments is useless since it will have no capabilities. This changes `input_manager_get_seat` to have an additional argument that dictates whether or not to create the seat if it does not exist.
2019-02-02cmd_seat: allow - to be used as alias for currentBrian Ashworth
This allows for `-` (hyphen) to be used as an alias for the current seat while sway is running. This alias was chosen since it is unlikely to interfere with any desirable seat identifier
2019-02-03seat_cmd_attach: defer while readingBrian Ashworth
Since the seats and inputs are not yet available while the config is being read, defer seat attachment requests
2019-01-31pointer_constraint: change to a seat subcommandBrian Ashworth
This changes the `pointer_constraint` command to be a subcommand of seat to allow for per-seat settings. The current implementation that is not a seat subcommand will only operate on the current seat and will segfault in the config due to `config->handler_context.seat` only being set at runtime. This also allows for the wildcard identifier to be used to alter the pointer constraint settings on all seats and allows for the setting to be merged with the rest of the seat config.
2019-01-30Add pointer_constraint commandDrew DeVault
2019-01-30criteria & scratchpad verify if show in another workspace (#3522)athrungithub
check if scratchpad is show in another workspace
2019-01-28Introduce container_is_scratchpad_hiddenRyan Dwyer
Just a convenience function that improves readability of the code. Other things worth noting: * container_get_siblings and container_sibling_index no longer use the const keyword * container_handle_fullscreen_reparent is only ever called after attaching the container to a workspace, so its con->workspace check has been changed to an assertion
2019-01-27Merge pull request #3423 from RyanDwyer/fullscreen-globalDrew DeVault
Implement fullscreen global
2019-01-25Implement fullscreen globalRyan Dwyer
2019-01-24Use sway_log_errno instead of strerrorIan Fan
2019-01-22Fix dead stores found by scan-buildM Stoeckl
In addition to removing unused code, two minor problems are fixed: (1) `resize set` and `resize adjust` did not error when given too many arguments. (2) `orientation` was incorrectly overridden to be 'U' for scroll events in the swaybar tray `handle_click` function.
2019-01-22Merge pull request #3494 from ianyfan/commandsDrew DeVault
i3 command behaviour compatibility fixes
2019-01-22root_scratchpad_remove_container: do not showBrian Ashworth
This removes the call to `root_scratchpad_show` from `root_scratchpad_remove_container` and places it in the `cmd_move_container`. This also moved the IPC `window::move` event to `cmd_scratchpad`.
2019-01-22util.c: remove numlen functionIan Fan
Its uses have been replaced by snprintf, which is more in line with its usage.
2019-01-22commands: allow setting floating on scratchpad containersIan Fan
2019-01-22commands: allow tiled containers to be stickiedIan Fan
This also stops stickied containers from losing its sticky status when it is tiled, allowing it to be immediately stickied when floated again.
2019-01-22Remove assumption that noop output will be called NOOP-1Ryan Dwyer
2019-01-22Don't allow noop output to be configuredRyan Dwyer
2019-01-22Prevent noop output from being enabledRyan Dwyer