aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorLines
2020-07-10config/output: don't change output state before commitFurkan Sahin-2/+2
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 (cherry picked from commit 5432f00adfdd8375fb422ad9033253d17f04efc7)
2020-07-04Reload command now matches i3's implementationFurkan Sahin-0/+1
(cherry picked from commit ea3ba203cc65671d9bf9da5ddbc698b18ed7685c)
2020-07-01commands/move: unwrap workspace container on move to new workspaceFurkan Sahin-0/+3
If moving e.g. `T[app app]` into a new workspace with `workspace_layout tabbed`, then post-move the tree in that workspace will be `T[T[app app]]`. This still happens with horizontal or vertical workspace layout, but is less visible since those containers have no decorations. Fixes #5426. (cherry picked from commit 92891fb1edef5136ae4eb35fec5b8523f031be81)
2020-06-28seat: Refocus seat when wlr_drag is destroyedFurkan Sahin-0/+6
wlr_drag installs grabs for the full duration of the drag, leading to the drag target not being focused when the drag ends. This leads to unexpected focus behavior, especially for the keyboard which requires toggling focus away and back to set. We can only fix the focus once the grabs are released, so refocus the seat when the wlr_drag destroy event is received. Closes: https://github.com/swaywm/sway/issues/5116
2019-08-20Implement wlr-foreign-toplevel-management-v1Furkan Sahin-0/+6
2020-06-18input: disable events for map_to_output devices when output not presentFurkan Sahin-1/+3
Fixes #3449.
2020-06-14input/pointer: don't trigger pointer bindings for emulated inputFurkan Sahin-1/+1
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.
2020-06-14input/cursor: send idle events based off device type, not input typeFurkan Sahin-1/+1
Previously, a tablet or touch device could report activity as a pointer device if it went through pointer emulation. This commit refactors idle sources to be consistently reported based on the type of the device that generated an input event, and now how that input event is being processed.
2020-04-27Add support for viewporterFurkan Sahin-0/+1
Depends on [1]. [1]: https://github.com/swaywm/wlroots/pull/2092
2020-06-13input/keyboard: wlr_keyboard_group enter and leaveFurkan Sahin-0/+2
This adds support for wlr_keyboard_group's enter and leave events. The enter event just updates the keyboard's state. The leave event updates the keyboard's state and if the surface was notified of a press event for any of the keycodes, it is refocused so that it can pick up the current keyboard state without triggering any keybinds.
2020-06-13i3-compat: add GET_BINDING_STATE IPC commandFurkan Sahin-0/+3
2020-05-31tree/view: fix smart gaps when ancestor container is tabbed or stackedFurkan Sahin-4/+5
Fixes #5406.
2020-06-07swaynag: allow specifying more buttons which execute and dismissFurkan Sahin-0/+1
I don't love -z / -Z, but I figure this patch is far from being accepted for other reasons too.
2020-06-04tree/container: introduce `container_toplevel_ancestor` helperFurkan Sahin-0/+7
This allows us to not have to explicitly write the same while loop everywhere.
2020-06-05common/util: fix `get_current_time_msec` returning microsecondsFurkan Sahin-1/+7
This commit makes `get_current_time_msec` correctly return milliseconds as opposed to microseconds. It also considers the value of `tv_sec`, so we don't lose occasionally go back in time by one second. Finally, the function is moved into `util.c` so that it can be reused elsewhere without having to consider these pitfalls.
2020-06-05Save transform during transactionFurkan Sahin-0/+1
Closes: https://github.com/swaywm/sway/issues/5412
2020-06-03container: Remove useless surface dimensionsFurkan Sahin-1/+0
The adjustments to resize logic left them unnecessary.
2020-05-31view: Save all buffers associated with viewFurkan Sahin-5/+8
During the execution of a resize transaction, the buffer associated with a view's surface is saved and reused until the client acknowledges the resulting configure event. However, only one the main buffer of the main surface was stored and rendered, meaning that subsurfaces disappear during resize. Iterate over all, store and render buffers from all surfaces in the view to ensure that correct rendering is preserved.
2020-05-05Add views idle inhibition status in get_tree outputFurkan Sahin-0/+8
Fixes #5286
2020-05-28input/cursor: rename `simulated_tool_tip_down` to be more accurateFurkan Sahin-1/+1
This is a tiny cleanup commit that renames `simulated_tool_tip_down` to `simulating_pointer_from_tool_tip`, making it match `simulating_pointer_from_touch`. This is a better name since it makes it clear that it's the *pointer* that's being simulated, not the tool tip.
2020-05-26input/cursor: keep reference to cursor in constraintFurkan Sahin-0/+1
set_region accepts a NULL *data, so we can't use it to reference the constraint and find the cursor through its seat. Fixes #5386.
2020-05-04input/tablet: add seatop_down entry for tablet inputFurkan Sahin-0/+6
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 — 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.
2020-05-21Remove code related to the security featuresFurkan Sahin-78/+0
- Remove struct definitions - Remove struct members - Remove initializations and frees
2020-05-16Fix typos in commentsFurkan Sahin-1/+1
2020-05-02input/pointer: only warp cursor when the confine region has changedFurkan Sahin-0/+2
Refs #5268.
2020-03-12commands: Add per-view shortcuts_inhibitor commandFurkan Sahin-0/+11
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-04-18Implement pointer simulation if client hasn't bound to touchFurkan Sahin-0/+2
2020-05-07input/tablet: simplify parameter plumbing for tablet referencesFurkan Sahin-3/+2
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-02input: rename pointer handlers to be unambiguousFurkan Sahin-5/+7
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-04-25input: refactor tablet motion into seatop handlerFurkan Sahin-0/+7
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-04-25input/cursor: make cursor rebasing cursor type-agnosticFurkan Sahin-0/+4
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-04-14Add a secondary headless backendFurkan Sahin-0/+2
This allows the create_output command to work on DRM too.
2020-04-25input/cursor: release simulated tool tip button when over v2 surfaceFurkan Sahin-0/+1
e13cc6f addressed sending v2 tool tip up when over a non-v2 surface. This commit addresses the other direction. Fixes #5230.
2020-04-23swaybar: Fix scrolling with precise trackpadsFurkan Sahin-0/+11
2020-04-19input/cursor: fix hide cursor timeouts on tablets and touchscreensFurkan Sahin-1/+2
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-10input: Mark virtual devices as suchFurkan Sahin-0/+1
This is for internal configuration purposes
2020-03-31Use bitshifts for bitfieldsFurkan Sahin-57/+63
Instead of hardcoded power of 2 values, use bitshifts. This makes the enums more readable, avoids mistakes, and makes it clear how much of the int32_t bit space we have left. While at it, fix other minor style issues.
2019-12-03Render layer shell popups over the top layerFurkan Sahin-0/+8
2020-04-08Introduce test_output_configFurkan Sahin-0/+2
This function checks whether the backend would accept an output configuration, without applying the changes.
2020-01-12im: make text-input listeners per text-inputFurkan Sahin-4/+5
2019-10-18Port input method and text input from rootstonFurkan Sahin-0/+70
This ports swaywm/wlroots#1203, swaywm/wlroots#1303, swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway. Co-Authored-By: Leo Chen <leo881003@gmail.com>
2020-03-09tray: track SNI callbacksFurkan Sahin-3/+10
This removes any pending messages once the item is destroyed. Furthermore, this installs SNI event calbacks asynchronously in order to prevent sd-bus from bypassing pending messages.
2020-03-04tray: tidy codeFurkan Sahin-8/+7
This includes some refactoring and fixing a small memory leak.
2019-06-15tray: allow themes to inherit from multiple themesFurkan Sahin-1/+1
2020-03-23add --no-repeat option for bindingsFurkan Sahin-0/+1
This allows e.g. triggering one command while a key is held, then triggering another to undo the change performed by it afterwards. One use case for this is triggering push-to-talk functionality for VoIP tools without granting them full access to all input events. Fixes #3151
2020-02-16commands: Add shortcuts_inhibitor commandFurkan Sahin-0/+8
Add a command to influence keyboard shortcuts inhibitors. In its current form it can be used to activate, deactivate or toggle an existing inhibitor on the surface currently receiving input. This can be used to define an escape shortcut such as: bindsym --inhibited $mod+Escape seat - shortcuts_inhibitor deactivate It also allows the user to configure a per-seat default of whether keyboard inhibitors are honoured by default (the default) or not. Using the activate/toggle command they can then enable the lingering inhibitor at a later time of their choosing. As a side effect this allows to specifically address a named seat for actions as well, whatever use-case that might serve. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2020-02-15input: Add support for keyboard shortcuts inhibitFurkan Sahin-0/+22
Adding support for the keyboard shortcuts inhibit protocol allows remote desktop and virtualisation software to receive all keyboard input in order to pass it through to their clients so users can fully interact the their remote/virtual session. The software usually provides its own key combination to release its "grab" to all keyboard input. The inhibitor can be deactivated by the user by removing focus from the surface using another input device such as the pointer. Use support for the procotol in wlroots to add support to sway. Extend the input manager with handlers for inhibitor creation and destruction and appropriate bookkeeping. Attach the inhibitors to the seats they apply to to avoid having to search the list of all currently existing inhibitors on every keystroke and passing the inhibitor manager around. Add a helper function to retrieve the inhibitor applying to the currently focused surface of a seat, if one exists. Extend bindsym with a flag for bindings that should be processed even if an inhibitor is active. Conversely this disables all normal shortcuts if an inhibitor is found for the currently focused surface in keyboard::handle_key_event() since they don't have that flag set. Use above helper function to determine if an inhibitor exists for the surface that would eventually receive input. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2020-02-17config: Fix typo in reload bindsym flag bitmaskFurkan Sahin-1/+1
Fix a typo in the bit mask value of the BINDING_RELOAD flag introduced in commit 7be6bdc9e so it can work as intended. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2020-03-02Add an adaptive_sync output commandFurkan Sahin-0/+2
This enables/disables adaptive synchronization on the output. For now, the default is disabled because it might cause flickering on some hardware if clients don't submit frames at regular enough intervals. In the future an "auto" option will only enable adaptive sync if a fullscreen client opts-in via a Wayland protocol.
2020-02-28Use wlr_client_bufferFurkan Sahin-1/+1
Update for breaking changes in [1]. [1]: https://github.com/swaywm/wlroots/pull/2043