aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
AgeCommit message (Collapse)Author
2021-02-09view: Read geometry directly in view_update_sizeKenny Levinsen
2021-02-09shells: Only center tiled views on size changeKenny Levinsen
The size of a tiled container cannot change in response to new buffer sizes, so there is no need to commit a new transaction. Instead, simply recenter the view with the new geometry, leaving the full transaction flow for floating containers.
2021-02-09transaction: Move centering to view_center_surfaceKenny Levinsen
This will allow us to reuse it for centering elsewhere.
2021-02-09view: Save surface x and y on saved buffersKenny Levinsen
We need to use surface_x and surface_y when rendering and damaging saved buffers as these compensate for views that have been centered due to being smaller than their container. Add them to the surface positions on the saved buffer so we have the values from the time the buffer was saved.
2021-01-30Check the output state for recorded workspacesKonstantin Pospelov
Sway records pid, workspace, and output for every new process. However, if the output gets disabled and the workspace disappears, the workspace is still re-created on the disabled output. This commit adds a check for the enabled flag, so that NULL will be passed to workspace_create() in this case.
2021-01-25Implement foreign toplevel fullscreen output hintsfwsmit
2021-01-20Adhere to ICCCM focus specificationBrassyPanache
For certain applications (e.g. JetBrains) the parent window controls input. We need to adhere to the ICCCM input focus specification to properly handle these cases. Relates to swaywm/wlroots#2604
2021-01-12Switch to wlr_xdg_surface_for_each_popup_surfaceSimon Ser
Instead of calling wlr_xdg_surface_for_each_popup and then wlr_surface_for_each_surface, use the new for_each_popup_surface helper introduced in [1] that does it in one go. [1]: https://github.com/swaywm/wlroots/pull/2609
2020-12-24container: set fullscreen mode before attempting focusRonan Pigott
2020-12-20workspace: rework workspace prev|next like i3Ronan Pigott
Changes workspace prev|next commands to visit each numbered or named workspace first before considering workspace from the other category
2020-12-20introduce workspace_squashRonan Pigott
workspace_squash is container_flatten in the reverse direction. Instead of eliminating redundant splits that are parents of the target container, it eliminates pairs of redundant H/V splits that are children of the workspace. Splits are redundant if a con and its grandchild have the same layout, and the immediate child has the opposite split. For example, layouts are transformed like: H[V[H[app1 app2]] app3] -> H[app1 app2 app3] i3 uses this operation to simplify the tree after moving heavily nested containers to a higher level in the tree via an orthogonal move.
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-20Revert "commands/move: maintain workspace_layout when moving"Ronan Pigott
This is in preparation for changing the workspace_layout command to work like it does in i3. This reverts commit b4a75a1ab2a72842830aeea37733311f85e6f660.
2020-12-20container: don't split single childrenRonan Pigott
In i3 splits are ineffective on singleton H/V containers, and the command is interpreted to affect the parent layout instead.
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-10-28output: Revert implementation of evacuate_sticky()mwenzkowski
The function evacuate_sticky() was changed in commit 32788a93 to be used by workspace_for_each_container() to make the code more readable. But I overlooked that it is not safe to use workspace_for_each_container() to remove container from a workspace. This commit restores the previous implementation for evacuate_sticky().
2020-10-28In container_split, set a floating container's view to tiledDimitris Triantafyllidis
Currently, when a floating container with a view is split and children are added to it, the new views are rendered as tiled, while the first view stays in floating style. Here this is addressed by setting the view to tiled as soon as the container is split, by duplicating the "view part" of the logic in container_set_floating(..., false). Since the new container of the view is no longer considered floating, it makes sense to set the view to tiling at this point. The view would have to be set back to floating if it was possible to "unsplit" the container.
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-25Smart borders fix: always show borders for floating containersDimitris Triantafyllidis
Currently, in view_autoconfigure, the only condition for show_border is !view_is_only_visible. view_is_only_visible does not cross the boundary between the workspace's tiling and floating lists and does not differentiate between them. The result is, that in a workspace with zero or more tiling containers and a single floating container, the floating container will lose its borders as soon as it is split, provided that a only one view is visible within the floating container. Fixed by adjusting the condition for show_borders.
2020-10-24container: Fix NULL pointer dereferencemwenzkowski
Reset the workspace layout to the output's default only if the workspace is actually attached to an output. Fixes #5762
2020-08-05view: remove foreign toplevel listeners on destroyRonan Pigott
2020-08-05view: implement foreign toplevel fullscreen requestRonan Pigott
2020-08-05view: implement foreign toplevel fullscreen indicatorRonan Pigott
2020-07-25view: display scratchpad hidden containers when activated by ftmRonan Pigott
2020-07-13Assert output is found before removing from listSimon Ser
References: https://github.com/swaywm/sway/issues/5483
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-03commands/move: maintain workspace_layout when movingTudor Brindus
Fixes #5157.
2020-07-03tree/view: fix segfault in view_update_titleSimon Ser
xdg-shell doesn't allow clients to set the title to NULL, so we shouldn't need to call wlr_foreign_toplevel_handle_v1_set_title with an empty string to reset the old one. Closes: https://github.com/swaywm/sway/issues/5488
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-07-01tree/view: Make foreign-toplevel app_id fallback to classJohan Bjäreholt
It is not a part of the foreign-toplevel-management protocol to get the class of a toplevel, only for getting the app_id. For xwayland clients this is an issue because that means that you cannot identify what application the toplevel refers to which is the point of the app_id property. By falling back to class when an app_id does not exist solves this problem. Phoc also uses app_id and class interchangeably in their implementation of foreign-toplevel-management, in fact they always do that and not only for just this protocol. https://source.puri.sm/Librem5/phoc/-/blob/c8d8a4c5440a6c1647b09dbd3bba7999f9cd433c/src/xwayland.c#L236
2020-06-27tree/view: fix smart borders with tabbed/stacked ancestorTudor Brindus
Fixes #5484.
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-17Add support for viewporterSimon Ser
Depends on [1]. [1]: https://github.com/swaywm/wlroots/pull/2092
2020-06-12Remove view child surface_{map,unmap} listeners on destroySimon Ser
2020-06-13view: fix surface_new_subsurface use-after-freeRonan Pigott
2020-06-08tree/view: fix smart gaps when ancestor container is tabbed or stackedTudor Brindus
Fixes #5406.
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-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: update_size should only update pending sizeKenny Levinsen
Updating the current size outside transactions lead to rendering glitches during resizes.
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-30tree/container: refactor `tiling_container_at` to check boundsTudor Brindus
This fixes bugs where a floating container would take input way past its borders when its parent was fullscreen, since the call to `tiling_container_at` in input/cursor.c's `node_at_coords` did not check bounds.
2020-05-29Add views idle inhibition status in get_tree outputDamien Tardy-Panis
Fixes #5286
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-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-02Update for new wlr_buffer APISimon Ser
Update for [1]. [1]: https://github.com/swaywm/wlroots/pull/2044
2020-03-27Fix hit test for floaters that cross outputsJosh Shone
In the case of multiple overlapping floating windows, this commit fixes an issue where the wrong window would be focused in response to a cursor if one of the windows came from a different output (overhanging).
2020-03-06Use wlr_client_bufferSimon Ser
Update for breaking changes in [1]. [1]: https://github.com/swaywm/wlroots/pull/2043