aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree
Commit message (Collapse)AuthorAge
...
* Better handle outputs without CRTCLibravatar emersion2019-01-18
| | | | | | | This happens if you plug in more outputs than supported by your GPU. This patch makes it so outputs without CRTCs appear as disabled. As soon as they get a CRTC (signalled via the mode event), we can enable them.
* output: remove output_add_listenersLibravatar emersion2019-01-18
| | | | | Simplify the code by registering signals when outputs are created and removing signals when they are destroyed.
* Do not damage view child when container is NULLLibravatar Brian Ashworth2019-01-15
| | | | | In `view_child_damage`, do not damage the surface if it has been unmapped or if the container is NULL.
* Handle hidden scratchpad containers in commandsLibravatar Brian Ashworth2019-01-15
| | | | | | | This fixes the handling of hidden scratchpad containers for some commands. For the most part, this just prevents running the commands on hidden scratchpad containers, but there are some commands that have some special handling for them.
* Refactor seat operations to use an interfaceLibravatar Ryan Dwyer2019-01-10
| | | | | | | | | | | | | | | | | | This splits each seat operation (drag/move tiling/floating etc) into a separate file and introduces a struct sway_seatop_impl to abstract the operation. The move_tiling_threshold operation has been merged into move_tiling. The main logic for each operation is untouched aside from variable renames. The following previously-static functions have been made public: * node_at_coords * container_raise_floating * render_rect * premultiply_alpha * scale_box
* Fix segfaults on output destructionLibravatar Brian Ashworth2019-01-10
| | | | | | | | | | | | | | | | | This fixes two causes of segfaulting when an output is destroyed. The first occurred when an output was never enabled. The issue was that the destroy signal was never initialized so when it was emitted, sway segfaulted. This was fixed by moving the initialization into `output_create` since all outputs, regardless of whether they have ever been enabled, will be destroyed at some point. The second occurred when the cursor was on an output that was being destroyed. The sway output would have already been removed, but if there are other outputs, a cursor rebase would still occur. Since the wlr_output still existed and the sway output was destroyed, the cursor could be over nothing, resulting in a segfault when trying to get the sway output, which was destroyed.
* seat: unhide the cursor if it is warped to focusLibravatar Rouven Czerwinski2019-01-07
| | | | | | Unhide the cursor if container warping is enabled. Also set the image_surface to NULL during view_unmap, otherwise the cursor will try to access the surface which is currently being unmapped.
* view: use seat_consider_warp_to_focus in view_unmapLibravatar Rouven Czerwinski2019-01-07
| | | | | The view_unmap function contained an open coded version of seat_consider_warp_to_focus, replace it with a call to the function.
* Set font options when computing text width.Libravatar John Chen2018-12-31
| | | | Fix #2869
* Fix crash when scratchpad contains split containersLibravatar Ryan Dwyer2018-12-29
| | | | | | | | | | | | | | | | | | | | | To reproduce: * Launch two terminals in a workspace * `focus parent` to select both terminals * `move scratchpad` * `scratchpad show` to show the terminals * `scratchpad show` to hide the terminals * `scratchpad show` - crash When hiding the terminals, it should be moving focus to whatever is in the workspace, but this wasn't happening because the focus check didn't consider split containers. So the terminals were hidden in the scratchpad while still having focus. This confused the next invocation of scratchpad show, causing it to attempt to hide them instead of show them, and the hide-related code caused a crash when it tried to arrange the workspace which was NULL. This patch corrects the focus check.
* Fix wlr_box_intersection args for wlroots 1441Libravatar Brian Ashworth2018-12-22
| | | | | The fix pushed to master missed wlr_box_intersection. This just fixes those lines so sway renders properly again
* Combine output_by_name and output_by_identifierLibravatar Brian Ashworth2018-12-20
| | | | | | | | This combines `output_by_name` and `output_by_identifier` into a single function called `output_by_name_or_id`. This allows for output identifiers to be used in all commands, simplifies the logic of the callers, and is more efficient since worst case is a single pass through the output list.
* Terminate swaybg in output_disableLibravatar Brian Ashworth2018-12-19
| | | | | | | | Moves the call to `terminate_swaybg` from inside `apply_output_config` to `output_disable`. The former was only called when an output was being disabled. The latter is called when an output is being disabled and when an output becomes disconnected. Without this, disconnecting an enabled output would result in a defunct swaybg process.
* Allow output ids and wildcard for workspace outputLibravatar Brian Ashworth2018-12-17
| | | | | | | | | This allows for output identifiers and to be used in the `workspace <workspace> output <outputs...>` command. Previously, only output names would be allowed. If an output identifier was given, it would never match an output. This also allows for the wildcard character (`*`) to be specified, which can be used to generate a list of workspace names that should be used when generating new workspaces
* Fix criteria execution in view_mapLibravatar mwenzkowski2018-12-12
| | | | | | | | | This patch moves view_execute_criteria(view) below the fullscreen code. Previously, if a view requested to be started in fullscreen, this was done after execution of criteria and hence it was impossible to disable fullscreen via criteria. Fixes #3285
* list.c: rename free_flat_list to list_free_items_and_destroyLibravatar Ian Fan2018-12-09
|
* list.c: Remove list_foreachLibravatar Ian Fan2018-12-09
| | | | | Most occurrences have been replaced by `free_flat_list` which has been moved from stringop.c to list.c. The rest have been replaced by for loops.
* Fix default_orientation autoLibravatar Brian Ashworth2018-11-28
| | | | | | | | Since the output config is no longer applied before creating the default workspace, the layout for default workspaces on an output may not be correct. Due to the ordering of calls in output_enable being changed in several bug fix PRs, this just fixes the layout after the call to apply_output_config.
* Fix scratchpad segfault - NULL focused workspaceLibravatar Brian Ashworth2018-11-28
| | | | | | | | When adding a container to the scratchpad, it was possible for focus to be removed from the seat. This occurred when a single child was moved from it's parent to the scratchpad due to the focus_inactive for the parent being NULL. If the focus_inactive for the parent is NULL, the focus_inactive for the workspace should be focused.
* Fix segfault when destroying unmapped child viewLibravatar emersion2018-11-28
|
* Merge pull request #3199 from emersion/handle-subsurface-destroyLibravatar Ryan Dwyer2018-11-28
|\ | | | | Handle destroyed subsurfaces
| * Damage view child when destroyedLibravatar emersion2018-11-27
| |
| * Handle destroyed subsurfacesLibravatar emersion2018-11-27
| | | | | | | | | | | | | | | | | | | | Damage subsurfaces when they are destroyed. Since subsurfaces don't have an unmap event we need to do that on destroy. We also don't want to keep a sway_view_child when the wlr_subsurface has been destroyed. Fixes https://github.com/swaywm/sway/issues/3197
* | Change execute_command to return a list of resultsLibravatar Brian Ashworth2018-11-27
|/ | | | | | This matches i3's behavior of returning a list of results that contain the result of each command that was executed. Additionally, the `parse_error` attribute has been added to the IPC JSON reply.
* IPC: Trigger move events for scratchpad containersLibravatar Mihai Coman2018-11-26
| | | | | | This patch allows IPC clients to receive window::move events when containers are moved to scratchpad or when hidden containers are shown via "scratchpad show" command.
* Fix pango title escapingLibravatar emersion2018-11-25
| | | | | | | | | | | | | | This commit fixes two bugs. First, commit [1] has inverted the condition when we escape pango markup. We need to escape client-provided strings when markup is enabled. Second, parse_title_format has a shortcut when title_format is set to `%title`, and escape_pango_markup wasn't used anymore there. Fixes https://github.com/swaywm/sway/issues/3181 [1]: https://github.com/swaywm/sway/pull/3179/commits/caee2dff03fc007dc46cf121e013f5347ac46ba9
* Merge pull request #3179 from baloo/baloo/title_format-pango_markupLibravatar emersion2018-11-24
|\ | | | | fixes pango_markup support with title_format
| * fixes pango_markup support with title_formatLibravatar Arthur Gautier2018-11-24
| | | | | | | | | | | | | | The support for pango_markup was broken in title_format because the formated title was escaped. I think only the payload should be escaped. This commit fixes 789a877b379cd35c350610be62b971ae00feb542
* | Adding commands for configuring titlebar borders and paddingLibravatar Florent de Lamotte2018-11-22
|/
* Use #if instead of #ifdefLibravatar emersion2018-11-18
|
* Move view {x,y,width,height} into container structLibravatar Ryan Dwyer2018-11-17
| | | | | | | | | | | | | | | | | | | This renames/moves the following properties: * sway_view.{x,y,width,height} -> sway_container.content_{x,y,width,height} * This is required to support placeholder containers as they don't have a view. * sway_container_state.view_{x,y,width,height} -> sway_container_state.content_{x,y,width,height} * To remain consistent with the above. * sway_container_state.con_{x,y,width,height} -> sway_container_state.{x,y,width,height} * The con prefix was there to give it contrast from the view properties, and is no longer useful. The function container_set_geometry_from_floating_view has also been renamed to container_set_geometry_from_content.
* Allow multiple outputs for workspace outputLibravatar Brian Ashworth2018-11-11
| | | | | | | | | | | | `i3 4.16` allows users to list multiple outputs for a workspace and the first available will be used. The syntax is as follows: `workspace <workspace> output <outputs...>` Additionally when the workspace is created, the outputs get added to the output priority list in the order specified. This ensures that if a higher output gets connected, the workspace will move to the higher output. This works the same way as if the user had a workspace on an output, disconnected the output, and then later reconnected the output.
* Merge pull request #3087 from RedSoxFan/side-gapsLibravatar Ryan Dwyer2018-11-08
|\ | | | | Implement per side and per direction outer gaps
| * Implement per side and per direction outer gapsLibravatar Brian Ashworth2018-11-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces the following command extensions from `i3-gaps`: * `gaps horizontal|vertical|top|right|bottom|left <amount>` * `gaps horizontal|vertical|top|right|bottom|left all|current set|plus|minus <amount>` * `workspace <ws> gaps horizontal|vertical|top|right|bottom|left <amount>` `inner` and `outer` are also still available as options for all three of the above commands. `outer` now acts as a shorthand to set/alter all sides. Additionally, this fixes two bugs with the prevention of invalid gap configurations for workspace configs: 1. If outer gaps were not set and inner gaps were, the outer gaps would be snapped to the negation of the inner gaps due to `INT_MIN` being less than the negation. This took precedence over the default outer gaps. 2. Similarly, if inner gaps were not set and outer gaps were, inner gaps would be set to zero, which would take precedence over the default inner gaps. Fixing both of the above items also requires checking the gaps again when creating a workspace since the default outer gaps can be smaller than the negation of the workspace specific inner gaps.
* | gaps: remove duplicate inner gapsLibravatar Brian Ashworth2018-11-07
|/
* Fix #2992Libravatar mwenzkowski2018-11-01
| | | | Move a function call, such that data it depends on is initialized before.
* Move view marks properties to container structLibravatar Ryan Dwyer2018-11-01
| | | | | Like border properties, this will be needed to implement layout saving and restoring.
* Move view border properties to container structLibravatar Ryan Dwyer2018-10-31
| | | | | | This will be needed to implement layout saving and restoring, as we need to be able to configure borders on a placeholder container which has no view.
* Merge pull request #3031 from atomnuker/masterLibravatar Drew DeVault2018-10-31
|\ | | | | Restore previous tabbed layout behavior
| * Revert "Respect border settings when rendering lone tabbed/stacked child"Libravatar Rostislav Pehlivanov2018-10-30
| | | | | | | | This reverts commit 65328ef60c9468ae44b4b1d6316d604c47293ec3.
| * Revert "tree/view.c: fix uninitialized variables warning"Libravatar Rostislav Pehlivanov2018-10-30
| | | | | | | | This reverts commit 6414b5d288b89c9f3ecde0757f16184071b6036f.
* | Remove enum movement_directionLibravatar Ryan Dwyer2018-10-30
|/ | | | | | | | | There's no point having both movement_direction and wlr_direction. This replaces the former with the latter. As movement_direction also contained MOVE_PARENT and MOVE_CHILD items, these are now checked specifically in the focus command and handled in separate functions, just like the other focus variants.
* Merge pull request #3011 from Emantor/fix/2922Libravatar Drew DeVault2018-10-28
|\ | | | | output: initialize layers before usage in apply_config
| * output: initialize layers and signal before using functionsLibravatar Rouven Czerwinski2018-10-28
| | | | | | | | | | | | | | | | | | | | The previous pull request #2993 tried to fix this by moving the function which used the layers after the initilization. Since this initialization is done unconditionally only depending on the struct definition, move the layer initialization to the beginning of the function. Also move the signal initialization of the destroy event. Fixes #2992
* | Use output identifier for workspace configLibravatar Robinhuett2018-10-27
|/
* Revert "Fix #2992"Libravatar Drew DeVault2018-10-27
| | | | This reverts commit 94985146ea00b40f72cd6afaa191fd92a46e4fd3.
* tree/view.c: fix uninitialized variables warningLibravatar Cole Mickens2018-10-26
|
* Respect border settings when rendering lone tabbed/stacked childLibravatar Ryan Dwyer2018-10-27
| | | | | | | | | | | | In i3, when a child of a tabbed or stacked container has no siblings, its border settings are respected. This patch achieves the same effect by rendering a lone tabbed/stacked child as if it's a linear container. This makes the border settings be respected. Over in view_autoconfigure, we compensate for this by only adjusting `y_offset` if there's multiple children.
* Fix #2992Libravatar mwenzkowski2018-10-26
| | | | Move a function call, such that data it depends on is initialized before.
* Fix re-tiling for floating containersLibravatar Mihai Coman2018-10-25
| | | | | | When a floating container is tiled (e.g.: 'floating toggle' or 'floating disable'), it should be placed after/below the inactive focused container from the tiling layout.