Add swayc_change_layout function, which changes either layout or
workspace_layout, depending on the container type. Workspace being
always L_HORIZ makes this much more i3-compatible.
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.
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.
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
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
When creating a new view, wlc usually returns an initial geometry with
size 1x1. Setting those values as desired width/height causes a problem
for some windows (QT5) because they don't request a new geometry for
instance when made floating, so the floating window becomes 1x1.
To fix this problem we can just omit setting the desired width/height on
new_view and instead let the clients request a certain size if they feel
like it. e.i. gnome-calculator.
Fix#578
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).
It's possible to assign workspaces to certain outputs using the command:
workspace <name> output <output>
However, this did not work in some cases where the workspace was
assigned before the given output was made available to sway.
This patch fixes those cases.
This makes sure that a named output config is applied before the
general wildcard config when a new output is created. This ensures that
the config:
output * ...
output NAME ...
behaves the same way as:
output NAME ...
output * ...
This is a possible fix for #384.
To be honest I don't fully understand why this bug is happening, but I
have narrowed it down to the view stack in wlc and how sway orders views
in very specific situations (those described in #384).
Anyway this should fix the problem by eliminating the call to
`wlc_view_bring_to_front` which isn't really needed anyway since sending
all invisible views to the back is the same as bringing all visible
views to the front (rotating the view stack).
This works by tracking the pids of the child processes in the related
output container and terminating the processes and spawning new ones on
a config reload.
Should solve: #347