aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/input/cursor.h
Commit message (Collapse)AuthorAge
* Rebase cursor when a layer surface mapsLibravatar emersion2019-02-18
| | | | | | | Also removes an extraneous arrange_outputs call, it's already called if necessary in arrange_layers. Updates https://github.com/swaywm/sway/issues/3080
* Implement pointer-constraints-unstable-v1Libravatar Las2019-01-30
|
* Update for swaywm/wlroots#1503Libravatar emersion2019-01-27
|
* 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`.
* 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`.
* | 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
* 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.
* 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.
* hide_cursor: change to a seat subcommandLibravatar Brian Ashworth2018-12-30
| | | | | This makes hide_cursor a seat subcommand, which allows for seat specific timeouts.
* Split image_surface handling into own functionLibravatar Brian Ashworth2018-12-25
|
* Implement hide_cursor <timeout> commandLibravatar Brian Ashworth2018-12-25
| | | | | Allows the cursor to be hidden after a specified timeout in milliseconds
* Change mouse buttons to x11 map and libevdev namesLibravatar Brian Ashworth2018-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies the way mouse bindings are parsed. Instead of adding to BTN_LEFT, which results in button numbers that may not be expected, buttons will be parsed in one of the following ways: 1. `button[1-9]` will now map to their x11 equivalents. This is already the case for bar bindings. This adds support for binding to axis events, which was not possible in the previous approach. 2. Anything that starts with `BTN_` will be parsed as an event code name using `libevdev_event_code_from_name`. This allows for any button to be mapped to instead of limiting usage to the ones near BTN_LEFT. This also adds a dependency on libevdev, but since libevdev is already a dependency of libinput, this should be fine. If needed, this option can have dependency guards added. Binding changes: - button1: BTN_LEFT -> BTN_LEFT - button2: BTN_RIGHT -> BTN_MIDDLE - button3: BTN_MIDDLE -> BTN_RIGHT - button4: BTN_SIDE -> SWAY_SCROLL_UP - button5: BTN_EXTRA -> SWAY_SCROLL_DOWN - button6: BTN_FORWARD -> SWAY_SCROLL_LEFT - button7: BTN_BACK -> SWAY_SCROLL_RIGHT - button8: BTN_TASK -> BTN_SIDE - button9: BTN_JOYSTICK -> BTN_EXTRA Since the axis events need to be mapped to an event code, this uses the following mappings to avoid any conflicts: - SWAY_SCROLL_UP: KEY_MAX + 1 - SWAY_SCROLL_DOWN: KEY_MAX + 2 - SWAY_SCROLL_LEFT: KEY_MAX + 3 - SWAY_SCROLL_RIGHT: KEY_MAX + 4
* Introduce cursor_rebaseLibravatar Ryan Dwyer2018-10-19
| | | | | This function "rebases" the cursor on top of whatever is underneath it, without triggering any focus changes.
* cmd_bind{sym,code}: Implement per-device bindingsLibravatar Brian Ashworth2018-10-18
| | | | | bindsym --input-device=<identifier> ... bindcode --input-device=<identifier> ...
* cursor: functions to warp cursor to container and workspaceLibravatar Rouven Czerwinski2018-10-16
| | | | | | The new functions allow a cursor to be warped without changing the focus. This is a preparation commit to handle cursor warping not only in seat_set_focus_warp.
* Fix focusing topmost floating windowsLibravatar Jonathan Buch2018-10-03
| | | | | | | | | | | | Re-focus on the container on which the cursor hovers over. A special case is, if there are menus or other subsurfaces open in the focused container. It will prefer the focused container as long as there are subsurfaces. This commit starts caching the previous node as well as the previous x/y cursor position. Re-calculating the previous focused node by looking at the current state of the cursor position does not work, if the environment changes.
* Invoke mouse bindingsLibravatar frsfnrrg2018-07-23
| | | | | | | | | | | | | | | | The mouse binding logic is inspired/copied from the keyboard binding logic; we store a sorted list of the currently pressed buttons, and trigger a binding when the currently pressed (or just recently pressed, in the case of a release binding) buttons, as well as modifiers/container region, match those of a given binding. As the code to execute a binding is not very keyboard specific, keyboard_execute_command is renamed to seat_execute_command and moved to where the other binding handling functions are. The call to transaction_commit_dirty has been lifted out.
* Prevent re-uploading the same cursor image multiple timesLibravatar Ryan Dwyer2018-07-22
|
* Move previous cursor_position inline.Libravatar Scott Leggett2018-05-28
|
* Store previous position in sway_cursor.Libravatar Scott Leggett2018-05-28
|
* Focus containers only on entry.Libravatar Scott Leggett2018-05-27
|
* Fix border commands from changing focusLibravatar Brian Ashworth2018-05-20
|
* Default to current time when triggering cursor eventsLibravatar emersion2018-04-21
|
* Clean up cursor simulation code.Libravatar Danny Bautista2018-04-10
|
* Implement cursor event simulation with sway commands.Libravatar Danny Bautista2018-04-10
|
* Fix cursor motion issuesLibravatar Drew DeVault2018-04-08
| | | | | | | Use only one canonical cursor x/y position and send cursor enter when mouse is warped. Tangentally related to #1714
* Implement tablet tool supportLibravatar Drew DeVault2018-04-08
|
* Handle set_cursor requests from clientsLibravatar emersion2018-03-30
| | | | | Allow clients to set a custom cursor if they have the seat's pointer focus.
* config reload: destroy old seat when removed from configLibravatar Dominique Martinet2018-01-22
| | | | | This adds new sway_seat_destroy and sway_cursor_destroy helpers and compare new and old config on free
* fix header includesLibravatar Tony Crisci2017-12-16
|
* working pointer motionLibravatar Tony Crisci2017-12-10
|
* sway xcursor managerLibravatar Tony Crisci2017-12-09
|
* input include directoryLibravatar Tony Crisci2017-12-08