aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
AgeCommit message (Collapse)Author
2018-12-12Fix criteria execution in view_mapmwenzkowski
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
2018-12-09list.c: rename free_flat_list to list_free_items_and_destroyIan Fan
2018-12-09list.c: Remove list_foreachIan Fan
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.
2018-11-28Fix default_orientation autoBrian Ashworth
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.
2018-11-28Fix scratchpad segfault - NULL focused workspaceBrian Ashworth
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.
2018-11-28Fix segfault when destroying unmapped child viewemersion
2018-11-28Merge pull request #3199 from emersion/handle-subsurface-destroyRyan Dwyer
Handle destroyed subsurfaces
2018-11-27Change execute_command to return a list of resultsBrian Ashworth
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.
2018-11-27Damage view child when destroyedemersion
2018-11-27Handle destroyed subsurfacesemersion
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
2018-11-26IPC: Trigger move events for scratchpad containersMihai Coman
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.
2018-11-25Fix pango title escapingemersion
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
2018-11-24Merge pull request #3179 from baloo/baloo/title_format-pango_markupemersion
fixes pango_markup support with title_format
2018-11-24fixes pango_markup support with title_formatArthur Gautier
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
2018-11-22Adding commands for configuring titlebar borders and paddingFlorent de Lamotte
2018-11-18Use #if instead of #ifdefemersion
2018-11-17Move view {x,y,width,height} into container structRyan Dwyer
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.
2018-11-11Allow multiple outputs for workspace outputBrian Ashworth
`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.
2018-11-08Merge pull request #3087 from RedSoxFan/side-gapsRyan Dwyer
Implement per side and per direction outer gaps
2018-11-07Implement per side and per direction outer gapsBrian Ashworth
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.
2018-11-07gaps: remove duplicate inner gapsBrian Ashworth
2018-11-01Fix #2992mwenzkowski
Move a function call, such that data it depends on is initialized before.
2018-11-01Move view marks properties to container structRyan Dwyer
Like border properties, this will be needed to implement layout saving and restoring.
2018-10-31Move view border properties to container structRyan Dwyer
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.
2018-10-31Merge pull request #3031 from atomnuker/masterDrew DeVault
Restore previous tabbed layout behavior
2018-10-30Remove enum movement_directionRyan Dwyer
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.
2018-10-30Revert "Respect border settings when rendering lone tabbed/stacked child"Rostislav Pehlivanov
This reverts commit 65328ef60c9468ae44b4b1d6316d604c47293ec3.
2018-10-30Revert "tree/view.c: fix uninitialized variables warning"Rostislav Pehlivanov
This reverts commit 6414b5d288b89c9f3ecde0757f16184071b6036f.
2018-10-28Merge pull request #3011 from Emantor/fix/2922Drew DeVault
output: initialize layers before usage in apply_config
2018-10-28output: initialize layers and signal before using functionsRouven Czerwinski
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
2018-10-27Use output identifier for workspace configRobinhuett
2018-10-27Revert "Fix #2992"Drew DeVault
This reverts commit 94985146ea00b40f72cd6afaa191fd92a46e4fd3.
2018-10-26tree/view.c: fix uninitialized variables warningCole Mickens
2018-10-27Respect border settings when rendering lone tabbed/stacked childRyan Dwyer
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.
2018-10-26Fix #2992mwenzkowski
Move a function call, such that data it depends on is initialized before.
2018-10-25Fix re-tiling for floating containersMihai Coman
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.
2018-10-25Rebase the cursor after applying transactionsRyan Dwyer
This approaches cursor rebasing from a different angle. Rather than littering the codebase with cursor_rebase calls and using transaction callbacks, this just runs cursor_rebase after applying every transaction - but only if there's outputs connected, because otherwise it causes a crash during shutdown. There is one known case where we still need to call cursor_rebase directly, and that's when running `seat seat0 cursor move ...`. This command doesn't set anything as dirty so no transaction occurs.
2018-10-25Merge pull request #2950 from emersion/presentation-timeDrew DeVault
Implement the presentation-time protocol
2018-10-25Fix containers not being resized when entering scratchpadRyan Dwyer
This fixes a regression introduced by 662466e8db773926bf61b21280194a3540ae26ec. When adding a container to the scratchpad, setting container->scratchpad = true before container_set_floating made container_set_floating believe that the container was already floating. This fixes it by setting the property afterwards instead.
2018-10-24Merge pull request #2933 from Snaipe/xwayland-window-propertiesDrew DeVault
xwayland: populate window_properties in json for views
2018-10-23Implement the presentation-time protocolemersion
2018-10-23xwayland: populate window_properties in json for viewsFranklin "Snaipe" Mathieu
window_properties is documented to contain a subset of the X11 properties of a window (its title, class, instance, role, and transient ID). This commit adds the missing json object from the get_tree output for xwayland windows only. This is a follow-up of #2911. Signed-off-by: Franklin "Snaipe" Mathieu <me@snai.pe>
2018-10-23Fix crash when resizing container hidden in the scratchpadRyan Dwyer
Firstly, the container was wrongly identifying as a tiling container because it had no workspace. Secondly, when calculating the maximum possible size we can't use the workspace if it's not there, so we'll allow unlimited size in this case.
2018-10-22Fix crash when quitting a QT app on the wayland backend using menuRyan Dwyer
QT unmaps the view before destroying the popup. We destroyed the popup in response to the view unmapping, but then we'd attempt to destroy it a second time which caused a crash. The patch removes the listener. I tested it with GTK as well, and can confirm the popup is still being destroyed.
2018-10-21Make workspace back_and_forth seat-specificRyan Dwyer
* When using multiple seats, each seat has its own prev_workspace_name for the purpose of workspace back_and_forth. * Removes prev_workspace_name global variable. * Removes unused next_name_map function in tree/workspace.c. * Fixes memory leak in seat_destroy (seat was not freed).
2018-10-20Merge pull request #2870 from RyanDwyer/refactor-input-manageremersion
Minor refactor of input manager
2018-10-20Minor refactor of input managerRyan Dwyer
The input manager is a singleton object. Passing the sway_input_manager argument to each of its functions is unnecessary, while removing the argument makes it obvious to the caller that it's a singleton. This patch removes the argument and makes the input manager use server.input instead. On a similar note: * sway_input_manager.server is removed in favour of using the server global. * seat.input is removed because it can get it from server.input. Due to a circular dependency, creating seat0 is now done directly in server_init rather than in input_manager_create. This is because creating seats must be done after server.input is set. Lastly, it now stores the default seat name using a constant and removes a second reference to seat0 (in input_manager_get_default_seat).
2018-10-20Fix crash when view unmaps while no outputs connectedRyan Dwyer
When a view unmaps, we call workspace_consider_destroy. This function assumed the workspace would always have an output, but this is not the case when hotplugged down to zero. The function now handles this and allows itself to be destroyed when there is no output. This means that workspace_begin_destroy must remove the workspace from the root->saved_workspaces list to avoid an eventual dangling pointer, so it does that now. Lastly, when an output is plugged in again and it has to create a new initial workspace for it, we must emit the workspace::init IPC event otherwise swaybar shows no workspaces at all. I guess when you start sway, swaybar is started after the workspace has been created which is why this hasn't been needed earlier.
2018-10-19Introduce cursor_rebaseRyan Dwyer
This function "rebases" the cursor on top of whatever is underneath it, without triggering any focus changes.
2018-10-17Merge pull request #2820 from Emantor/fix-mouse-warping-containerDrew DeVault
Fix mouse warping container