aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree
Commit message (Collapse)AuthorAge
* 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
|
* Minor fixLibravatar William Wold2018-09-10
|
* Prevent stacked layout from crashingLibravatar William Wold2018-09-10
|
* Give windows pointer focus immediately when they are switched toLibravatar William Wold2018-09-10
| | | | | | Fixes #2401 (aka #2558) Previously, when switching windows, pointer focus was not changed until the pointer was moved. This makes the pointer enter happen immediately, without the side effects of other attempted fixes.
* Align titles to baselineLibravatar Ryan Dwyer2018-09-08
| | | | | | | | | | | | | This does the following: * Adds a baseline argument to get_text_size (the baseline is the distance from the top of the texture to the baseline). * Stores the baseline in the container when calculating the title height. * Takes the baseline into account when calculating the config's max font height. * When rendering, pads the textures according to the baseline so they line up.
* Second attempt at restoring focus when closing a fullscreen viewLibravatar Ryan Dwyer2018-09-06
| | | | | | | | | | | | | | To reproduce the problem this is fixing, create H[view view view], fullscreen one of the views and close it. The entire workspace will be given focus rather than one of the siblings. This happens because we emit the destroy event, so the seat code tries to find a new focus, but the view it finds is still believed to be hidden by the fullscreen view so it's discarded and the workspace is used instead. This clears the workspace's fullscreen pointer prior to emitting the destroy event so that the seat code finds an appropriate new focus.
* Introduce seat_set_focus_container and seat_set_focus_workspaceLibravatar Ryan Dwyer2018-09-06
| | | | | | | | | | | These are the same as seat_set_focus, but accept a specific type rather than using nodes. Doing this adds more typesafety and lets us avoid using &con->node which looks a little ugly. This fixes a crash that pretty much nobody would ever come across. If you have a bindsym for "focus" with no arguments and run it from an empty workspace, sway would crash because it assumes `container` is not NULL.
* Adjust container boxLibravatar Ryan Dwyer2018-09-06
| | | | | | | | | | | | | | | | | | | | | Prior to f5b9815128b6c000bb5d47c339480fa481a5e99d, children of tabbed and stacked containers would have their container size and position set to the same as the tabbed/stacked container. Normally this would be a problem for a layout such as T[V[view]], but there was some code in the arrange functions which would check if the grandparent of the view was a tabbed or stacked container and would offset the view's Y accordingly. Commit f5b9815128b6c000bb5d47c339480fa481a5e99d changed the box to exclude the titlebar for all tabbed/stacked children so that the grandparent check could be removed. But this meant the title was not covered in the container and wasn't damaged when the child changed its title. This patch changes it so that a child of a tabbed/stacked container will have its box include the title bar if the child is a view, but not if it's a layout container. This fixes the title damage issue while avoiding the grandparent check in the arrange functions, and matches what we see visually.
* Call wlr_output_enable on enable/disable if neededLibravatar Brian Ashworth2018-09-05
|
* Allow marked containers to be moved out of the scratchpad via move commandLibravatar Ryan Dwyer2018-09-05
|
* Fix crash when view in scratchpad becomes urgentLibravatar Ryan Dwyer2018-09-05
|
* Fix floating view moving to 0,0 when splittingLibravatar Ryan Dwyer2018-09-05
|
* Fix scratchpad related crashesLibravatar Ryan Dwyer2018-09-05
| | | | | | | * Was crashing when a view was moved to the scratchpad (prev focus had no parent). * Was crashing when a hidden scratchpad view unmaps because it has no workspace.
* Fix output position issueLibravatar Ryan Dwyer2018-09-05
| | | | | | | Looks like the output dimensions need to be set when arranging rather than when a mode is set. Fixes an issue with position of fullscreen views.
* Apply default config to outputLibravatar Ryan Dwyer2018-09-05
| | | | | When starting without any output config, the default config was not applying.
* Remove offset argument to container_add_siblingLibravatar Ryan Dwyer2018-09-05
| | | | I added this thinking that it might come in useful. Turns out it didn't.
* Don't use wlr_output propertiesLibravatar Ryan Dwyer2018-09-05
| | | | These properties are before rotation.