aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
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-01commands/focus: force container warp when fulfilling `focus mode_toggle`Tudor Brindus
This commit switches focusing behavior to force a warp when executing `focus mode_toggle`. Fixes #5772.
2020-10-31input: remove motion deltas from seatop callbacksTudor Brindus
Straightforward cleanup, they haven't been used for a while.
2020-10-30hide_cursor: Add an option to hide when typingTamir Zahavi-Brunner
Add an option for the `hide_cursor` command to hide the cursor when typing, i.e. whenever a key is pressed.
2020-10-27output: evacuate sticky containers only if new output has a workspacemwenzkowski
Sticky floating containers on an otherwise empty workspace can only be evacuated if the new output has an active workspace. The noop output may not have one and in that case we have to move the whole workspace to the new output.
2020-10-18transaction: validate X transaction completions by geometry, not sizeTudor Brindus
Xwayland views are aware of their coordinates, so validating transaction completions should take into account the reported coordinates of the view. Prior to this commit they didn't, and matching dimensions would suffice to validate the transaction. Also introduced `transaction_notify_view_ready_immediately` to support the fix from d0f7e0f without jumping through hoops to figure out the geometry of an `xdg_shell` view.
2020-10-18xwayland: listen to `set_geometry` eventTudor Brindus
Closes #5735, refs #3007. This makes the "Search everywhere" dialog in JetBrains IDEs movable.
2020-10-12input/tablet: add tool_mode option to set tablet tools as relative inputTudor Brindus
Closes #4139.
2020-10-11Add support for workspace_min_width bar option.Tarmack
2020-10-10xwayland: support views that change override-redirect statusTobias Langendorf
2020-09-14swaynag: add details background optionMustafa Abdul-Kader
Adds a new config option for details background for swaynag issue/#5673
2020-09-04swaynag: adds option to separately specify the text color for buttonsoliver-giersch
2020-08-27Use wlr_output_event_commitSimon Ser
Instead of listening to both transform and scale events, we can listen to the commit event and use the new wlr_output_event_commit struct to decide what to do. This de-duplicates some of the work we were doing twice when an output was re-configured. Depends on [1]. [1]: https://github.com/swaywm/wlroots/pull/2315
2020-08-24exec: fix validation during config reloadKonstantin Pospelov
Split cmd_exec_always into separate methods for general validation and process creation. This fixes a potential call of join_args with 0 arguments.
2020-08-05view: remove foreign toplevel listeners on destroyRonan Pigott
2020-08-05view: implement foreign toplevel fullscreen requestRonan Pigott
2020-07-22Fix X11 clients getting stuck minimizedTobias Langendorf
Usually it should be enough to simply not grant a client's minimize request, however some applications (Steam, fullscreen games in Wine) don't wait for the compositor and minimize anyway, getting them stuck in an unrecoverable state. Restoring them immediately lead to heavy flickering when unfocused on my test application (Earth Defense Force 5 via Steam), so it's preferable to grant their request without actually minimizing and then restoring them once they are in focus again.
2020-07-21moved and renamed movement-unit parsing to commonNils Schulte
2020-07-13input: implement xdg_toplevel interactive resize hintsRonan Pigott
2020-07-10config/output: don't change output state before commitSimon Ser
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
2020-07-07Reload command now matches i3's implementationGeoffrey Casper
2020-07-01commands/move: unwrap workspace container on move to new workspaceTudor Brindus
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.
2020-06-30seat: Refocus seat when wlr_drag is destroyedKenny Levinsen
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
2020-06-23Implement wlr-foreign-toplevel-management-v1Drew DeVault
2020-06-19input: disable events for map_to_output devices when output not presentTudor Brindus
Fixes #3449.
2020-06-18input/pointer: don't trigger pointer bindings for emulated inputTudor Brindus
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-18input/cursor: send idle events based off device type, not input typeTudor Brindus
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-06-17Add support for viewporterSimon Ser
Depends on [1]. [1]: https://github.com/swaywm/wlroots/pull/2092
2020-06-16input/keyboard: wlr_keyboard_group enter and leaveBrian Ashworth
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-14i3-compat: add GET_BINDING_STATE IPC commandJason Nader
2020-06-08tree/view: fix smart gaps when ancestor container is tabbed or stackedTudor Brindus
Fixes #5406.
2020-06-09swaynag: allow specifying more buttons which execute and dismissGraham Christensen
I don't love -z / -Z, but I figure this patch is far from being accepted for other reasons too.
2020-06-07tree/container: introduce `container_toplevel_ancestor` helperTudor Brindus
This allows us to not have to explicitly write the same while loop everywhere.
2020-06-06common/util: fix `get_current_time_msec` returning microsecondsTudor Brindus
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 transactionKalyan Sriram
Closes: https://github.com/swaywm/sway/issues/5412
2020-06-03container: Remove useless surface dimensionsKenny Levinsen
The adjustments to resize logic left them unnecessary.
2020-06-03view: Save all buffers associated with viewKenny Levinsen
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-29Add views idle inhibition status in get_tree outputDamien Tardy-Panis
Fixes #5286
2020-05-29input/cursor: rename `simulated_tool_tip_down` to be more accurateTudor Brindus
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 constraintTudor Brindus
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-25input/tablet: add seatop_down entry for tablet inputTudor Brindus
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 featuresÉrico Rolim
- Remove struct definitions - Remove struct members - Remove initializations and frees
2020-05-21Fix typos in commentsMartin Michlmayr
2020-05-21input/pointer: only warp cursor when the confine region has changedTudor Brindus
Refs #5268.
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-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-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: 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