aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seatop_default.c
Commit message (Collapse)AuthorAge
* Convert to new pointer enumsLibravatar Simon Ser2024-02-28
| | | | References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4575
* Define _POSIX_C_SOURCE globallyLibravatar Simon Ser2024-02-23
| | | | See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
* Chase wlroots!4003Libravatar Kirill Primak2024-01-23
|
* Fix SIGSEGV on surface destroyLibravatar Alexander Orzechowski2024-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` Program terminated with signal SIGSEGV, Segmentation fault. warning: Section `.reg-xstate/3960717' in core file too small. 0 container_get_siblings (container=0x55bcde4797f0) at ../sway/tree/container.c:1228 1228 if (list_find(container->pending.workspace->tiling, container) != -1) { [Current thread is 1 (Thread 0x7fa23b4a2940 (LWP 3960717))] (gdb) bt full= No symbol "full" in current context. (gdb) bt full 0 container_get_siblings (container=0x55bcde4797f0) at ../sway/tree/container.c:1228 1 0x000055bcdb62c704 in edge_is_external (cont=0x55bcde4797f0, edge=(WLR_EDGE_TOP | WLR_EDGE_LEFT)) at ../sway/input/seatop_default.c:54 siblings = 0x55bcde4797f0 index = 32766 layout = L_NONE __PRETTY_FUNCTION__ = "edge_is_external" 2 0x000055bcdb62c96f in find_resize_edge (cont=0x55bcde4797f0, surface=0x0, cursor=0x55bcddd5c2e0) at ../sway/input/seatop_default.c:106 edge = (WLR_EDGE_TOP | WLR_EDGE_LEFT) 3 0x000055bcdb620b3c in cursor_update_image (cursor=0x55bcddd5c2e0, node=0x55bcde4797f0) at ../sway/input/cursor.c:144 edge = WLR_EDGE_NONE 4 0x000055bcdb62eb8f in handle_rebase (seat=0x55bcddd5a740, time_msec=488992944) at ../sway/input/seatop_default.c:773 e = 0x55bcddd5c8e0 cursor = 0x55bcddd5c2e0 surface = 0x0 sx = 0 sy = 0 5 0x000055bcdb62c531 in seatop_rebase (seat=0x55bcddd5a740, time_msec=488992944) at ../sway/input/seat.c:1585 6 0x000055bcdb620a7d in cursor_rebase (cursor=0x55bcddd5c2e0) at ../sway/input/cursor.c:126 time_msec = 488992944 7 0x000055bcdb620ac4 in cursor_rebase_all () at ../sway/input/cursor.c:136 seat = 0x55bcddd5a740 8 0x000055bcdb61cc95 in transaction_apply (transaction=0x55bcde5b28c0) at ../sway/desktop/transaction.c:704 9 0x000055bcdb61ccdb in transaction_progress () at ../sway/desktop/transaction.c:716 10 0x000055bcdb61d1f9 in transaction_commit_pending () at ../sway/desktop/transaction.c:836 transaction = 0x55bcde5b28c0 11 0x000055bcdb61d596 in _transaction_commit_dirty (server_request=true) at ../sway/desktop/transaction.c:912 12 0x000055bcdb61d5ac in transaction_commit_dirty () at ../sway/desktop/transaction.c:916 13 0x000055bcdb65f579 in view_unmap (view=0x55bcde2ff180) at ../sway/tree/view.c:847 parent = 0x55bcde489010 ws = 0x55bcdde19080 seat = 0x55bcddd5a198 14 0x000055bcdb61e461 in handle_unmap (listener=0x55bcde2ff368, data=0x0) at ../sway/desktop/xdg_shell.c:394 xdg_shell_view = 0x55bcde2ff180 view = 0x55bcde2ff180 __PRETTY_FUNCTION__ = "handle_unmap" 15 0x00007fa23c4ae87f in wlr_signal_emit_safe (signal=0x55bcde46cf38, data=0x0) at ../util/signal.c:29 pos = 0x55bcde2ff368 l = 0x55bcde2ff368 cursor = {link = {prev = 0x55bcde2ff368, next = 0x7ffe240702a0}, notify = 0x7fa23c4ae7c9 <handle_noop>} end = {link = {prev = 0x7ffe24070280, next = 0x55bcde46cf38}, notify = 0x7fa23c4ae7c9 <handle_noop>} 16 0x00007fa23c47c3c7 in unmap_xdg_surface (surface=0x55bcde46ce30) at ../types/xdg_shell/wlr_xdg_surface.c:40 __PRETTY_FUNCTION__ = "unmap_xdg_surface" popup = 0x55bcde46ce60 popup_tmp = 0x55bcde46ce60 configure = 0x7ffe24070360 tmp = 0x55bcde488020 17 0x00007fa23c47cd47 in xdg_surface_role_precommit (wlr_surface=0x55bcde488020, state=0x55bcde4881a8) at ../types/xdg_shell/wlr_xdg_surface.c:330 surface = 0x55bcde46ce30 18 0x00007fa23c4813b2 in surface_commit_state (surface=0x55bcde488020, next=0x55bcde4881a8) at ../types/wlr_compositor.c:407 __PRETTY_FUNCTION__ = "surface_commit_state" invalid_buffer = false subsurface = 0xbd8e9aecae023300 --Type <RET> for more, q to quit, c to continue without paging-- 19 0x00007fa23c48192a in surface_handle_commit (client=0x55bcde488850, resource=0x55bcde2fdb80) at ../types/wlr_compositor.c:523 surface = 0x55bcde488020 20 0x00007fa23bb5ed4a in () at /usr/lib/libffi.so.8 21 0x00007fa23bb5e267 in () at /usr/lib/libffi.so.8 22 0x00007fa23c517323 in () at /usr/lib/libwayland-server.so.0 23 0x00007fa23c5125cc in () at /usr/lib/libwayland-server.so.0 24 0x00007fa23c5151ca in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0 25 0x00007fa23c512d37 in wl_display_run () at /usr/lib/libwayland-server.so.0 26 0x000055bcdb616885 in server_run (server=0x55bcdb68c5c0 <server>) at ../sway/server.c:307 27 0x000055bcdb61594e in main (argc=3, argv=0x7ffe24070af8) at ../sway/main.c:433 ``` It seems to be happening because of this set of events all happening in the span of a single transaction: 1. You kill a tiled window that is the only window in a workplace. 2. Sway will destroy the workspace but not yet the container - this makes `con->pending.workspace` NULL. 3. Cursor glyphs get recomputed causing sway to recompute if the cursor is on a container edge. 4. That computation causes an access to the NULL workspace. Crash.
* scene_graph: Port seat drag iconsLibravatar Alexander Orzechowski2024-01-18
|
* input: Move wlr_pointer_gestures_v1 to sway_input_managerLibravatar Mark Bolhuis2023-06-26
| | | | | | | | On multi-seat configurations a zwp_pointer_gestures_v1 global was created for every seat. Instead, create the global once in the input manager, to be shared across all seats.
* Add support for wlr-layer-shell ON_DEMAND keyboard interactivityLibravatar Erik Reider2023-06-06
| | | | | This allows for layer shell surfaces to receive focus while the surface is explicitly focused, i.e allowing text fields to receive keyboard input just like a regular surface.
* Implement seatop_touchLibravatar Stacy Harper2023-02-20
| | | | | | | | | | Atm we got issue with the touch position sent to the clients. While holding contact, leaving the initial container will continue to send motion event to the client but with the new local position from the new container. This seatop goal is to send the position of the touch event, relatively to the initial container layout position.
* Convert to *_try_from_wlr_surface()Libravatar Simon Ser2023-02-02
| | | | References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3991
* Convert to wlr_xwayland_surface_try_from_wlr_surface()Libravatar Simon Ser2023-02-01
| | | | | | Accomodate for the breaking changes in [1]. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/fbf5982e3838ee28b5345e98832f6956c402b225
* Replace math functions that promote float to doubleLibravatar Carl Smedstad2023-01-03
|
* input: tweak focus behavior to allow focusing parent containersLibravatar Tudor Brindus2022-10-21
| | | | | | | | | | Sway focuses the inactive child when focusing split containers. However, there is currently no way to focus the parent container itself by mouse. A user must use the keyboard to do so. This commit maintains the current behavior, but makes it such that a second click on the split container titlebar (i.e., after its children are visible) focuses the split container itself.
* input: focus container when scrolling on titlebarLibravatar Tudor Brindus2022-10-10
| | | | Fixes #6503.
* input: focus floating container when clicked on borderLibravatar Tudor Brindus2022-10-10
| | | | Fixes #7209.
* input: chase delta_discrete semantics changeLibravatar Kirill Primak2022-07-15
|
* sway: add bindgesture commandLibravatar Florian Franzen2022-05-30
| | | | Co-authored-by: Michael Weiser <michael.weiser@gmx.de>
* sway/input: follow up wlroots input device events renamingLibravatar Simon Zeni2022-03-17
|
* Remove some erroneous apostrophes in commentsLibravatar Thomas Hebb2022-02-22
|
* 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.
* 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
* 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/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
* input: remove motion deltas from seatop callbacksLibravatar Tudor Brindus2020-10-31
| | | | Straightforward cleanup, they haven't been used for a while.
* Make focus_follows_mouse work when hovering a layer-shell surface on another ↵Libravatar David962020-09-26
| | | | | | output Fixes #5668
* input/pointer: correctly handle bindings for synthetic eventsLibravatar Tudor Brindus2020-06-25
| | | | | | This commit addresses a regression introduced in 8fa74ad. Fixes #5481.
* input/pointer: don't trigger pointer bindings for emulated inputLibravatar Tudor Brindus2020-06-16
| | | | | | | | | | Prior to this commit, a tablet device could trigger mouse button down bindings if the pen was pressed on a surface that didn't bind tablet handlers -- but it wouldn't if the surface did bind tablet handlers. We should expose consistent behavior to users so that they don't have to care about emulated vs. non-emulated input, so stop triggering bindings for any non-pointer devices.
* input/tablet: focus appropriate node on tip downLibravatar Tudor Brindus2020-06-16
| | | | | | | | | This commit makes tablet input more usable when `focus_follows_mouse` is set to `no`. Previously, tapping down on surfaces that bound tablet input would not switch focus, whereas tapping on surfaces that didn't (and hence went through pointer emulation) did.
* input: tweak resize behavior to not change tab focus on border clickLibravatar Tudor Brindus2020-06-08
| | | | | | | If a resize is triggered on a tabbed or stacked container, change focus to the tab which already had inactive focus, rather than to the tab whose border was clicked -- otherwise, we'd change the active tab when the user probably just wanted to resize.
* input/tablet: allow moving tiling tablet v2 surfaces by pen inputLibravatar Tudor Brindus2020-06-07
| | | | Closes #5293.
* input/tablet: allow moving floating tablet v2 surfaces by pen inputLibravatar Tudor Brindus2020-06-07
| | | | Refs #5293.
* tree/container: introduce `container_toplevel_ancestor` helperLibravatar Tudor Brindus2020-06-07
| | | | | This allows us to not have to explicitly write the same while loop everywhere.
* Use new wlroots API for clearing keyboard/pointer focus during grabsLibravatar Thomas Hebb2020-06-05
| | | | | | | | | We are not allowed to do what we did in #5222 and pass a `NULL` surface wlr_seat_pointer_notify_enter(), and it's causing crashes when an xdg-shell popup is active (see #5294 and swaywm/wlroots#2161). Instead, solve #5220 using the new wlroots API introduced in swaywm/wlroots#2217.
* input/cursor: refactor tablet tool tip events into seatopsLibravatar Tudor Brindus2020-06-04
| | | | | | This commit moves tool tip event generation into seatops. In doing so, some corner cases where we'd erroneously (but likely harmlessly) generate both tablet and pointer events simultaneously are eliminated.
* input/pointer: send pointer enter event on confine warpLibravatar Tudor Brindus2020-05-28
| | | | | | | | | | | | | | | | | | | The spec has this to say about sending events on confine creation: Whenever the confinement is activated, it is guaranteed that the surface the pointer is confined to will already have received pointer focus and that the pointer will be within the region passed to the request creating this object. ...and on region update: If warped, a wl_pointer.motion event will be emitted, but no wp_relative_pointer.relative_motion event. Prior to this patch, sway did neither, and updated the hardware cursor position without notifying the underlying surface until the next motion event. This led to inconsistent results, especially in applications that draw their own software cursor.
* input/tablet: add seatop_down entry for tablet inputLibravatar Tudor Brindus2020-05-25
| | | | | | | | | | | | | | | | | | | | | | Currently, when tablet input exits a window during an implicit grab, it passes focus to another window. For instance, this is problematic when trying to drag a scrollbar, and exiting the window &mdash; the scrollbar motion stops. Additionally, without `focus_follows_mouse no`, the tablet passes focus to whatever surface it goes over regardless of if there is an active implicit. If the tablet is over a surface that does not bind tablet handlers, sway will fall back to pointer emulation, and all of this works fine. It probably should have consistent behavior between emulated and not-emulated input, though. This commit adds a condition for entering seatop_down when a tablet's tool tip goes down, and exiting when it goes up. Since events won't be routed through seatop_default, this prevents windows losing focus during implicit grabs. Closes #5302.
* input/tablet: simplify parameter plumbing for tablet referencesLibravatar Tudor Brindus2020-05-10
| | | | | | This is a small cleanup commit for removing `sway_tablet` parameters from functions that already accept `sway_tablet_tool`, since the tablet reference can be accessed through `tool->tablet`.
* input: rename pointer handlers to be unambiguousLibravatar Tudor Brindus2020-05-02
| | | | | | | This commit renames `motion` and `axis` handlers to `pointer_motion` and `pointer_axis`, respectively, to disambiguate them from their tablet (and future touch) handlers. `button` is left as-is, as it is generic across input devices.
* input: refactor tablet motion into seatop handlerLibravatar Tudor Brindus2020-05-02
| | | | | | | This commit moves tablet motion logic into a seatop handler. As a side-effect of seatop implementations being able to receive tablet motion events, fixes #5232.
* input/cursor: make cursor rebasing cursor type-agnosticLibravatar Tudor Brindus2020-05-02
| | | | | | | | This commit refactors `cursor_rebase` into `cursor_update_image`, and moves sending pointer events to the two existing call sites. This will enable this code to be reused for tablets. Refs #5232
* input/seatop_default: properly notify pointer leaveLibravatar Nick Diego Yamane2020-05-01
| | | | | | | | | Currently, clients receive wl_data_device::leave events only when the pointer enters another surface, which leads to issues, such as #5220. This happens because wlr_seat_pointer_notify_enter() is called when handling motion events only for non-NULL surfaces. Fixes #5220
* input/seatop_default: release on empty workspaceLibravatar Rouven Czerwinski2020-04-15
| | | | | | | | | | | Instead of handling presses and releases on empty workspaces as setting focus to the workspace, handle releases by notifying the seat of a pointer action. This way DnDs are correctly released if the button is released over an empty workspace. This is achieved by removing the early return and letting the handle_button() call seat_pointer_notify_button() at the very end. Fixes #3932
* input/seatop_default: fix focusing floating titlesLibravatar Brian Ashworth2019-12-16
| | | | | | | | | | | When clicking on the titlebar of a floating container (or descendant of a floating container), the top-level floating container was being focused and then allowing you to move the top-level floating container. This made it so you couldn't switch to a different tab/stack within the floating container. With this patch, the focus inactive view for the container that the titlebar is associated with is focused, then the traversal to the top-level floating container is performed to use with the move floating operation.
* seatop_default: handle focus for unmanaged xwayland windows lastLibravatar Ronan Pigott2019-11-08
| | | | Fixes #4707
* seatop_default: handle focus for xwayland_unmanaged viewsLibravatar Ronan Pigott2019-11-04
|
* Fix tiled containers resize with mouseLibravatar Kirill Chibisov2019-10-23
| | | | Fixes regression introduced in 2c1a11016ccb7646a74de51eff003c18e5aa7902
* Do not search for edges on subsurfaces, fix #4381Libravatar Versus Void2019-09-05
| | | | | | | Subsurfaces (in most cases popups) aren't decorated by sway and will never have any borders, but may be drawn beyond container boundaries producing false positive when searching for edge. So we want to skip edge search when handling mouse event on subsurface.
* seatop_default: only focus container on pressLibravatar Brian Ashworth2019-09-04
| | | | | | | | | | | | This matches i3's behavior of only focusing a container when pressed. This allows for `bindsym button1 nop`, `bindsym BTN_LEFT nop`, or `bindcode 272 nop` to be used to disable focusing when clicking on the title (or with additional flags to bind{code,sym} other portions of the container). Without this additional condition, the user would need both `bindsym button1 nop` and `bindsym --release button1 nop` to override both the pressed and released behavior.