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.
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.
when creating a new output, move to that output all extant workspaces
that are assigned to that output.
(unrelated) remove comment that was no longer applicable, fix spacing in
an assignment
The borders are implemented as a surface/buffer attached to each view
which is sent to and rendered by wlc in the view_pre_render callback.
All the drawing logic is handled in sway/border.c and all the logic for
calculating the geometry of the border/view is handled in
`update_geometry` in sway/layout.c (same place as gaps are calculated).
Place mouse at center of focused view when changing to a workspace on a
different output, if option is enabled. (This replicates existing i3
option.)
This can be triggered in multiple ways:
A) via `workspace <name>` which changes output
B) via `focus <direction>` which changes output
C) via `focus output <name>` which (obviously) changes output
If e.g. a window has a popup open then that will lock the current focus,
making a workspace switch denied.
So don't move the mouse pointer in such cases.
- replace visibilty mask integers with an enum
- set output's visibilty mask on creation
- added update_visibility to manually update a containers visibility (e.g. when it moved to an invisible workspace)