aboutsummaryrefslogtreecommitdiffstats
path: root/sway
Commit message (Collapse)AuthorAge
* 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 #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
| * | | seat_cmd_cursor: work on seat name providedLibravatar Brian Ashworth2018-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of simulating events on the current seat, this makes it so seat_cmd_cursor respects the seat name provided by `seat <name> cursor <args>`. It also adds support for simulating events on all seats when the wildcard is given. This also defers the command when reading the config, which allows the user to set the initial position of the cursor when the command is included in the config file.
* | | | Add data-control-v1Libravatar emersion2019-01-07
| | | |
* | | | seat: unhide the cursor if it is warped to focusLibravatar Rouven Czerwinski2019-01-07
| | | | | | | | | | | | | | | | | | | | | | | | Unhide the cursor if container warping is enabled. Also set the image_surface to NULL during view_unmap, otherwise the cursor will try to access the surface which is currently being unmapped.
* | | | view: use seat_consider_warp_to_focus in view_unmapLibravatar Rouven Czerwinski2019-01-07
| | | | | | | | | | | | | | | | | | | | The view_unmap function contained an open coded version of seat_consider_warp_to_focus, replace it with a call to the function.
* | | | cursor: move unhide and timeout retrieval into separate functionsLibravatar Rouven Czerwinski2019-01-07
| | | | | | | | | | | | | | | | | | | | The unhide and timeout retrieval functions are needed in a later commit. No functional changes.
* | | | Use %z for printing size_tLibravatar Jan Beich2019-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ../sway/desktop/transaction.c:367:17: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] transaction, transaction->num_waiting); ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/wlr/util/log.h:56:72: note: expanded from macro 'wlr_log' _wlr_log(verb, "[%s:%d] " fmt, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) ^~~~~~~~~~~ ../sway/desktop/transaction.c:477:5: error: format specifies type 'long' but the argument has type 'unsigned int' [-Werror,-Wformat] transaction->num_configures - transaction->num_waiting + 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/wlr/util/log.h:56:72: note: expanded from macro 'wlr_log' _wlr_log(verb, "[%s:%d] " fmt, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) ^~~~~~~~~~~ ../sway/desktop/transaction.c:478:5: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] transaction->num_configures, ms, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/wlr/util/log.h:56:72: note: expanded from macro 'wlr_log' _wlr_log(verb, "[%s:%d] " fmt, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) ^~~~~~~~~~~
* | | | Fix urgency documentationLibravatar Ryan Dwyer2019-01-05
| |_|/ |/| |
* | | Fixed formulations.Libravatar PlusMinus02019-01-04
| | |
* | | Update sway-output.5.scdLibravatar PlusMinus02019-01-04
| | | | | | | | | Some more clarifications because it seems scale questions are recurring.
* | | Apply tiling_drag_threshold to all containersLibravatar David962019-01-03
| | |
* | | Implement tiling_drag_thresholdLibravatar Brian Ashworth2019-01-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implements `tiling_drag_threshold <threshold>` to prevent accidental dragging of tiling containers. If a container (and all of its descendants) are unfocused and the tile bar is pressed, a threshold will be used before actually starting the drag. Once the threshold has been exceeded, the cursor will change to the grab icon and the operation will switch from `OP_MOVE_TILING_THRESHOLD` to `OP_MOVE_TILING`.
* | | Fix fullscreen view rendering crashLibravatar Mack Straight2019-01-01
| |/ |/| | | | | | | | | | | See issue #3359 for reproduction details. When a fullscreen view is unmapped and there's a preceding transaction waiting, there may be neither a saved buffer or a surface to render. This change matches the equivalent code in render_view.
* | swaybar: do not create tray if hiddenLibravatar Ian Fan2018-12-31
| |
* | swaybar: implement tray configLibravatar Ian Fan2018-12-31
| |
* | Apply implicit fallback seat configLibravatar Brian Ashworth2018-12-31
| | | | | | | | | | | | The implicit fallback seat config needs to be applied (if created). Otherwise, the input devices will still be removed from the implicit default seat on reload when there is any seat config.
* | Set font options when computing text width.Libravatar John Chen2018-12-31
| | | | | | | | Fix #2869
* | Undocument SWAY_CURSOR_THEME and SWAY_CURSOR_SIZELibravatar emersion2018-12-31
| | | | | | | | | | | | | | | | These are not yet implemented, and will be exposed as a configuration command rather than env variables when implemented. This also adds a reference to sway-input(5) in xkb env configuration. Maybe we should just un-document these instead.
* | hide_cursor: change to a seat subcommandLibravatar Brian Ashworth2018-12-30
| | | | | | | | | | This makes hide_cursor a seat subcommand, which allows for seat specific timeouts.
* | Verify seat fallback settings on reloadLibravatar Brian Ashworth2018-12-30
|/ | | | | | | | | | | | | This fixes an issue where on reload, all input devices that were added via an implicit fallback to the default seat would be removed from the default seat and applications would crash due to the seat having no capabilities. On reload, there is a query for a seat config with the fallback setting set (it can either be true or false). If no such seat config exists, the default seat is created (if needed) and has the implicit fallback true applied to its seat config. This is the same procedure that occurs when a new input is detected.
* Revamp seat configsLibravatar Brian Ashworth2018-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes seat configs work like output and input configs do. This also adds support for wildcard seat configs. A seat config is still created in the main seat command handler, but instead of creating a new one in the subcommands and destroying the main seat command's instance, the seat subcommands modify the main one. The seat config is then stored, where it is merged appropriately. The seat config returned from `store_seat_config` is then applied. When attempting to apply a wildcard seat config, a seat specific config is queried for and if found, that is used. Otherwise, the wildcard config is applied directly. Additionally, instead of adding input devices to the default seat directly when there is no seat configs, a seat config for the default seat is created with only fallback set to true, which is more explicit. It also fixes an issue where running a seat command at runtime (with no seat config in the sway config), would result in all input devices being removed from the default seat and leaving sway in an unusable state. Also, instead of checking for any seat config, the search is for a seat config with a fallback option seat. This makes it so if there are only seat configs with fallback set to -1, the default seat is still created since there is no explicit notion on what to do regarding fallbacks. However, if there is even a single fallback 0, then the default seat is not used as a fallback. This will be needed for seat subcommands like hide_cursor where the user may only want to set that property without effecting anything else.
* sway-output(5): doc scaling consideration for posLibravatar Brian Ashworth2018-12-29
| | | | | This copies the information regarding positioning outputs when there is scaling involved from the wiki to sway-output(5).
* Add failure reply on IPC_SYNCLibravatar Brian Ashworth2018-12-29
| | | | | Since it was decided that sway will not support IPC_SYNC, just return `{'success': false}` as a reply
* Remove button from state on release during opLibravatar Brian Ashworth2018-12-29
| | | | | | | This fixes a bug in `dispatch_cursor_button` where if there was an operation occurring, the button would not be removed from the state on release. This resulted in the button appearing to be permanently pressed and caused mouse bindings to not match correctly.
* Merge pull request #3346 from ermo/sway-bar_focused_statusline_colour-render-fixLibravatar Drew DeVault2018-12-29
|\ | | | | swaybar: fix focused_statusline color parsing.