aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree
Commit message (Collapse)AuthorAge
* Assert output is found before removing from listLibravatar Simon Ser2020-07-15
| | | | | References: https://github.com/swaywm/sway/issues/5483 (cherry picked from commit 9bb70283e967037e6d57bc863ef96d3b5185a989)
* config/output: don't change output state before commitLibravatar Simon Ser2020-07-15
| | | | | | | | | | | | | | | | | | | | | | | | 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)
* commands/move: maintain workspace_layout when movingLibravatar Tudor Brindus2020-07-15
| | | | | | Fixes #5157. (cherry picked from commit b4a75a1ab2a72842830aeea37733311f85e6f660)
* tree/view: fix segfault in view_update_titleLibravatar Simon Ser2020-07-15
| | | | | | | | | 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 (cherry picked from commit b5a35c484f651e25b226c9661669c8a40439f09b)
* commands/move: unwrap workspace container on move to new workspaceLibravatar Tudor Brindus2020-07-15
| | | | | | | | | | | 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)
* tree/view: Make foreign-toplevel app_id fallback to classLibravatar Johan Bjäreholt2020-07-01
| | | | | | | | | | | | | | | 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
* tree/view: fix smart borders with tabbed/stacked ancestorLibravatar Tudor Brindus2020-06-27
| | | | Fixes #5484.
* Implement wlr-foreign-toplevel-management-v1Libravatar Drew DeVault2020-06-23
|
* input: disable events for map_to_output devices when output not presentLibravatar Tudor Brindus2020-06-19
| | | | Fixes #3449.
* Add support for viewporterLibravatar Simon Ser2020-06-17
| | | | | | Depends on [1]. [1]: https://github.com/swaywm/wlroots/pull/2092
* Remove view child surface_{map,unmap} listeners on destroyLibravatar Simon Ser2020-06-12
|
* view: fix surface_new_subsurface use-after-freeLibravatar Ronan Pigott2020-06-13
|
* 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: update_size should only update pending sizeLibravatar Kenny Levinsen2020-06-03
| | | | | Updating the current size outside transactions lead to rendering glitches during resizes.
* 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.
* tree/container: refactor `tiling_container_at` to check boundsLibravatar Tudor Brindus2020-05-30
| | | | | | | 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.
* Add views idle inhibition status in get_tree outputLibravatar Damien Tardy-Panis2020-05-29
| | | | Fixes #5286
* 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>
* interpret "subpixel none" as CAIRO_ANTIALIAS_GRAYLibravatar Ian Huang2020-04-20
| | | | | | | | 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)
* Update for new wlr_buffer APILibravatar Simon Ser2020-04-02
| | | | | | Update for [1]. [1]: https://github.com/swaywm/wlroots/pull/2044
* Fix hit test for floaters that cross outputsLibravatar Josh Shone2020-03-27
| | | | 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).
* Use wlr_client_bufferLibravatar Simon Ser2020-03-06
| | | | | | Update for breaking changes in [1]. [1]: https://github.com/swaywm/wlroots/pull/2043
* tree/view: do not attempt enter on hidden childLibravatar Brian Ashworth2020-02-18
| | | | | | | | If a subsurface is created for a surface that is associated with a scratchpad hidden view, do not attempt to send an enter to it. The subsurface is not on any output and since there is no workspace associated with the view, attempting to get the output for the NULL workspace will result in a SIGSEGV.
* output: fix updating output manager configLibravatar Brian Ashworth2020-02-16
| | | | | | | | | | | | | | | | | | The output manager config is created when the output is created. It is updated when the mode, transform, scale, or layout for the output changes, as well as, when the output is destroyed. Since the output->enabled property was not being set before calling apply_output_config, the output event handlers were early returning and never updating the output manager config when the output state was committed. This fixes the issue by setting output->enabled in apply_output_config below the output disabling section. There are also a few other minor changes that are required to function. Additionally, this renames output_enable to output_configure to better describe the recent changes.
* Stop calling apply_output_config from output_enableLibravatar Simon Ser2020-02-11
| | | | | | | | | | | | | | | | The only output_enable caller is now apply_output_config. Stop calling apply_output_config from output_enable to simplify the code and avoid the back-and-forth between these two functions. output_enable is now the symmetric of output_disable: it just marks the output as enabled and performs bookkeeping (e.g. creating teh default workspace). It is called from apply_output_config after the output commit, so that it can read the current output state and act accordingly. This change also allows us to avoid an extraneous wlr_output_commit. References: https://github.com/swaywm/sway/issues/4921
* container_at_{tabbed,stacked}: check x-axis boundsLibravatar Brian Ashworth2020-02-11
| | | | | | | | | The container_at_tabbed and container_at_stacked container were checking the bounds along the y-axis, but not the x-axis. This made it possible to cause a segfault for specific resolution, horizontal gap, and workspace children lengths. The issue is that child_index was -1 and was resulting in a buffer underflow. Adding the x-axis bound checks for early returns should prevent this from happening.
* Fix crash when showing scratchpad hidden split containersLibravatar Ronan Pigott2020-01-16
|
* container: add inactive fullscreen to focus stackLibravatar Brian Ashworth2020-01-14
| | | | | | | | | | | | When a container was being made fullscreen and it is on the focused workspace for a seat, focus was being set to the container. However, when the container was on a non-focused workspace, the focus stack wasn't being touched. When assigning a fullscreen container to a workspace or moving a fullscreen container to a different workspace, this would make it so the fullscreen container was never added to the focus stack for the workspace thus preventing access to the workspace. This adds the container to the top of the focus stack, behind the container on the focused workspace.
* 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 sure we don't calculate fractional pixel gapsLibravatar Pedro Côrte-Real2020-01-01
| | | | | | When gaps are resized for lack of space the calculation could result in a gap size of non-integer pixels. This would result in containers located at non-integer pixels which would be subtly broken.
* 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
* root_scratchpad_hide: disable fullscreen descendantsLibravatar Brian Ashworth2019-12-16
| | | | | | | Any descendant of a scratchpad container may be fullscreen so checking to see if the top-level scratchpad container is fullscreen in root_scratchpad_hide is not sufficient. This iterates through all descendants of the scratchpad container
* Fix lingering workspace with scratchpad showLibravatar Ronan Pigott2019-12-12
| | | | | | | Showing a window in the scratchpad can move a visible scratchpad window from another workspace to the current one. If the scratchpad window was the last visible container in that workspace, the old workspace should be destroyed.
* add scale_filter output config optionLibravatar Ronan Pigott2019-11-29
|
* output: add max_render_timeLibravatar Ivan Molodetskikh2019-11-17
|
* smart_borders: separate smartness from edge typesLibravatar Ronan Pigott2019-11-04
|
* Fix segfault in wlr_output_manager_v1_set_configurationLibravatar Simon Ser2019-10-27
| | | | | | | | | | | | | | Calling wlr_output_manager_v1_set_configuration with an enabled output and a NULL mode is incorrect if the output doesn't support modes. When DPMS'ing an output, wlr_output_enable(output, false) is called. This de-allocates the CRTC and sets wlr_output.current_mode to NULL. Because we mark DPMS'ed outputs as enabled, we also need to provide a correct output mode. Add a field to sway_output to hold the current mode. Closes: https://github.com/swaywm/wlroots/issues/1867
* Fix apply_output_config return value when enabling outputLibravatar Simon Ser2019-10-27
| | | | | apply_output_config would call output_enable and always return true, even if the output couldn't be enabled.
* view: create container before selecting workspaceLibravatar Ronan Pigott2019-09-22
|
* view: always populate pidLibravatar Brian Ashworth2019-09-20
| | | | | | | If the view was mapped as fullscreen or the view was assigned either a workspace or output, the pid was not being populated since it was occurring as part of the pid mapping check in select_workspace. This extracts the pid population and makes it so it is always executed
* Allow moving a container hidden in scratchpadLibravatar lbonn2019-08-20
| | | | | | | (as i3 allows it) Just update the container's coordinates so that they will be applied at the next show.
* 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
* workspace_split: focus middle if workspace focusedLibravatar Brian Ashworth2019-08-14
| | | | | In workspace_split, the middle container that wraps the workspace's children should be focused for any seat that is focusing the workspace
* container_replace: copy {width,height}_fractionLibravatar Brian Ashworth2019-08-14
| | | | | | | | This copies the width and height fractions from the container to the container replacing it. Without setting these values, the container is treated as a new container and throws off the existing sizing. Since one container is replacing the other, it makes sense for the sizing to remain the same.
* workspace: do not destroy if any seat is focusingLibravatar Brian Ashworth2019-08-13
| | | | | | | Since each seat has its own focus, do not destroy a workspace until it is no longer focused by any seat. This prevents seats from being forced to evacuate the workspace just because another seat switched focus away from it
* workspace: prefer identifiers for output priorityLibravatar Brian Ashworth2019-08-13
| | | | | | | | | | Since output names can change in various configurations, including DisplayPort MST, prefer output identifiers for the output priority. Users can still use `workspace <ws> output <names-or-ids>`, but any output that is programmatically added to the list will be added under the output identifier. If the output name exists in the list (from the user workspace output configs), then that will be retained instead of switching to the output identifier for that output.
* view_update_size: fix surface_width/height mismatchLibravatar Antonin Décimo2019-08-12
|