aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input
Commit message (Collapse)AuthorAge
...
| * relative-pointer-v1: time is in usec, not msecLibravatar emersion2019-01-30
| |
* | pointer_constraint: change to a seat subcommandLibravatar Brian Ashworth2019-01-31
|/ | | | | | | | | | | | 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.
* Send pointer frames on tool eventsLibravatar Drew DeVault2019-01-30
|
* Missed a spot in pointer constraintsLibravatar Drew DeVault2019-01-30
|
* Add pointer_constraint commandLibravatar Drew DeVault2019-01-30
|
* Add relative pointerLibravatar absrd2019-01-30
|
* Implement pointer-constraints-unstable-v1Libravatar Las2019-01-30
|
* Merge pull request #3423 from RyanDwyer/fullscreen-globalLibravatar Drew DeVault2019-01-27
|\ | | | | Implement fullscreen global
| * Implement fullscreen globalLibravatar Ryan Dwyer2019-01-25
| |
* | Update for swaywm/wlroots#1503Libravatar emersion2019-01-27
| |
* | Use sway_log_errno instead of strerrorLibravatar Ian Fan2019-01-24
|/
* Update for swaywm/wlroots#1402Libravatar emersion2019-01-24
|
* seat_create: set initial focus for added seatsLibravatar Brian Ashworth2019-01-22
| | | | | | This sets the initial focus for all seats other than the first seat, which gets it focus on launch. The ensures that all seats have something focused.
* Move sway-specific functions in common/util.c into sway/Libravatar M Stoeckl2019-01-21
| | | | | | Modifier handling functions were moved into sway/input/keyboard.c; opposite_direction for enum wlr_direction into sway/tree/output.c; and get_parent_pid into sway/tree/root.c .
* Fix one remaining wlr_log callLibravatar emersion2019-01-21
|
* Replace wlr_log with sway_logLibravatar M Stoeckl2019-01-21
| | | | | | | | | | | | | This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
* Log libinput_config_status errorsLibravatar Brian Ashworth2019-01-21
| | | | | | This add errors from calls to `libinput_device_config_*_set` to the debug log. This may be useful when looking at issues related to input devices and config settings not working.
* Fix crash in cursor_rebase with multiple screensLibravatar emersion2019-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Designing the output configuration sequence without invalid state is tricky. We have one function, apply_output_config, that takes an output and (besides other things) performs a modeset and inserts the output in the output layout. The modeset can fail, in which case we don't want the output to be enabled. We also have an output_enable function, which calls output_apply_config and also configures the output's workspace and inserts it in the root container. Now, we have two choices. Either we configure the output before it's been inserted in the root container and then, if the modeset was successful, we insert it and create the workspace. The main issue with this approach is that configuring the output triggers a handful of signals, namely wlr_output.mode and wlr_output_layout.change. In those event handlers, we need to make sure to ignore these outputs in the process of being configured. Either we first insert the output, create the workspace and then try to configure it. It means we need to undo everything if the modeset fails. The main issue with this solution is that it enables and disables the output very quickly, creates a workspace and immediately destroys it, and maybe moves views back and forth (see output_evacuate). I've tried to make it so an output isn't enabled then immediately disabled. We already have code for ignoring outputs when the output is being destructed. Fixes https://github.com/swaywm/sway/issues/3462
* bar_cmd_tray_bind: Use mouse button helpersLibravatar Brian Ashworth2019-01-16
| | | | | | | | | | | | | | | | This modifies `bar_cmd_tray_bindsym` to use `get_mouse_bindsym` for parsing mouse buttons. This also introduces `bar_cmd_tray_bindcode`, which will use `get_mouse_bindcode` for parsing mouse buttons. Like with sway bindings, the two commands are encapsulated in a single file to maximize shared code. This also modifies tray bindings to work off of events codes rather than x11 buttons, which allows for any mouse buttons to be used. For `get_bar_config`, `event_code` has been added to the `tray_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`.
* seatop_begin_down: raise floatingLibravatar Brian Ashworth2019-01-15
| | | | | In `seatop_begin_down`, raise the floating container. This appears to have been dropped in the transition to seatops.
* cursor: send clear_focus on hide and enter event on unhideLibravatar Rouven Czerwinski2019-01-15
| | | | | | | | | | | | Clear the focus when we hide the cursor and show it again during the unhide action. The unhide function will rebase the cursor after the unhide. Tested by looking at the WAYLAND_DEBUG=1 output of termite. Also call cursor_handle_activity before sending pointer events to send the enter events to the surface if the cursor was hidden before. Fixes #3431
* Resize only current and immediate siblings rather than all siblingsLibravatar Ryan Dwyer2019-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | For example, create layout V[view view view] and resize the leftmost view using mod+rightclick. Previously, the edge between view 2 and 3 would be adjusted as well. Now this edge will remain constant, which matches the behaviour of i3. To do this operation correctly, the resize tiling seatop now keeps track of two containers, as the container that resizes horizontally will be a different container to the one which resizes vertically (one will be an ancestor). The tiling resize seatop now figures out these containers during the start of the operation and keeps references to them in the event. A new function container_find_resize_parent has been introduced to do this. This function is also used by the resize command. During cursor motion, the seatop logic is similar to before, but now has to choose the correct container to resize. In resize.c, container_resize_tiled and resize_tiled have been merged into one. One of them originally did nothing except pass the values through to the other. container_resize_tiled now takes a simplified approach where it just finds the immediate siblings on either side and resizes them without worrying about the others. The parellel_coord and parallel_size functions are no longer needed and have been removed.
* Disarm key repeat on reloadLibravatar Brian Ashworth2019-01-14
| | | | | | When resetting the keyboard during reload, disarm the key repeat on all keyboards since the bindings (and possibly keyboard) will be freed before the key repeat can go off.
* 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 #3341 from RedSoxFan/mouse-bindings-improvedLibravatar Ian Fan2019-01-10
|\ \ | | | | | | Improve mouse button parsing: helpers and bind{code/sym}
| * | 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.
* 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> ^~~~~~~~~~~~~~~~~~~~~~~~~~~
* 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
| * | stringop.c: rewrite strip_whitespaceLibravatar Ian Fan2019-01-01
| | |
* | | 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.
* | | 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.
* | 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`.
* 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.
* 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.