Applying layout changes to the parent of the parent, in case the parent only has a single child, stops the creation of a chain of single child containers.
Closes: https://github.com/swaywm/sway/issues/7945
Node destruction currently runs through the transaction system such that
a particular node is only destroyed after its use in an ongoing
transaction. If a node is dirtied after the node is marked as destroying
but before it is destroyed, the pointer added to dirty_nodes would
become a dangling pointer once the node was destroyed.
Do not dirty destroying nodes, and ensure that destroying is only set
after the last dirty.
I misunderstood the recommendation in the libinput release notes.
Instead of making enabled_sticky the default, leave the default
set to disabled.
Fixes: bbadf9b8b1 ("Add support for LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY")
Closes: https://github.com/swaywm/sway/issues/8758
In general wl_signal isn't well-suited for Sway: Sway doesn't need
any modularity, and signals make it trickier to track down exactly
what happens down the stack.
Replace Sway's output disable signal with a simple list tracking
for the only user.
This reverts commit e28e6484e8.
This change tried to remove nodes from all points of reference to allow
immediate destruction. However, it missed things like the children lists
cloned by transaction states of parent nodes.
Adding all that extra cleanup would not be in the spirit of a PR
claiming to simplify teardown. Let's wait for someone to come up with a
cleaner approach instead.
Fixes: https://github.com/swaywm/sway/pull/8738
When a container is detached, we need to remove it from any lists it may
be part of. We use container_get_siblings to obtain the relevant list,
find our entry and remove it.
If the container is in a later list than the one returned by
container_get_siblings, or is in multiple lists for some reason,
container_detach will fail to remove the container, leaving a dangling
pointer when the container is freed.
Instead of calling container_get_siblings, check and remove the
container from all lists.
A sway_node may end up being referenced in either a queued transaction,
pending transaction or as a dirty node. To manage this, the transaction
system has been responsible for destroying containers, workspaces and
outputs at the end of their last referenced transaction.
This significantly complicates the teardown flow of surfaces and
outputs. Instead, remove the node from transactions and dirty lists so
that the callsite can remove and free the node immediately.
A temporary SUID detection that would cause sway to exit was introduced
when SUID operation was deprecated, intended to avoid cases where a user
would not heed the deprecation notice, continued to use SUID and ended
up with sway accidentally running as root.
Remove the check, as the three years that have passed is sufficient time
for users to discover the deprecation and adapt. We did not care if
users intentionally want to run sway as root through SUID, we only
wanted to avoid surprise root.
Previously, we were using wl_signal_emit_mutable() directly instead
of wlr_scene_buffer_send_frame_done(). This bypassed any visibility
checks, which matters before a surface is mapped.
Fixes flickering with an invalid size when launching new programs.
Fixes: eb8acfd7b1 ("Stop using wlr_scene_buffer_send_frame_done()")
Unfocused windows shouldn't be allowed to activate the IM.
This fixes an issue with swaymsg invocations that contain several
commands which result in multiple swift focus changes. An application
briefly gets text input focus, sends an enable request, then sway
processes it and activates the IM only after the commands are all
finished and focus is on something else which did not send an enable
request.
The render_workspace_button and render_binding_mode_indicator functions are
almost the same. This commit extracts the common rendering code into a new
render_box function.
workspace_output_get_highest_available took an output to exclude as
argument, meant to avoid accidentally reselecting an output we are
evacuating workspaces from.
Outputs are now removed from the list before we evacuate, making
exclusion unnecessary. Remove the argument.
When an output is destroyed, we go through the process of disabling it.
This includes evacuating all content away from the output, which can
lead to various modifications to the scene. With the scene_output still
present, this can lead to things like output_enter events being emitted
for the output currently being destroyed.
Ensure that the scene output is destroyed first and that the output is
immediately considered disabled.
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3974
8fecf3a introduced a regression where fullscreening a child of a
floating container would result in a black screen. This is because the
order of 'arrange_fullscreen' and 'arrange_worksplace_floating' was
swapped causing the fullscreen container's scene to get reparented after
it was parented in the fullscreen layer.
Fixes#8729
wlroots resets 'initialized' when a layer surface is unmapped and sway
doesn't rearrange the layer surfaces in response to a commit of a
surface where 'initialized' is false. This results in space not getting
reclaimed from a recently unmapped layer surface until some other action
causes 'arrange_layers' to get called. This commit makes sure all layer
surfaces get rearranged when a layer surface is unmapped.
Currently we do a good job of reparenting the scenes of a container when
it moves into a disabled workspace. We need to do this since normally
the scenes are reparented in the 'arrange_{children,container}'
functions but these don't get called for disabled workspaces. However,
the 'arrange_{children,container}' functions also don't get called when
there is a fullscreen container hiding them.
This commit makes sure to call 'disable_workspace' on workspaces with a
fullscreen container so that when a container is moved into the
workspace its scenes will be properly reparented. Also, when there is a
fullscreen global container 'disable_workspace' is called for all
workspaces since the scenes of a previously fullscreen global container
may still be parented in the 'fullscreen_global' layer.
Fixes#8705#8659#8432
Before this commit stacking containers with more than one child sized
the active container's decorations as if there was only one titlebar.
Commit a25645a introduced the local variable 'net_height' but
incorrectly calculated it for stacking containers. Fixes#8686.
When a container that was previously an inactive child of a tabbed or
stacking layout becomes floating it's border scene-tree remains
disabled. This results in only the titlebar being rendered for the
container. This commit ensures the border scene-tree is enabled when
arranging floating containers.
Fixes#8721
Before this commit, when moving a non-leaf child of a tabbed or stacking
container to a new workspace, the child would be detached from the
parent container and the grandchildren would be sent to the new
workspace but the child itself wouldn't be destroyed causing the
titlebar to still be rendered as part of the parent container.
Fixes#8648.
Before this commit when a child of a tabbed or stacking container was
taken out of fullscreen and a different sibling was focused in the same
transaction, the titlebar of the previously fullscreen container would
remain hidden. This commit makes sure that scene tree for decorations is
enabled for all containers within a tabbed or stacking container when it
is arranged.