aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/tree
Commit message (Collapse)AuthorAge
* focus: beyond fullscreen when focused explicitlyLibravatar lbonn2021-02-25
| | | | | | | When issuing a focus command on a specific container, users expect to proceed it even if is hidden by a fullscreen window. This matches the behavior of i3.
* render: handle containers without output when rendering titlesLibravatar Quantum2021-02-25
| | | | | | | | | | | In e0a94bee8da3271f942c0881ee18a7e2d4138063, it was believed that if the container is being rendered, it must have an output. This turned out not to be the case. When rendering a container, all its children are rendered, even if the children is positioned off screen and thus not having any output. This is the cause of the crash in #6061. This commit introduces a null-check, which fixes #6061.
* container: Add container_is_current_floatingLibravatar Kenny Levinsen2021-02-22
| | | | | Needed to check if containers are currently floating from render code, as container_is_floating checks pending state.
* 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.
* view: Read geometry directly in view_update_sizeLibravatar Kenny Levinsen2021-02-09
|
* transaction: Move centering to view_center_surfaceLibravatar Kenny Levinsen2021-02-09
| | | | This will allow us to reuse it for centering elsewhere.
* Switch to wlr_xdg_surface_for_each_popup_surfaceLibravatar Simon Ser2021-01-12
| | | | | | | | 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
* introduce workspace_squashLibravatar Ronan Pigott2020-12-20
| | | | | | | | | | | | | | | | | | 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.
* Change workspace_layout to match i3 behaviorLibravatar Ronan Pigott2020-12-20
| | | | | | | 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.
* tree/container: introduce `container_is_sticky[_or_child]` functionsLibravatar Tudor Brindus2020-11-11
| | | | | | | | | | 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.)
* output: evacuate sticky containers only if new output has a workspaceLibravatar mwenzkowski2020-10-27
| | | | | | | 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.
* xwayland: listen to `set_geometry` eventLibravatar Tudor Brindus2020-10-18
| | | | | | Closes #5735, refs #3007. This makes the "Search everywhere" dialog in JetBrains IDEs movable.
* xwayland: support views that change override-redirect statusLibravatar Tobias Langendorf2020-10-10
|
* view: remove foreign toplevel listeners on destroyLibravatar Ronan Pigott2020-08-05
|
* view: implement foreign toplevel fullscreen requestLibravatar Ronan Pigott2020-08-05
|
* Fix X11 clients getting stuck minimizedLibravatar Tobias Langendorf2020-07-22
| | | | | | | | | | | 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.
* input: implement xdg_toplevel interactive resize hintsLibravatar Ronan Pigott2020-07-13
|
* commands/move: unwrap workspace container on move to new workspaceLibravatar Tudor Brindus2020-07-01
| | | | | | | | | 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.
* Implement wlr-foreign-toplevel-management-v1Libravatar Drew DeVault2020-06-23
|
* Add support for viewporterLibravatar Simon Ser2020-06-17
| | | | | | Depends on [1]. [1]: https://github.com/swaywm/wlroots/pull/2092
* tree/view: fix smart gaps when ancestor container is tabbed or stackedLibravatar Tudor Brindus2020-06-08
| | | | Fixes #5406.
* 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.
* Save transform during transactionLibravatar Kalyan Sriram2020-06-05
| | | Closes: https://github.com/swaywm/sway/issues/5412
* container: Remove useless surface dimensionsLibravatar Kenny Levinsen2020-06-03
| | | | The adjustments to resize logic left them unnecessary.
* view: Save all buffers associated with viewLibravatar Kenny Levinsen2020-06-03
| | | | | | | | | | | | 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.
* Add views idle inhibition status in get_tree outputLibravatar Damien Tardy-Panis2020-05-29
| | | | Fixes #5286
* Fix typos in commentsLibravatar Martin Michlmayr2020-05-21
|
* commands: Add per-view shortcuts_inhibitor commandLibravatar Michael Weiser2020-05-13
| | | | | | | | | | | | | | | | | | | | | 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>
* Use wlr_client_bufferLibravatar Simon Ser2020-03-06
| | | | | | Update for breaking changes in [1]. [1]: https://github.com/swaywm/wlroots/pull/2043
* Fix crash when showing scratchpad hidden split containersLibravatar Ronan Pigott2020-01-16
|
* Revert "Make all the container dimensions integers"Libravatar Simon Ser2020-01-15
| | | | | | This reverts commit 79c5f5ba1245a8c3d575770419a6501447e78919. Fixes: https://github.com/swaywm/sway/issues/4908
* view: remove workspace pid mapping for assignsLibravatar Brian Ashworth2020-01-09
| | | | | | If a view is mapped to a workspace using an assign, the pid should still be removed from the pid mapping list. This prevents child processes from matching against it and mapping a view to a likely undesired workspace.
* Make all the container dimensions integersLibravatar Pedro Côrte-Real2020-01-01
| | | | | | | | | | | | | Containers are always fixed to the pixel grid so position and size them with integers instead of doubles. Functionally this should be no different since rounding down is already being done on things like layout. But it makes it clear what the intention is and avoids bugs where fractional pixels are used. The translating and moving code is still using doubles because the cursors can have fractional pixels and thus the code is plumbed that way. But that could also probably be changed easily by doing the integer conversions earlier and plumbing with int.
* Avoid numerical instability in resizeLibravatar Pedro Côrte-Real2020-01-01
| | | | | | | | | | | | | | | | | | | Because the layout code rounds down the dimensions of the windows resizing would often be off by one pixel. The width/height fraction would not exactly reflect the final computed width and so the resize code would end up calculating things wrong. To fix this first snap the container size fractions to the pixel grid and only then do the resize. Also use round() instead of floor() during layout to avoid a slightly too small width. This applies in two cases: 1. For the container we are actually resizing using floor() might result in being 1px too small. 2. For the other containers it might result in resizing them down by 1px and then if the container being resized is the last all those extra pixels would make the resize too large. Fixes #4391
* view: add max_render_timeLibravatar Ivan Molodetskikh2019-11-17
|
* Remove xdg-shell v6 supportLibravatar Simon Ser2019-08-20
| | | | | | All major toolkits and apps have gained xdg-shell stable support. Closes: https://github.com/swaywm/sway/issues/3690
* Remove all wayland-server.h includesLibravatar Simon Ser2019-07-27
| | | | | | | | | | | | | | | The documentation for wayland-server.h says: > Use of this header file is discouraged. Prefer including > wayland-server-core.h instead, which does not include the server protocol > header and as such only defines the library PI, excluding the deprecated API > below. Replacing wayland-server.h with wayland-server-core.h allows us to drop the WL_HIDE_DEPRECATED declaration. This commit si similar to wlroots' ca45f4490ccc ("Remove all wayland-server.h includes").
* Sanity check gaps between tiled containersLibravatar Pedro Côrte-Real2019-07-15
| | | | | | | When the gaps become too large for the space available gracefully reduced them all the way to 0 if needed. Fixes #4294
* Rework gaps code to be simpler and correctLibravatar Pedro Côrte-Real2019-07-15
| | | | | | | | | | | | | Instead of tracking gaps per child apply gaps in two logical places: 1. In tiled containers use the layout code to add the gaps between windows. This is much simpler and guarantees that the sizing of children is correct. 2. In the workspace itself apply all the gaps around the edge. Here we're in the correct position to size inner and outer gaps correctly and decide on smart gaps in a single location. Fixes #4296
* Layout tiled using a width/height fractionLibravatar Pedro Côrte-Real2019-07-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using container->width/height as both the input and output of the layout calculation have container->width_fraction/height_fraction as the share of the parent this container occupies and calculate the layout based on that. That way the container arrangement can always be recalculated even if width/height have been altered by things like fullscreen. To do this several parts are reworked: - The vertical and horizontal arrangement code is ajusted to work with fractions instead of directly with width/height - The resize code is then changed to manipulate the fractions when working on tiled containers. - Finally the places that manipulated width/height are adjusted to match. The adjusted parts are container split, swap, and the input seat code. It's possible that some parts of the code are now adjusting width and height only for those to be immediately recalculated. That's harmless and since non-tiled containers are still sized with width/height directly it may avoid breaking other corner cases. Fixes #3547 Fixes #4297
* Make mouse drag in tiled mode swap containers if no edge is selectedLibravatar Sebastian Parborg2019-07-09
| | | | | Now the highlighted center area of containers triggers a swap action instead of moving around the containers.
* Fix sway crashes for scratchpad layoutsLibravatar Rouven Czerwinski2019-06-16
| | | | | | | | | | | | | | Currently container_replace removes the container from the scratchpad and re-adds it afterwards. For the split commands this results in the container being send to the scratchpad, which results in a NULL segfault if the same container should be shown. Pass an optional workspace to root_scratchpad_add_container, if the workspace is passed the window will continue to show on the workspace. If NULL is passed it is sent to the scratchpad. This was an issue if no other window except the scratchpad container was on the workspace. Fixes #4240
* Use parent get_root_coords in subsurfacesLibravatar Kenny Levinsen2019-05-30
| | | | | | | | Subsurfaces need access to the parent get_root_coords impl for positioning in popups. To do this, we store a reference to the parent view_child where applicable. Fixes #4191.
* Honor output for xdg_toplevel_set_fullscreenLibravatar Brian Ashworth2019-04-11
| | | | | | | | | | | | | | This honors the fullscreen output request for `xdg_toplevel_set_fullscreen` and `zxdg_toplevel_v6_set_fullscreen`. If the request was sent before mapping, the fullscreen output request will be retrieved from the client_pending state for the toplevel. The output will be passed to `view_map` and if there is a workspace on the output, the view will be placed on that workspace. If the request comes in after being mapped, the view will be moved to the workspace on the output (if there is one) before becoming fullscreen.
* scratchpad: set initial sizeLibravatar Brian Ashworth2019-03-31
| | | | | | This matches i3's behavior of setting scratchpad containers to 50% of the workspace's width and 75% of the workspace's height, bound by the minimum and maximum floating width/height.
* Fix xwayland configure request scratchpad crashLibravatar Brian Ashworth2019-03-31
| | | | | | | | | | | | | | | | | | This fixes a crash in `container_init_floating` when a xwayland view sends a configure request while in the scratchpad. `container_init_floating` gets called so the configured minimum and maximum sizes gets respected when resizing to the requested size. Since the workspace was NULL, it would SIGSEGV when attempting to get the workspace's output for the output box retrieval. This extracts the resizing portion of `container_init_floating` into a separate function. If the container is in the scratchpad, it will just be resized and skip the centering. Additionally, `container_init_floating` has been renamed to `container_floating_resize_and_center` to more accurately describe what it does.
* Allow for workspace renaming during exec handlingLibravatar mliszcz2019-03-23
| | | | | | | | | | | | This change adds support for renaming a workspace when `exec` command is being processed by keeping sway_workspace and pid_workspace names in sync. The change can be verified by running following command: swaymsg exec <application>; swaymsg rename workspace number 1 to 5 Fixes: #3952
* Remove debug treeLibravatar Ryan Dwyer2019-03-18
| | | | This feature has served its purpose. It's better to use IPC now.
* sway_view_child: add listener for view unmapLibravatar Brian Ashworth2019-03-11
| | | | | | | | | | Since not all child views's have an unmap event, it is possible for it to still be mapped (default state) in the destruction handler. When the destruction handler is called, the corresponding view may have already been freed and the memory location reallocated. This adds a listener for the view unmapping and removes the mapped status. This ensures that the child view is damaged due to destruction while the view still exists and not after.
* floating_maximum_size: change default behaviorLibravatar Brian Ashworth2019-03-02
| | | | | | | | | | | | | This changes the way zero (which is the default) is interpreted for both the width and height of `floating_maximum_size`. It now refers to the width and height of the entire output layout, which matches i3's behavior. This also removes duplicated code to calculate the floating constraints in three files. Before this, `container_init_floating` used two-thirds of the workspace width/height as the max and the entire workspace width/height was used everywhere else. Now, all callers use a single function `floating_calculate_constraints`.