aboutsummaryrefslogtreecommitdiff
path: root/sway/input
AgeCommit message (Collapse)Author
2022-07-15input: chase delta_discrete semantics changeKirill Primak
2022-06-22Remove access to wlr_input_device unionSimon Ser
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3626 Closes: https://github.com/swaywm/sway/issues/7077
2022-05-30sway: add bindgesture commandFlorian Franzen
Co-authored-by: Michael Weiser <michael.weiser@gmx.de>
2022-04-30Avoid inspecting a NULL view in seat_set_focusDaniel De Graaf
Fixes #6968
2022-04-29Implement ext-session-lock-v1Daniel De Graaf
2022-03-23sway/input: wlr_seat_keyboard() now takes wlr_keyboardLeonardo Hernández Hernández
2022-03-22sway/input: fix bad position of wlr_dragLeonardo Hernández Hernández
2022-03-17sway/input: follow up wlroots input device events renamingSimon Zeni
2022-03-17sway/input/seat: take output name from specialized input deviceSimon Zeni
2022-03-17sway/input/cursor: take device mm size from wlr_tabletSimon Zeni
2022-03-08Remove WLR_SWITCH_STATE_TOGGLE usageSimon Ser
Ref [1]. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/4792446ee8f50104bd207d9ccd8558a7e4eb4514
2022-03-05sway/input: destroy sway_switch properlyMoon Sungjoon
Fix: #6861 Added seat_device_destroy function to seat_device_destroy function.
2022-03-04sway/input: don't pass possibly invalid modifiers pointerAlexander Gramiak
active_keyboard may be NULL, in which case an invalid pointer could be passed to wlr_input_method_keyboard_grab_v2_send_modifiers. This procedure call is unnecessary since wlroots commit 372a52ec "input method: send modifiers in set_keyboard", so the call can simply be removed. Fixes #6836.
2022-02-22Remove some erroneous apostrophes in commentsThomas Hebb
2022-02-21sway/input: use wlr_input_device from input device baseSimon Zeni
2022-01-22input/cursor: pass through pointer hold gesturesTudor Brindus
This just follows swaywm/wlroots#3047, so `wl_pointer_gestures_v1` clients can be notified of these events.
2022-01-17input/cursor: treat swipe begin as idle activity tooTudor Brindus
Accidentally overlooked in fd53f80.
2022-01-17input/cursor: count pointer gestures as idle activityTudor Brindus
Fixes https://github.com/swaywm/sway/issues/6765.
2022-01-07input/seat: unset has_focus when focus_stack becomes emptyThomas Hebb
We currently track the focus of a seat in two ways: we use a list called focus_stack to track the order in which nodes have been focused, with the first node representing what's currently focused, and we use a variable called has_focus to indicate whether anything has focus--i.e. whether we should actually treat that first node as focused at any given time. In a number of places, we treat has_focus as implying that a focused node exists. If it's true, we attempt to dereference the return value of seat_get_focus(), our helper function for getting the first node in focus_list, with no further checks. But this isn't quite correct with the current implementation of seat_get_focus(): not only does it return NULL when has_focus is false, it also returns NULL when focus_stack contains no items. In most cases, focus_stack never becomes empty and so this doesn't matter at all. Since focus_stack stores a history of focused nodes, we rarely remove nodes from it. The exception to this is when a node itself goes away. In that case, we call seat_node_destroy() to remove it from focus_stack and free it. But we don't unset has_focus if we've removed the final node! This lets us get into a state where has_focus is true but seat_get_focus() returns NULL, leading to a segfault when we try to dereference it. Fix the issue both by updating has_focus in seat_node_destroy() and by adding an assertion in seat_get_focus() that ensures focus_stack and has_focus are in sync, which will make it easier to track down similar issues in the future. Fixes #6395. [1] There's some discussion in #1585 from when this was implemented about whether has_focus is actually necessary; it's possible we could remove it entirely, but for the moment this is the architecture we have.
2021-12-14Handle border width and height on minimum floating sizesRoastVeg
This fixes: https://github.com/swaywm/sway/issues/5337 Co-authored-by: Moon Sungjoon <sumoon@seoulsaram.org>
2021-10-26fix cursor input for layer-shell surfacesRasmus Moorats
previously, fullscreen global containers would grab cursor input even if a shell-layer surface was on top of it related issue: https://github.com/swaywm/sway/issues/6501
2021-10-10use node_is_viewsiikamiika
2021-10-08Improve built-in touchscreen detectionJari Ronkainen
Adds detection code to handle pci-*-platform-* strings in ID_PATH References: https://github.com/swaywm/sway/issues/6590 Signed-off-by: Jari Ronkainen <ronchaine@gmail.com>
2021-09-02seatop_down: End if surface is destroyed or other seatop startsSimon Plakolb
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.
2021-09-02input: Use seatop_down on layer surface clickSimon Plakolb
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.
2021-08-05seatop_down: Change type of sx, sy to double in begin_seatop_downDavid Rosca
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
2021-07-26Fix wl_pointer.frame not sent on touch emulationSimon Ser
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.
2021-07-08Add support for touch frame eventsSimon Ser
Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3001
2021-07-07Update wlr_box includesSimon Ser
Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3011
2021-06-23input: Move get_current_time_msec in from utilKenny Levinsen
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.
2021-05-06Add tab dragging functionalitytomKPZ
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
2021-03-12Implement input method keyboard grabxdavidwu
2021-02-25focus: beyond fullscreen when focused explicitlylbonn
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.
2021-02-25Automatically map built-in touchscreens/tablets to built-in panelsSimon Ser
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.
2021-02-16container: Move pending state to state structKenny Levinsen
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.
2021-02-16Add missing transaction commits to seatop_defaultDavid96
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
2021-02-15text_input: Add support for focusing layer-shell surfacesTadeo Kondrak
2021-02-15text_input: Only send surrounding_text and content_type if supportedTadeo Kondrak
2021-02-15text_input: Ignore text_input disable from unfocused windowsTadeo Kondrak
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.
2021-02-15input: Commit transactions in seatop_defaultKenny Levinsen
This is needed for focus_follows_mouse, and was accidentally omitted in the previous transaction commit shuffle.
2021-02-14input: Only commit transactions when necessaryKenny Levinsen
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.
2021-01-01input/seat: Reset command handler context in seat_destroy()Andri Yngvason
This fixes a dangling reference which causes a use-after-free.
2021-01-01input/seat: Clean up focus_stack in seat_destroy()Andri Yngvason
This fixes use-after-free when seat_destroy() has been called.
2021-01-01input: Clean up input_method_relay in seat_destoy()Andri Yngvason
This fixes a crash that happens when input_method_new or text_method_new events are emitted after the seat has been freed.
2020-12-20Change workspace_layout to match i3 behaviorRonan Pigott
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.
2020-12-06input/cursor: unhide cursor on synthetic inputTudor Brindus
Fixes #5847.
2020-11-12input/keyboard: fix Group# bindings for keyboard groupsBrian Ashworth
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.
2020-11-11tree/container: introduce `container_is_sticky[_or_child]` functionsTudor Brindus
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.)
2020-11-11Add missing includes for wlr_input_device.hSimon Ser
References: https://github.com/swaywm/wlroots/pull/2470
2020-11-11Replace wlr_key_state with wl_keyboard_key_stateSimon Ser
References: https://github.com/swaywm/wlroots/pull/2446