aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input
Commit message (Collapse)AuthorAge
* seatop_down: End if surface is destroyed or other seatop startsLibravatar Simon Plakolb2021-09-02
| | | | | | If the surface the pointer started to interact with is destroyed we also want the seatop_down to end. In case a drag is initiated we receive a call to handle_end.
* input: Use seatop_down on layer surface clickLibravatar Simon Plakolb2021-09-02
| | | | | | | This solves an issue where layer-shell items would not receive a button release event when the pointer left them while being pressed. The default seatop changes focus immediately while seatop_down defers any focus changes until the pointer is released or seatop_down is destroyed.
* seatop_down: Change type of sx, sy to double in begin_seatop_downLibravatar David Rosca2021-08-05
| | | | | | | | | | | | | | | Losing the precision resulted in wlr_cursor and wlr_seat::pointer_state getting out of sync during pointer motion in seatop_down. Since the difference was always under 1 px, it was practically impossible to notice in normal use. But because of being out of sync, cursor_rebase would always end up incorrectly calling wlr_seat_pointer_notify_motion from seatop_default_begin (on releasing mouse button) which broke cursor locking. See #5405 Closes #4632
* Fix wl_pointer.frame not sent on touch emulationLibravatar Simon Ser2021-07-26
| | | | | | | | | | | | When emulating touch, the simulating_pointer_from_touch field is set to true. It's switched back to false when a touch_up event is received. However we need to ensure we always send a wl_pointer.frame event following a group of other wl_pointer events. Since a touch_frame event is always guaranteed to come after a group of touch events, unset simulating_pointer_from_touch in the touch_frame handler instead of the touch_up handler. Add a new field to know whether the touch_frame handler should stop emulation.
* Add support for touch frame eventsLibravatar Simon Ser2021-07-08
| | | | | | Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3001
* Update wlr_box includesLibravatar Simon Ser2021-07-07
| | | | | | Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3011
* input: Move get_current_time_msec in from utilLibravatar Kenny Levinsen2021-06-23
| | | | | | | get_current_time_msec is only used in cursor.c, so we can move it in and make it static. This is primarily intended to avoid a symbol collision with wlroots, which we unfortunately do not have a good solution for yet.
* Add tab dragging functionalityLibravatar tomKPZ2021-05-06
| | | | | | | | | | | Implements functionality described in [1]. Please see the issue for a video with a demonstration of the new behavior. An issue is that titlebars cover up a significant portion of the top edge drop area. The solution is simply to change the edge drop area hitbox to start at the contents instead of the container. [1] https://github.com/swaywm/sway/issues/6218
* Implement input method keyboard grabLibravatar xdavidwu2021-03-12
|
* focus: beyond fullscreen when focused explicitlyLibravatar lbonn2021-02-25
| | | | | | | When issuing a focus command on a specific container, users expect to proceed it even if is hidden by a fullscreen window. This matches the behavior of i3.
* Automatically map built-in touchscreens/tablets to built-in panelsLibravatar Simon Ser2021-02-25
| | | | | Detect whether an output is built-in via its type. Detect whether a touchscreen or tablet tool is built-in via its ID_PATH property.
* container: Move pending state to state structLibravatar Kenny Levinsen2021-02-16
| | | | | | | | | Pending state is currently inlined directly in the container struct, while the current state is in a state struct. A side-effect of this is that it is not immediately obvious that pending double-buffered state is accessed, nor is it obvious what state is double-buffered. Instead, use the state struct for both current and pending.
* Add missing transaction commits to seatop_defaultLibravatar David962021-02-16
| | | | | | | | | Every seat_set_focus* should be followed by a transaction_commit_dirty. In cases where the focus change is followed by a seatop_begin* this is not needed, as transaction_commit_dirty is then called by the seatop_begin* function. Fixes #6034
* text_input: Add support for focusing layer-shell surfacesLibravatar Tadeo Kondrak2021-02-15
|
* text_input: Only send surrounding_text and content_type if supportedLibravatar Tadeo Kondrak2021-02-15
|
* text_input: Ignore text_input disable from unfocused windowsLibravatar Tadeo Kondrak2021-02-15
| | | | | | | Before this commit, there would be cases where focus changes from one window to another, the new window activates text_input, then the old window sends a deactivate request, making text_input unfocused completely.
* input: Commit transactions in seatop_defaultLibravatar Kenny Levinsen2021-02-15
| | | | | This is needed for focus_follows_mouse, and was accidentally omitted in the previous transaction commit shuffle.
* input: Only commit transactions when necessaryLibravatar Kenny Levinsen2021-02-14
| | | | | | | | | | | There is no need to check for transactions at the end of every user input, as the vast majority of input will not issue transactions. This implementation can also hide where changes are made without an appropriate transaction commit, as a future unrelated input would issue the commit instead. Instead, commit transactions in places where changes are made or are likely to be made.
* input/seat: Reset command handler context in seat_destroy()Libravatar Andri Yngvason2021-01-01
| | | | This fixes a dangling reference which causes a use-after-free.
* input/seat: Clean up focus_stack in seat_destroy()Libravatar Andri Yngvason2021-01-01
| | | | This fixes use-after-free when seat_destroy() has been called.
* input: Clean up input_method_relay in seat_destoy()Libravatar Andri Yngvason2021-01-01
| | | | | This fixes a crash that happens when input_method_new or text_method_new events are emitted after the seat has been freed.
* Change workspace_layout to match i3 behaviorLibravatar Ronan Pigott2020-12-20
| | | | | | | In i3, the workspace_layout command does not affect the workspace layout. Instead, new workspace level containers are wrapped in the desired layout and the workspace layout always defaults to the output orientation.
* input/cursor: unhide cursor on synthetic inputLibravatar Tudor Brindus2020-12-06
| | | | Fixes #5847.
* input/keyboard: fix Group# bindings for keyboard groupsLibravatar Brian Ashworth2020-11-12
| | | | | | The keyboard group's effective keyboard layout was never being changed due to a condition that incorrectly preventing it from being performed. The IPC event that follows the change was correctly being prevented.
* tree/container: introduce `container_is_sticky[_or_child]` functionsLibravatar Tudor Brindus2020-11-11
| | | | | | | | | | To query whether a container is sticky, checking `con->is_sticky` is insufficient. `container_is_floating_or_child` must also return true; this led to a lot of repetition. This commit introduces `container_is_sticky[_or_child]` functions, and switches all stickiness checks to use them. (Including ones where the container is already known to be floating, for consistency.)
* Add missing includes for wlr_input_device.hLibravatar Simon Ser2020-11-11
| | | | References: https://github.com/swaywm/wlroots/pull/2470
* Replace wlr_key_state with wl_keyboard_key_stateLibravatar Simon Ser2020-11-11
| | | | References: https://github.com/swaywm/wlroots/pull/2446
* input/seatop_default: consider fullscreen views to have no edgesLibravatar Tudor Brindus2020-11-05
| | | | | | | | | | | | | Previously, `find_edge` on a single fullscreen view would occasionally return an edge rather than `WLR_EDGE_NONE`. This would trigger entry into `seatop_resize_tiling`, which doesn't have meaning for a fullscreen view. The result was that the fullscreen container hitbox was considered to be that of where it'd be if it were tiling, so most clicks would not go through. Fixes #5792.
* input: fully change focus when scrolling tabs/stacksLibravatar Tudor Brindus2020-11-01
| | | | | | | | When scrolling on a tabbed/stacked container, i3 focuses its inactive-focused focused child. Sway does the same, but then resets the focus to whatever was focused previously. Ref https://github.com/i3/i3/blob/e5992eed163179f5cd2715c2c212d3d757f04b31/src/click.c#L207-L219
* commands/focus: force container warp when fulfilling `focus mode_toggle`Libravatar Tudor Brindus2020-11-01
| | | | | | | This commit switches focusing behavior to force a warp when executing `focus mode_toggle`. Fixes #5772.
* input: remove motion deltas from seatop callbacksLibravatar Tudor Brindus2020-10-31
| | | | Straightforward cleanup, they haven't been used for a while.
* hide_cursor: Add an option to hide when typingLibravatar Tamir Zahavi-Brunner2020-10-30
| | | | | Add an option for the `hide_cursor` command to hide the cursor when typing, i.e. whenever a key is pressed.
* tiling_resize: abandon resize if a sibling con diesLibravatar Ronan Pigott2020-10-20
|
* tiling_drag: emit window move ipc eventsLibravatar Ronan Pigott2020-10-18
|
* seat: use default output mapping if there is no input configLibravatar Ronan Pigott2020-10-16
|
* input/tablet: add tool_mode option to set tablet tools as relative inputLibravatar Tudor Brindus2020-10-12
| | | | Closes #4139.
* input/cursor: default tablet lens tool to relative motionLibravatar Tudor Brindus2020-10-12
| | | | | | | | It is recommended that mouse and lens cursor tool default to relative mode and all pen-like tools to absolute mode. Refs https://wayland.freedesktop.org/libinput/doc/1.11.3/tablet-support.html#tablet-relative-motion.
* Make focus_follows_mouse work when hovering a layer-shell surface on another ↵Libravatar David962020-09-26
| | | | | | output Fixes #5668
* cursor: update hide timer during config applyLibravatar Rouven Czerwinski2020-09-16
| | | | | | | | | We can't arm the timer during cursor creation since the config may not be ready yet. Instead arm the timer while applying the input configuration, by this time the configuration has been parsed and we can arm the hide timer. Fixes #5686
* cursor: arm cursor hide timer immediatelyLibravatar Rouven Czerwinski2020-09-15
| | | | | | | | | | According to the wayland docs, wayland timers are disarmed on creation. This leads to the cursor not being hidden if there is no activity after creation, since the timer is armed on activity, but not at creation. Arm the timer after creation to ensure the cursor is hidden even if there is no cursor activity after creation. Fixes #5684
* input/pointer: update cursor activity after updating button countsLibravatar Tudor Brindus2020-09-14
| | | | | | | Otherwise, Sway will not re-hide a cursor after the last button has been released. Needed alongside afa890e to fix #5679.
* input/cursor: reset event source after unhideLibravatar Rouven Czerwinski2020-09-14
| | | | | | | | Reset the event source after unhiding the cursor, to ensure that the timeout starts after showing the cursor. Also remove the open coded variant in seat_consider_warp_to_focus(). Fixes #5679
* input/libinput: remove input type property biasLibravatar Brian Ashworth2020-09-03
| | | | | | | | | | | | | | This changes it so all libinput config options are set on any device that supports it. Previously, only a subset of libinput config options were being considered depending on the input type. Instead of trying to guess which properties the device may support, attempt to set any configured property regardless of the device type. All of the functions already have early returns in them for when the device does not actually support the property. This brings the configuration side inline with describe_libinput_device for the IPC side. This change was prompted by a tablet tool showing the calibration matrix property in the IPC message, but not being able to actually change it since that property was only being considered for the touch input type.
* Fix incorrect format specifiersLibravatar Antonin Décimo2020-07-30
|
* input/cursor: don't send wl_pointer.motion event on pointer unlock warpLibravatar Tudor Brindus2020-07-15
| | | | | | | | On warping to a cursor hint, update the pointer position we track as well, so that on the next pointer rebase we don't send an unexpected synthetic motion event to clients. Fixes #5405.
* input: implement xdg_toplevel interactive resize hintsLibravatar Ronan Pigott2020-07-13
|
* config/output: don't change output state before commitLibravatar Simon Ser2020-07-10
| | | | | | | | | | | | | | | | | | | | | | | Previously, we called output_disable prior to wlr_output_commit. This mutates Sway's output state before the output commit actually succeeds. This results in Sway's state getting out-of-sync with wlroots'. An alternative fix [1] was to revert the changes made by output_disable in case of failure. This is a little complicated. Instead, this patch makes it so Sway's internal state is never changed before a successful wlr_output commit. We had two output flags: enabled and configured. However enabled was set prior to the output becoming enabled, and was used to prevent the output event handlers (specifically, the mode handler) from calling apply_output_config again (infinite loop). Rename enabled to enabling and use it exclusively for this purpose. Rename configure to enabled, because that's what it really means. [1]: https://github.com/swaywm/sway/pull/5521 Closes: https://github.com/swaywm/sway/issues/5483
* seat/dnd: support null drag icon surfacesLibravatar Nick Diego Yamane2020-07-07
| | | | | | | | | | | | | | | | | As per the Wayland spec [1]: > The icon surface is an optional (can be NULL) surface that provides an > icon to be moved around with the cursor. However, as of now Sway "start_drag" signal handler does not starts the DND session unless a non-NULL drag icons is provided. This patch fixes it by skipping handling of the drag icon if it is null. Fixes #5509 [1] https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_data_device Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com>
* Replace unprintable characters in input device idLibravatar wb96882020-07-03
|
* Don't set xwayland cursor when wlr_xwayland failedLibravatar Simon Ser2020-07-02
| | | | This causes a NULL pointer dereference.