summaryrefslogtreecommitdiffstats
path: root/sway
Commit message (Collapse)AuthorAge
* Remove 'input' field of IPC command return jsonLibravatar M Stoeckl2019-01-14
| | | | | | | | This field is not in i3 and provides imprecise and redundant information. (Specifically, when swaymsg is given a list of commands, the IPC return array already indicates precisely which number command failed; knowing the name of the command is not useful when multiple commands of the same type are provided.)
* Use uint32_t where resize axis might contain a bitfieldLibravatar Ryan Dwyer2019-01-14
|
* Replace resize_axis with wlr_edgesLibravatar Ryan Dwyer2019-01-14
| | | | | | | | | | | This patch removes the resize_axis enum in favour of wlr_edges. As wlr_edges has no `horizontal` or `vertical` value, it denotes these by bitwise `or`ing the left/right and up/down values. Two constants are defined to make it easier to refer to these. This will allow the tiling resize seatop to utilise the functions in this file. resize_axis was local to the resize command and couldn't be exposed in function arguments.
* Merge pull request #3144 from emersion/cmd-xwaylandLibravatar Drew DeVault2019-01-13
|\ | | | | Add xwayland command
| * Add xwayland commandLibravatar emersion2018-11-19
| |
* | Merge pull request #3344 from RedSoxFan/bar-mouse-bindings-improvedLibravatar Drew DeVault2019-01-13
|\ \ | | | | | | Improve mouse button parsing: bar mouse bindings
| * | bar_cmd_bind: utilize mouse button helpersLibravatar Brian Ashworth2019-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies `bar_cmd_bindsym` to use `get_mouse_bindsym` for parsing mouse buttons. This also introduces `cmd_bar_bindcode`, which will use `get_mouse_bindcode` for parsing mouse buttons. Like sway bindings, the two commands are encapsulated in a single file with shared code. This also modifies swaybar to operate off of event codes rather than x11 button numbers, which allows for any mouse button to be used. This introduces two new IPC properties: - For `get_bar_config`, `event_code` has been added to the `bindings` section and will include to event code for the button. If the event code can be mapped to a x11 button, `input_code` will still be the x11 button number. Otherwise, `input_code` will be `0`. - Likewise for `click_events`, `event` has been added and will include the event code for the button clicked. If the event code can be mapped to a x11 button, `button` will still be the x11 button number. Otherwise, `button` will be `0`.
* | | Merge pull request #3343 from RedSoxFan/seat-cursor-buttons-improvedLibravatar Drew DeVault2019-01-13
|\ \ \ | | | | | | | | Improve mouse button parsing: seat cursor buttons
| * | | seat_cmd_cursor: utilize mouse button helpersLibravatar Brian Ashworth2019-01-10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies `seat_cmd_cursor` to utilize `get_mouse_button` when parsing mouse buttons for the `press` and `release` operations. All x11 buttons, button event names, and button event codes are supported. For x11 axis buttons, `dispatch_cursor_axis` is used instead of `dispatch_cursor_button`. However the `press`/`release` state is ignored and the either axis event is processed. This also removes support for `left` and `right` in favor of `BTN_LEFT` and `BTN_RIGHT`.
* | | Merge pull request #3342 from RedSoxFan/scroll-buttons-improvedLibravatar Drew DeVault2019-01-13
|\ \ \ | | | | | | | | Improve mouse button parsing: input scroll_button
| * | | input_cmd_scroll_button: utilize mouse btn helpersLibravatar Brian Ashworth2019-01-10
| |/ / | | | | | | | | | | | | | | | | | | | | | This modifies `input_cmd_scroll_button` to utilize the mouse button helper `get_mouse_button` when parsing the button. x11 axis buttons are not supported with this command and `CMD_INVALID` will be returned, but all other x11 buttons, button event names, and button event codes should be working
* | | Merge pull request #3402 from RyanDwyer/refactor-seatopsLibravatar Drew DeVault2019-01-13
|\ \ \ | | | | | | | | Refactor seat operations to use an interface
| * | | Refactor seat operations to use an interfaceLibravatar Ryan Dwyer2019-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This splits each seat operation (drag/move tiling/floating etc) into a separate file and introduces a struct sway_seatop_impl to abstract the operation. The move_tiling_threshold operation has been merged into move_tiling. The main logic for each operation is untouched aside from variable renames. The following previously-static functions have been made public: * node_at_coords * container_raise_floating * render_rect * premultiply_alpha * scale_box
* | | | Merge pull request #3388 from RedSoxFan/reset-inputs-on-reloadLibravatar Drew DeVault2019-01-13
|\ \ \ \ | | | | | | | | | | reload: reset input configs
| * | | | reload: reset input configsLibravatar Brian Ashworth2019-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | This resets all input options to their defaults on reload. This also fixes some debug log typos in `input_manager_libinput_config_pointer`.
* | | | | Merge pull request #3397 from RedSoxFan/fix-swaybar-heightLibravatar Drew DeVault2019-01-13
|\ \ \ \ \ | | | | | | | | | | | | swaybar: obey height if given
| * | | | | swaybar: obey height if givenLibravatar Brian Ashworth2019-01-09
| |/ / / / | | | | | | | | | | | | | | | | | | | | If there is a bar height given, use that as the height rather than as a minimum height. This matches i3-gaps behavior.
* | | | | Merge pull request #3398 from RedSoxFan/toggle-input-eventsLibravatar Drew DeVault2019-01-13
|\ \ \ \ \ | | | | | | | | | | | | input events: toggle and ipc get_inputs
| * | | | | get_inputs: add libinput send events modeLibravatar Brian Ashworth2019-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add `libinput_send_events` to the IPC output for `get_inputs` to allow scripting of mode changes.
| * | | | | input_cmd_events: implement toggleLibravatar Brian Ashworth2019-01-09
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements toggling input events during runtime. This will not attempt to toggle to a mode that is not supported by the device. When toggling the wildcard input, the device specific input configs are altered. Each device will cycle one supported mode.
* | | | | Merge pull request #3408 from RedSoxFan/bar-paddingLibravatar Drew DeVault2019-01-13
|\ \ \ \ \ | | | | | | | | | | | | swaybar: adjustable status padding
| * | | | | swaybar: add status_edge_padding commandLibravatar Brian Ashworth2019-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the bar subcommand `status_edge_padding <padding>` to set the padding used when the status line is on the right edge of the bar.
| * | | | | swaybar: add status_padding commandLibravatar Brian Ashworth2019-01-11
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | Adds the bar subcommand `status_padding <padding>` which allows setting the padding used for swaybar. If `status_padding` is set to `0`, blocks will be able to take up the full height of the bar.
* | | | | config: fix line number with continued linesLibravatar Brian Ashworth2019-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the config has continued lines, `get_line_with_cont` may read more than one line of the actual file. When displaying line numbers for error messages, they should be the line number in the file to make it easy to find and fix the issue.
* | | | | config: do not reset pos when braces foundLibravatar Brian Ashworth2019-01-11
|/ / / / | | | | | | | | | | | | | | | | When a brace is found, the config file should not seek back to before the brace, otherwise the brace will be read multiple times.
* | | | Merge pull request #3400 from ianyfan/config-braceLibravatar emersion2019-01-10
|\ \ \ \ | |_|/ / |/| | | config.c: fix brace detection at end of file
| * | | config.c: fix brace detection at end of fileLibravatar Ian Fan2019-01-10
| | | |
* | | | Merge pull request #3341 from RedSoxFan/mouse-bindings-improvedLibravatar Ian Fan2019-01-10
|\ \ \ \ | | | | | | | | | | Improve mouse button parsing: helpers and bind{code/sym}
| * | | | bind{code,sym}: utilize mouse button helpersLibravatar Brian Ashworth2019-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies `bindcode` and `bindsym` to use `get_mouse_bindcode` and `get_mouse_bindsym`, respectively, to parse mouse buttons. Additionally, the `BINDING_MOUSE` type has been split into `BINDING_MOUSECODE` and `BINDING_MOUSESYM` to match keys and allow for mouse bindcodes to be used. Between the two commands, all button syms and codes should be supported, including x11 axis buttons.
| * | | | Add helpers for improved mouse button parsingLibravatar Brian Ashworth2019-01-09
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following helper functions have been added to aid with parsing mouse buttons from a string: 1. `get_mouse_bindsym`: attempts to parse the string as an x11 button (button[1-9]) or as an event name (ex BTN_LEFT or BTN_SIDE) 2. `get_mouse_bindcode`: attempts to parse the string as an event code and validates that the event code is a button (starts with `BTN_`). 3. `get_mouse_button`: this is a conveniency function for callers that do not care whether a bindsym or bindcode are used and attempts to parse the string as a bindsym and then bindcode. None of these functions are used in this commit. The sole purpose of this commit is to make the larger set more granular and easier to review/manipulate. There will be a series of commits following this one that will modify any command which uses a mouse button to use these helpers.
* | | | Merge pull request #3399 from RedSoxFan/fix-output-destruction-segfaultsLibravatar emersion2019-01-10
|\ \ \ \ | | | | | | | | | | Fix segfaults on output destruction
| * | | | Fix segfaults on output destructionLibravatar Brian Ashworth2019-01-10
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two causes of segfaulting when an output is destroyed. The first occurred when an output was never enabled. The issue was that the destroy signal was never initialized so when it was emitted, sway segfaulted. This was fixed by moving the initialization into `output_create` since all outputs, regardless of whether they have ever been enabled, will be destroyed at some point. The second occurred when the cursor was on an output that was being destroyed. The sway output would have already been removed, but if there are other outputs, a cursor rebase would still occur. Since the wlr_output still existed and the sway output was destroyed, the cursor could be over nothing, resulting in a segfault when trying to get the sway output, which was destroyed.
* / / / cursor: allow scrolling tabs/stack on title borderLibravatar Brian Ashworth2019-01-09
|/ / / | | | | | | | | | | | | | | | This allows tabbed and stacked containers to be scrolled through when the cursor is over the border of the title bar. The borders around the other three edges of the contents should not be affected by this change.
* | | Reset container dimensions when moving into workspace from directionLibravatar Ryan Dwyer2019-01-09
| | |
* | | Simplify evdev includes on FreeBSD by relying on up-to-date packageLibravatar Jan Beich2019-01-09
|/ / | | | | | | | | | | | | | | | | | | | | | | evdev-proto is installed by a dependency, so some files have been missed: In file included from ../sway/input/cursor.c:3: /usr/local/include/libevdev-1.0/libevdev/libevdev.h:30:10: fatal error: 'linux/input.h' file not found #include <linux/input.h> ^~~~~~~~~~~~~~~ ../swaybar/i3bar.c:3:10: fatal error: 'linux/input-event-codes.h' file not found #include <linux/input-event-codes.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~
* | Merge pull request #3386 from RedSoxFan/seat-reload-waitLibravatar emersion2019-01-09
|\ \ | | | | | | reload: apply seat cfgs after reading entire cfg
| * | reload: apply seat cfgs after reading entire cfgLibravatar Brian Ashworth2019-01-09
| | | | | | | | | | | | | | | | | | | | | Wait until all seat configs have been read before applying them on reload. This prevents unnecessary attachment/detachment of input devices and therefore creation/destruction of seat devices as individual lines are read.
* | | Merge pull request #3390 from RedSoxFan/execute-seatLibravatar emersion2019-01-09
|\ \ \ | | | | | | | | cmd_bind: pass the seat to execute_command
| * | | cmd_bind: pass the seat to execute_commandLibravatar Brian Ashworth2019-01-09
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | `seat_execute_command` was incorrectly setting `config->handler_context.seat` before calling `execute_command`. Since `execute_command` was being called with a `NULL` seat argument, `execute_command` was setting `config->handler_context.seat` to the default seat. This resulted in all bindings being executed on the default seat and causing undesired behavior for devices on other seats.
* | | Merge pull request #3389 from RedSoxFan/swap-context-seatLibravatar emersion2019-01-09
|\ \ \ | | | | | | | | cmd_swap: use handler context seat
| * | | cmd_swap: use handler context seatLibravatar Brian Ashworth2019-01-09
| |/ / | | | | | | | | | Use the handler context seat instead of the default seat
* / / keyboard: update repeat timer before executionLibravatar Brian Ashworth2019-01-09
|/ / | | | | | | | | | | Since the keyboard can be destroyed by executing a binding (reloading with a different seat attachment config), update the repeat timer before executing the binding.
* | Merge pull request #3385 from robertgzr/reset_output_mappingLibravatar Drew DeVault2019-01-08
|\ \ | | | | | | cursor: allow mapping to all outputs
| * | cursor: allow mapping to all outputsLibravatar Robert Günzler2019-01-09
| | | | | | | | | | | | Running `input "<input>" map_to_output *` resets the mapping to all outputs
* | | Merge pull request #3275 from ianyfan/remove-readlineLibravatar emersion2019-01-08
|\ \ \ | | | | | | | | Rewrite strip_whitespace and remove readline.c
| * | | fixup! config.c: re-enable backslash continuation in config fileLibravatar Ian Fan2019-01-01
| | | |
| * | | config.c: re-enable backslash continuation in config fileLibravatar Ian Fan2019-01-01
| | | |
| * | | Remove readline.cLibravatar Ian Fan2019-01-01
| | | | | | | | | | | | | | | | | | | | All occurrences of read_line have been replaced by getline. peek_line has been absorbed into detect_brace.
| * | | stringop.c: rewrite strip_whitespaceLibravatar Ian Fan2019-01-01
| | | |
* | | | Merge pull request #3337 from RedSoxFan/fix-seat-cmd-cursorLibravatar emersion2019-01-08
|\ \ \ \ | | | | | | | | | | seat_cmd_cursor: work on seat name provided