aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree
Commit message (Collapse)AuthorAge
...
| * Only damage popups when popups have damageLibravatar Ryan Dwyer2018-10-07
| | | | | | | | | | | | | | | | | | | | | | The previous behaviour was to damage the entire view, which would recurse into each popup. This patch makes it damage only the popup's surface, and respect the surface damage given by the client. This adds listeners to the popup's map and unmap events rather than doing the damage in the create and destroy functions. To get the popup's position relative to the view, a new child_impl function get_root_coords has been introduced, which traverses up the parents.
* | Remove duplicate codeLibravatar Ryan Dwyer2018-10-08
| |
* | Introduce container_is_transient_forLibravatar Ryan Dwyer2018-10-08
| |
* | Implement popup_during_fullscreenLibravatar Ryan Dwyer2018-10-08
|/ | | | | | | | | | This introduces a new view_impl function: is_transient_for. Similar to container_has_ancestor but works using the surface parents rather than the tree. This patch modifies view_is_visible, container_at and so on to allow transient views to function normally when they're in front of a fullscreen view.
* Move sticky containers when switching workspace via criteriaLibravatar Ryan Dwyer2018-10-06
| | | | | | | | | | | | | | | | | | | | | | * Create a view on workspace 1 * Switch to workspace 2 (on the same output) and create a floating sticky view * Use criteria to focus the view on workspace 1 Previously, we only moved the sticky containers when using workspace_switch, but the above method of focusing doesn't call it. This patch relocates the sticky-moving code into seat_set_focus_warp. A side effect of this patch is that if you have a sticky container focused and then switch workspaces, the sticky container will no longer be focused. It would previously retain focus. In seat_set_focus_warp, new_output_last_ws was only set when changing outputs, but now it's always set. This means new_output_last_ws and last_workspace might point to the same workspace, which means we have to make sure we don't destroy it twice. It now checks to make sure they're different, and to make this more obvious I've moved both calls to workspace_consider_destroy to be next to each other.
* Merge pull request #2759 from minus7/fix-view-container-nullLibravatar emersion2018-10-03
|\ | | | | Fix crash if view has no container
| * Fix crash if view has no containerLibravatar minus2018-10-03
| |
* | Reenable popup-handling for determining focusLibravatar Jonathan Buch2018-10-03
| | | | | | | | | | This reenables the popup-handling code before the floating-window focus change.
* | Use "raycasting" for determining focus for floating windowsLibravatar Jonathan Buch2018-10-03
| | | | | | | | | | Floating containers and their surfaces are ordered in "raised last". This is used to detect the topmost surface and thus the focus.
* | Fix focusing topmost floating windowsLibravatar Jonathan Buch2018-10-03
|/ | | | | | | | | | | | Re-focus on the container on which the cursor hovers over. A special case is, if there are menus or other subsurfaces open in the focused container. It will prefer the focused container as long as there are subsurfaces. This commit starts caching the previous node as well as the previous x/y cursor position. Re-calculating the previous focused node by looking at the current state of the cursor position does not work, if the environment changes.
* Merge pull request #2703 from RyanDwyer/csd-borderLibravatar Drew DeVault2018-10-03
|\ | | | | Add CSD to border modes
| * Improve CSD logicLibravatar Ryan Dwyer2018-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does the following: * Removes the xdg-decoration surface_commit listener. I was under the impression the client could ignore the server's preference and set whatever decoration they like using this protocol, but I don't think that's right. * Adds a listener for the xdg-decoration request_mode signal. The protocol states that the server should respond to this with its preference. We'll always respond with SSD here. * Makes it so tiled views which use CSD will still have sway decorations rendered. To do this, using_csd had to be added back to the view struct, and the border is changed when floating or unfloating a view.
| * Rename view_set_csd_from_client to view_update_csd_from_clientLibravatar Ryan Dwyer2018-09-27
| |
| * Add CSD to border modesLibravatar Ryan Dwyer2018-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces view.using_csd with a new border mode: B_CSD. This also removes sway_xdg_shell{_v6}_view.deco_mode and view->has_client_side_decorations as we can now get these from the border. You can use `border toggle` to cycle through the modes including CSD, or use `border csd` to set it directly. The client must support the xdg-decoration protocol, and the only client I know of that does is the example in wlroots. If the client switches from SSD to CSD without us expecting it (via the server-decoration protocol), we stash the previous border type into view.saved_border so we can restore it if the client returns to SSD. I haven't found a way to test this though.
* | Handle border options for gapsLibravatar Brian Ashworth2018-10-01
| | | | | | | | | | | | | | | | | | | | | | | | Fixes `hide_edge_borders smart` when gaps are in use. Implements `hide_edge_borders smart_no_gaps` and `smart_borders on|no_gaps|off`. Since `smart_borders on` is equivalent to `hide_edge_borders smart` and `smart_borders no_gaps` is equivalent to `hide_edge_borders smart_no_gaps`, I opted to just save the last value set for `hide_edge_borders` and restore that on `smart_borders off`. This simplifies the conditions for setting the border.
* | Fix smart gapsLibravatar Brian Ashworth2018-10-01
| |
* | Merge pull request #2726 from RyanDwyer/overhaul-gapsLibravatar Drew DeVault2018-09-30
|\ \ | | | | | | Make gaps implementation consistent with i3-gaps
| * | Make gaps implementation consistent with i3-gapsLibravatar Ryan Dwyer2018-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes our gaps implementation to behave like i3-gaps. Our previous implementation allowed you to set gaps on a per container basis. This isn't supported by i3-gaps and doesn't seem to have a practical use case. The gaps_outer and gaps_inner properties on containers are now removed as they just read the gaps_inner from the workspace. `gaps inner|outer <px>` no longer changes the gaps for all workspaces. It only sets defaults for new workspaces. `gaps inner|outer current|workspace|all set|plus|minus <px>` is now runtime only, and the workspace option is now removed. `current` now sets gaps for the current workspace as opposed to the current container. `workspace <ws> gaps inner|outer <px>` is now implemented. This sets defaults for a workspace. This also fixes a bug where changing the layout of a split container from linear to tabbed would cause gaps to not be applied to it until you switch to another workspace and back.
* | | Merge pull request #2728 from RedSoxFan/move-sticky-on-evacLibravatar Drew DeVault2018-09-30
|\ \ \ | | | | | | | | Move sticky containers in output_evacuate
| * | | Move sticky containers in output_evacuateLibravatar Brian Ashworth2018-09-28
| |/ /
* | | Turn funcs() into funcs(void)Libravatar Arkadiusz Hiler2018-09-30
| | | | | | | | | | | | If they really do not take undefined number of arguments.
* | | Fix hotplugging down to zero outputsLibravatar Ryan Dwyer2018-09-30
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | When the last output is disconnected, output_disable is called like usual and evacuates the output to the root->saved_workspaces list. It then calls root_for_each_container to remove (untrack) the output from each container's outputs list. However root_for_each_container did not iterate the saved workspaces, so when the output gets freed the containers would have a dangling pointer in their outputs list. Upon reconnect, container_discover_outputs would attempt to use the dangling pointer, causing a crash. This makes root_for_each_container check the saved workspaces list, which fixes the problem.
* | Check for NULL output in workspace_valid_on_outputLibravatar Ryan Dwyer2018-09-28
| |
* | Rename workspace_outputs to workspace_configs and fix memory leakLibravatar Ryan Dwyer2018-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we eventually implement `workspace <ws> gaps inner|outer <px>`, we'll need to store the gaps settings for workspaces before they're created. Rather than create a workspace_gaps struct, the approach I'm taking is to rename workspace_outputs to workspace_configs and then add gaps settings to that. I've added a lookup function workspace_find_config. Note that we have a similar thing for outputs (output_config struct and output_find_config). Lastly, when freeing config it would create a memory leak by freeing the list items but not the workspace or output names inside them. This has been rectified using a free_workspace_config function.
* | Fix floating views in tabbed/stacked workspaces not getting frame eventsLibravatar Ryan Dwyer2018-09-28
|/ | | | | | | | | view_is_visible would return false, which meant the view wouldn't receive a frame done event. view_is_visible needs to make an exception for floating containers. This also moves the workspace_is_visible check to an earlier location for performance reasons.
* Fix race condition crash when view unmaps + maps quicklyLibravatar Ryan Dwyer2018-09-26
| | | | | | | | | | | | | When a view unmaps, we start a transaction to destroy the container, then when the transaction completes we destroy the container and unset the view's container pointer. But if the view has remapped in the meantime, the view's container pointer will be pointing to a different container which should not be cleared. This adds a check to make sure the view is still pointing to the container being destroyed before clearing the pointer. The freeing of the title format is also removed as it is already freed when the view destroys in view_destroy.
* Fix crash when disconnecting outputLibravatar Ryan Dwyer2018-09-25
| | | | | | | | | | | If the output being disconnected contains views, and the views are being relocated to another output of a different size, a transaction must occur to reconfigure them. This means by the time container_discover_outputs is called, the output is already disabled and wlr_output is NULL. I considered making it check output->wlr_output, but output->enabled should work just as well and is more descriptive.
* Merge pull request #2694 from RyanDwyer/fix-sticky-jumping-on-switchLibravatar emersion2018-09-23
|\ | | | | Prevent sticky containers from jumping on workspace switch
| * Prevent sticky containers from jumping on workspace switchLibravatar Ryan Dwyer2018-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you have swaybar docked to the top, and you create a floating sticky container and switch workspaces on the same output, the sticky container would move down by the height of swaybar on each switch. This happens because when creating the workspace we set the dimensions to the same as the output, then the subsequent arrange corrects it. During this arrange, floating containers are translated so they stay relative to the workspace. This translation needs to not occur for the initial arrange. This patch makes workspaces have a zero width and height when first created, so we can detect whether this is the initial arrange and avoid translating the floating containers if so.
* | Merge pull request #2686 from RyanDwyer/tab-scrollingLibravatar emersion2018-09-23
|\ \ | |/ |/| Implement tab cycling using mouse wheel
| * Implement tab cycling using mouse wheelLibravatar Ryan Dwyer2018-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | Firstly, a change had to be made to the container_at functions. If you create layout `T[view H[view view]]` and hover the second tab, the container_at functions would return the focus_inactive child. They now return the split container itself. To compensate for this, dispatch_cursor_button has been adjusted to find the focus_inactive child before focusing it. The actual implementation of wheel scrolling is pretty straightforward. This uses handle_cursor_axis, so I took a similar approach to handle_cursor_button (ie. creating a dispatch_cursor_axis function).
* | Merge pull request #2688 from RyanDwyer/exec-commands-without-focusLibravatar Drew DeVault2018-09-22
|\ \ | | | | | | Allow running commands on containers without focusing them
| * | Allow running commands on containers without focusing themLibravatar Ryan Dwyer2018-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a `con` argument to `execute_command` which allows you to specify the container to execute the command on. In most cases it leaves it as `NULL` which makes it use the focused node. We only set it when executing `for_window` criteria such as when a view maps. This means we don't send unnecessary IPC focus events, and fixes a crash when the criteria command is `move scratchpad` (because we can't give focus to a hidden scratchpad container). Each of the shell map handlers now check to see if the view has a workspace. It won't have a workspace if criteria has moved it to the scratchpad.
* | | commands: remove obselete code for sticky windows when switching workspaceLibravatar Ian Fan2018-09-22
|/ /
* | swaybar, swaylock, & tree/container: Set cairo font options to render text ↵Libravatar Geoff Greer2018-09-22
| | | | | | | | and lines with subpixel hinting (if available).
* | Merge pull request #2660 from RyanDwyer/fix-scratchpad-iterationLibravatar emersion2018-09-22
|\ \ | | | | | | Fix double iteration of scratchpad containers
| * | Fix double iteration of scratchpad containersLibravatar Ryan Dwyer2018-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | root_for_each_container and root_find_container were using incorrect logic to determine if a container was hidden in the scratchpad. Containers will have a NULL parent if they are a direct child of a workspace. Containers will have a NULL workspace if they are hidden in the scratchpad. The incorrect check meant that root_for_each_container would run the callback on scratchpad containers twice. This meant that executing a command such as `[class="$something"] scratchpad show` would cause the command to run twice, resulting in the container being shown and hidden again which is effectively a no op. Fixes #2655.
* | | Fix pango escaping and refactor escape_markup_textLibravatar Ryan Dwyer2018-09-22
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | Fixes #2674. The cause of the issue was in get_pango_layout. When we call pango_parse_markup, `text` is the escaped string, and the unescaped string is then computed and written to `buf`. We were then passing the unescaped string to pango_layout_set_markup, but this function needs the escaped string. `buf` is not needed and has been removed. The other part of this PR refactors escape_markup_text to remove the dest_length argument and removes the -1 return value on error. It now assumes that you've allocated dest to the correct length.
* | swaybar: handle hotpluggingLibravatar emersion2018-09-20
| | | | | | | | Don't kill and respawn swaybars on hotplug.
* | ipc: add pid information for views in layout treeLibravatar Ian Fan2018-09-19
|/
* Rename seat_get_active_child to seat_get_active_tiling_childLibravatar Ryan Dwyer2018-09-16
| | | | | Also renames container to con in one function to prevent ugly line wrapping.
* Fix crash when unmapping last child of a tabbed workspaceLibravatar Ryan Dwyer2018-09-16
| | | | | | | | | | | | | | * Create layout T[view view] * Move the cursor into the title bar area * Close both views Sway would crash because container_at_tabbed would attempt to divide by zero when there are no children. The children check isn't needed for the stacked function because it doesn't divide anything by the number of children. Fixes #2636.
* ipc: handle NULL cases for node_get_outputLibravatar Ian Fan2018-09-15
|
* Remove redundant container creation in view initializationLibravatar Ian Fan2018-09-15
|
* Merge pull request #2621 from emersion/fix-unmap-segfaultLibravatar Drew DeVault2018-09-11
|\ | | | | Don't use handler_context in view_unmap
| * Don't use handler_context in view_unmapLibravatar emersion2018-09-11
| |
* | Minor fixes to tiling drag implementationLibravatar Ryan Dwyer2018-09-12
| | | | | | | | | | | | | | | | * Make container_add_sibling's `after` argument a boolean. * Use a constant for drop layout border * Make thickness an int * Add button state check * Move comments in seat_end_move_tiling
* | Fix crash in workspace_wrap_childrenLibravatar Ryan Dwyer2018-09-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When workspace_wrap_children is called on a workspace which has a fullscreen child and the fullscreen child is a direct child of the workspace, sway would crash. The workspace's fullscreen pointer is unset when the fullscreen container is detached and applied again when added to a parent, but in this case the parent hadn't yet been added to the workspace which meant con->workspace was NULL. The fix makes container_handle_fullscreen_reparent return if there's no workspace, and the fullscreen pointer is reapplied in workspace_wrap_children.
* | Implement tiling dragLibravatar Ryan Dwyer2018-09-11
|/ | | | Hold floating_modifier and drag a tiling view to a new location.
* Minor fixLibravatar William Wold2018-09-10
|