aboutsummaryrefslogtreecommitdiff
path: root/sway
AgeCommit message (Collapse)Author
2020-05-20sway.5: make formatting more consistentMartin Michlmayr
2020-05-19input: fix reloading crash due to keyboard group configuringBrian Ashworth
Keyboard group keyboards should not call sway_keyboard_configure. They do not have an input config and they derive their state from the keyboards within the group. For some reason, I got sway_keyboard_configure and seat_configure_keyboard mixed up and thought seat_reset_device called the latter. Calling sway_keyboard_configure with a keyboard group's keyboard is not supported and can cause issues. If any clients are listening to the ipc input event, a sigsegv will occur due to not every property - such as identifier - being wired up for keyboard group keyboard's. This also adds an assertion to sway_keyboard_configure to ensure that this does not occur in the future and any instances are quickly caught.
2020-05-14input: reset keyboard groups keyboard on reset allBrian Ashworth
If the keyboard that triggers the reload binding is using the default keymap, default repeat delay, and default repeat rate, the associated keyboard group is never being destroyed on reload. This was causing the keyboard group's keyboard not to get disarmed and result in a use-after-free in handle_keyboard_repeat. If the keyboard was not using the defaults for all three settings, then it's associated keyboard would get destroyed during the reset - which did disarm the keyboard group's keyboard. In this case, the use-after-free would not occur. This adds a block to input_manager_reset_all_inputs that resets the keyboard for all keyboard groups in all seats, which will disarm them. Since the inputs are all being reset anyway, which will reset all individual keyboards, it is not necessary to be selective on which ones get reset.
2020-05-13commands: Add per-view shortcuts_inhibitor commandMichael Weiser
Add a separate per-view shortcuts_inhibitor command that can be used with criteria to override the per-seat defaults. This allows to e.g. disable shortcuts inhibiting globally but enable it for specific, known-good virtualization and remote desktop software or, alternatively, to blacklist that one slightly broken piece of software that just doesn't seem to get it right but insists on trying. Add a flag to sway_view and handling logic in the input manager that respects that flag if configured but falls back to per-seat config otherwise. Add the actual command but with just enable and disable subcommands since there's no value in duplicating the per-seat activate/deactivate/toggle logic here. Split the inhibitor retrieval helper in two so we can use the backend half in the command to retrieve inhibitors for a specific surface and not just the currently focused one. Extend the manual page with documentation of the command and references to its per-seat sibling and usefulness with criteria. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2020-05-13Implement pointer simulation if client hasn't bound to touchDavid96
2020-05-13Really fix floating window border resize problemsAdam Kürthy
Fixes: https://github.com/swaywm/sway/pull/5250
2020-05-13input/cursor: don't apply pointer constraint to emulated tablet inputTudor Brindus
Closes #5268.
2020-05-11Simplify repaint scheduling documentationKenny Levinsen
The current documentation for repaint scheduling is very technical and somewhat confusing. Closes: https://github.com/swaywm/sway/issues/4769
2020-05-10input/tablet: simplify parameter plumbing for tablet referencesTudor Brindus
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`.
2020-05-08input/keyboard: use wlr_keyboard_keymaps_match from wlrootsTudor Brindus
Added in swaywm/wlroots#2172, so that sway doesn't need to maintain an independent copy of this function.
2020-05-05Don't unhide cursor on touch eventsDavid96
Touch events hide the cursor so unhiding it again only causes it to flicker.
2020-05-02input/cursor: remove erroneous cast for tablet tool buttonTudor Brindus
The type expected by wlroots is uint32_t, which `event->button` already is.
2020-05-02input: rename pointer handlers to be unambiguousTudor Brindus
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.
2020-05-02input: refactor tablet motion into seatop handlerTudor Brindus
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.
2020-05-02input/cursor: disambiguate cursor functions from pointer functionsTudor Brindus
2020-05-02input/cursor: make cursor rebasing cursor type-agnosticTudor Brindus
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
2020-05-01Add a secondary headless backendSimon Ser
This allows the create_output command to work on DRM too.
2020-05-01Fix invisible cursor on startupSimon Ser
2020-05-01Don't assert the cursor theme loadsSimon Ser
If it doesn't load, it's a runtime error, so we shouldn't use an assertion.
2020-05-01input/cursor: release simulated tool tip button when over v2 surfaceTudor Brindus
d88460f addressed sending v2 tool tip up when over a non-v2 surface. This commit addresses the other direction. Fixes #5230.
2020-05-01input/seatop_default: properly notify pointer leaveNick Diego Yamane
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
2020-04-29fix typos in sway-input.5.scdjhalmen
2020-04-29Correct typo in sway-output.5.scdEjez
2020-04-27Add each view's shell to JSON descriptionThomas Hebb
This is a criteria you can use to select windows since commit 484cc189e909 ("Add shell criteria token"), but there's no way to query it for an existing window. This exposes its value in the output of `swaymsg -t get_tree`.
2020-04-27man: add note about sway-input and sway-output pagesSimon Ser
2020-04-26input/tablet: query tablet focused surface for cursor image checkTudor Brindus
`handle_tablet_tool_set_cursor` was copied from input/cursor.c's `handle_request_set_cursor`, but the focused surface check was not adjusted appropriately. Fixes #5257.
2020-04-26config/output: reconfigure input devices after full output initTudor Brindus
Previously in 3de1a39, it "worked by accident" in my testing since the display being used in `map_to_output` was initialized first (the map would not be applied because the display hadn't actually come online yet), and was followed by a second display (at which point the map would get applied for the first display). Refs #5231
2020-04-24input/cursor: correctly transfer focus when using tablet penTudor Brindus
Fixes #4819. This commit ensures that `seat_set_focus` is called to transfer focus when a window is selected via a pen. Previously, it would race with `node_at_coords`, and only properly transfer focus if its returned `surface` was NULL.
2020-04-24config/output: reconfigure input devices on new outputTudor Brindus
Some input rules, like `map_to_output`, are dependent on a specific screen being present. This currently does not work for hotplugged outputs, or outputs that are processed after the input device is initially probed. This commit fixes both cases, by reconfiguring inputs on each output addition. Fixes #5231.
2020-04-24Take window borders into account when resizing floating windowsAdam Kürthy
Otherwise the borders can be resized to smaller than the minimum window size.
2020-04-22input/cursor: fix hide cursor timeouts on tablets and touchscreensTudor Brindus
This commit refactors `cursor_handle_activity` to also take the idle source, so that it can be reused for tablet and touch activity. Previously, the timeouts would be tracked, but the cursor would never be un-hidden for anything but pointers. Fixes #5169.
2020-04-22input/cursor: fix jerky resizing of non-tablet_v2 surfacesTudor Brindus
This fixes resizing containers being very jerky under pointer emulation. Refs #5232.
2020-04-22input/cursor: correctly send tablet_v2 up event when over non-v2 surfaceTudor Brindus
If we started holding the tool tip down on a surface that accepts tablet v2, we should notify that surface if it gets released over a surface that doesn't support v2. Since GTK supports tablet v2, this fixes the common case of starting a drag over a GTK surface (e.g. scrollbar) and releasing it outside (e.g. over the gaps between sway containers, or in a terminal). Refs #5230.
2020-04-21Restrict relative output transforms to runtime changesSimon Ser
Prevent them from being used in the config file. This is a breaking config file change. References: https://github.com/swaywm/sway/issues/5236
2020-04-20scdoc: unbindcode --input-device, not input-deviceIhor Kalnytskyi
Apparently, there's a typo in Sway's man page where `input-device` of `unbindcode` command has no dashes.
2020-04-20interpret "subpixel none" as CAIRO_ANTIALIAS_GRAYIan Huang
See issue #5228. Currently, WL_OUTPUT_SUBPIXEL_NONE is ignored and CAIRO_ANTIALIAS_SUBPIXEL is still set. This commit checks if subpixel is set to none and if so, calls set_antialias with CAIRO_ANTIALIAS_GRAY. This mirrors the functionality in Mako's [PR261](https://github.com/emersion/mako/pull/261)
2020-04-17Don't transfer focus to NULL node on touchDavid96
Fixes #5185
2020-04-15input/seatop_default: release on empty workspaceRouven Czerwinski
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
2020-04-14Fix a use-after-free error in switch bindingDi Ma
2020-04-14Fix a use-after-free error in switch bindingDi Ma
2020-04-14Fix a use-after-free error in switch bindingDi Ma
2020-04-14Fix a use-after-free error in switch bindingDi Ma
2020-04-14Implement create_output command for headless backendSimon Ser
2020-04-14input: keyboard: Never group virtual keyboards.Andri Yngvason
This fixes #5134
2020-04-14input: Mark virtual devices as suchAndri Yngvason
This is for internal configuration purposes
2020-04-14add dots to manroshal
2020-04-10Adjust focus order to match rendering order of layer shell popups.Aleksei Bavshin
2020-04-10Render layer shell popups over the top layerDavid96
2020-04-10output: remove damage listeners in damage destroyRouven Czerwinski
Instead of removing the destroy listeners in the output destroy, remove them in the damage destroy handler. Fixes the following use after free: ==646625==ERROR: AddressSanitizer: heap-use-after-free on address 0x61200017cab8 at pc 0x0000004f8f29 bp 0x7ffdf465ad30 sp 0x7ffdf465ad20 WRITE of size 8 at 0x61200017cab8 thread T0 #0 0x4f8f28 in wl_list_remove ../common/list.c:181 #1 0x43dd24 in handle_destroy ../sway/desktop/output.c:790 (`wl_list_remove(&output->damage_destroy.link);` here, 214e3030e1dce master branch) #2 0x7f0e573a1c93 in wlr_signal_emit_safe ../util/signal.c:29 #3 0x7f0e57390954 in wlr_output_destroy ../types/wlr_output.c:365 #4 0x7f0e5735e37f in backend_destroy ../backend/x11/backend.c:128 #5 0x7f0e57348147 in wlr_backend_destroy ../backend/backend.c:47 #6 0x7f0e57356f75 in multi_backend_destroy ../backend/multi/backend.c:54 #7 0x7f0e5735710e in handle_display_destroy ../backend/multi/backend.c:107 #8 0x7f0e573f23e4 in wl_display_destroy (/lib64/libwayland-server.so.0+0x93e4) #9 0x42f0b2 in server_fini ../sway/server.c:177 #10 0x42dd01 in main ../sway/main.c:414 #11 0x7f0e570f7041 in __libc_start_main (/lib64/libc.so.6+0x27041) #12 0x40e3bd in _start (/opt/wayland/bin/sway+0x40e3bd) 0x61200017cab8 is located 120 bytes inside of 320-byte region [0x61200017ca40,0x61200017cb80) freed by thread T0 here: #0 0x7f0e57aa9357 in __interceptor_free (/lib64/libasan.so.6+0xb0357) #1 0x7f0e5738b877 in wlr_output_damage_destroy ../types/wlr_output_damage.c:143 #2 0x7f0e5738b2b9 in output_handle_destroy ../types/wlr_output_damage.c:13 #3 0x7f0e573a1c93 in wlr_signal_emit_safe ../util/signal.c:29 #4 0x7f0e57390954 in wlr_output_destroy ../types/wlr_output.c:365 #5 0x7f0e5735e37f in backend_destroy ../backend/x11/backend.c:128 #6 0x7f0e57348147 in wlr_backend_destroy ../backend/backend.c:47 #7 0x7f0e57356f75 in multi_backend_destroy ../backend/multi/backend.c:54 #8 0x7f0e5735710e in handle_display_destroy ../backend/multi/backend.c:107 #9 0x7f0e573f23e4 in wl_display_destroy (/lib64/libwayland-server.so.0+0x93e4) previously allocated by thread T0 here: #0 0x7f0e57aa9887 in __interceptor_calloc (/lib64/libasan.so.6+0xb0887) #1 0x7f0e5738b532 in wlr_output_damage_create ../types/wlr_output_damage.c:91 #2 0x43e4a7 in handle_new_output ../sway/desktop/output.c:875 #3 0x7f0e573a1c93 in wlr_signal_emit_safe ../util/signal.c:29 #4 0x7f0e57357261 in new_output_reemit ../backend/multi/backend.c:143 #5 0x7f0e573a1c93 in wlr_signal_emit_safe ../util/signal.c:29 #6 0x7f0e5736030a in wlr_x11_output_create ../backend/x11/output.c:253 #7 0x7f0e5735e309 in backend_start ../backend/x11/backend.c:113 #8 0x7f0e573480fb in wlr_backend_start ../backend/backend.c:36 #9 0x7f0e57356e61 in multi_backend_start ../backend/multi/backend.c:31 #10 0x7f0e573480fb in wlr_backend_start ../backend/backend.c:36 #11 0x42f4ba in server_start ../sway/server.c:205 #12 0x42dbd7 in main ../sway/main.c:394 #13 0x7f0e570f7041 in __libc_start_main (/lib64/libc.so.6+0x27041) Fixes #5158
2020-04-09Don't add disabled outputs back to output layoutSimon Ser
Return early from apply_output_config if the output is disabled. This restores our previous behavior [1]. [1]: https://github.com/swaywm/sway/commit/0cdcf66bbccfeb1e3a8191cedd5f824bb27776a6#diff-4f65f4327e987fef8ec3796cdb07644eL349