This implements commands such as:
workspace number 9: test
If a workspace with the given number exists then it will be focused,
otherwise a new workspace with the given name will be created.
When using a bar on a named output, load_swaybars() requires the
output to be active (ie. in the root container), but this is not the case if
the bar is added to the last output. To fix this, load_swaybars() is now
called after the output has been added to the root container.
After fixing that, swaybar would segfault due to using the wrong index
variable when loading outputs and config.
Indicator border color is now used only when a container is the only
child. Reason for the change? i3 does it this way. Sway container
borders are now a bit more similar to i3 ones.
This patch makes it possible to move views between outputs using the
`move left|right|up|down` commands.
It behaves similar to i3 with one important difference. The focus will
always follow the view being moved, unlike i3 where the focus doesn't
always follow the view to a new output (I assume that's a bug in i3).
`vertical` and `horizontal` should be swapped.
If border_left and border_right were set to 0, the vertical borders
instead of the horizontal borders would be hidden.
i3 handles this command equally.
Fixes#819. If workspace is focused and command 'move container to
workspace/output' is issued, workspace child containers are wrapped in a
new container and moved according to command.
This is a feature that can't work the same as i3, because there is no
real window classes in wayland. This way, we avoid null titles as much
as possible.
When workspace_auto_back_and_forth is enabled, workspaces get switched
twice with previously mentioned command, which is not the expected
behavior.
Removes one redundant creation of previous workspace.
Focus the container on the output (not the output itself) when an output is
focused.
This is intended to fix a bug where borders are not updated correctly when
switching the vt away/back to sway.
When switching back to a workspace after new window creation, it is now
necessary to descend the focus stack into the focused container of the
workspace to determine which container should get the focus. This is because
the `set_focused_container()` function no longer automatically descends into
the focus stack to find the correct view to focus.
Replace `update_view_border()` with `update_container_border()`. The latter
should handle both the case where the container is a view or if the container
has children.
The previous implementation of focus handling assumed that only views can be
focused. Containers can also be focused with a command like `focus parent` or
`focus child`.
Change `set_focused_container()` to handle the case of the given container
being a container with children and update borders accordingly.
Deeply nested containers which had their layouts changed didn't update
their actual_geometry, this messed up their child containers. Those got
width and height of 0, which was then decreased for stacked/tabbed
containers by title height. Underflow ensued, these containers suddenly
had height 4294967273. In short, not updating actual_geometry didn't
play nicely with nested containers.
When titlebar is hidden, top border of the topmost view inside
tabbed/stacked container will not be drawn. This is changed in layout.c
On the other hand, top border should be drawn sometimes, for example
when titlebar is hidden on a view that is not the topmost inside
tabbed/stacked container. This is changed in border.c
Previously, cmd_kill only closed a focused view, while containers were
not affected. Now it closes all views that are children of the focused
container.
Whenever a stacked or tabbed container has focused, paint the titlebars of all
its child windows to be focused as well to indicate the parent stack/tab
container has the focus.
In `move_focus()`, when given an output, set the focus to the workspace of that
output instead of the output itself.
This fixes a bug that did not allow users to switch between outputs introduced
in afc6ad6.
It also fixes other issues before that commit when a workspace with children
was selected and the user tried to switch focus in the direction of another
output.
In the `focus parent` command, do not set focus above the workspace level.
These containers are not meant to be focused.
This prevents a crash on repeated `focus parent` commands.
Panels were explicitly rendered by calling wlc_surface_render in
handle_output_pre_render. Calling wlc_surface_render does not set the
surface's geometry (like wlc_view_set_geometry does). Sway did not call
wlc_view_set_geometry for panels, so wlc defaulted their geometry to be at
the origin. This is not correct for bars unless their location is top.
Furthermore, for a surface to receive pointer events, its mask has to be
set to visible. This causes wlc to render these surfaces, causing panels
and backgrounds to be rendered twice.
This commit makes panels and surfaces visible, sets the correct geometries
and removes the code that explicitly rendered them.
Tabbed/stacked containers are now created only if a view is present on
the workspace. If a view is created on previously empty tabbed/stacked
workspace, it gets wrapped in a container.
Prior to this commit all windows (e.g. shell surfaces) were handled the same
way in handle_view_created. Since backgrounds and panels have to be treated
differently, they could not be shell surfaces. This changes checks whether
a client is a background or a panel in handle_view_created and exists to
let them be dealt with elsewhere.
This fixes a segfault, when trying to get parent of the workspace/root container/(?), as it is not assuered that the view's parent node is not null in the loop
Escape line return when reading from a file with the '\' character.
Similar to shell scripts.
Signed-off-by: Roosembert Palacios <roosembert.palacios@epfl.ch>
Escape line return in configuration file with the '\' character. Similar
to shell scripts.
Signed-off-by: Roosembert Palacios <roosembert.palacios@epfl.ch>