aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorLines
2025-05-25Improve example of input section in default configBonsaiiv-2/+6
Previous example included a specific device name. This can be confusing for beginners, as the default did not work on most devices.
2025-05-25tree/workspace: Remove exclude arg from get_highest_availableKenny Levinsen-8/+4
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.
2025-05-25output: Minimize interaction with output after destroyKenny Levinsen-14/+15
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
2025-05-25transaction: fix floating fullscreen containersalex-huff-2/+2
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
2025-05-25layer-shell: reclaim space from unmapped layer surfacesalex-huff-5/+1
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.
2025-05-25input: fix udev_device leakSimon Ser-10/+16
libinput_device_get_udev_device() returns a ref'ed handle: https://wayland.freedesktop.org/libinput/doc/latest/api/group__device.html#gac13c64ba19fc19094cff0e5354a2a7ce Similar to this wlroots MR: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5074
2025-05-25transaction: reparent scenes of containers behind fullscreen containersalex-huff-2/+11
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
2025-05-25transaction: fix size of child container decorations in stacking layoutsalex-huff-1/+1
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.
2025-05-20ci: pin wlroots to 0.19.xSimon Ser-3/+3
2025-05-18build: bump version to 1.11-rc31.11-rc3Simon Ser-1/+1
2025-05-18raise scratchpad containerodyxz-0/+2
(cherry picked from commit 810142dcc4228941b644ad68334d0b6f539b6fab)
2025-05-18transaction: ensure border scene is enabled for floating containersalex-huff-0/+1
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 (cherry picked from commit a4072486ded62fcde586c10230cc79af833c55b6)
2025-05-18move: fix broken titlebar when moving child to new workspacealex-huff-0/+1
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. (cherry picked from commit 8d3a52aa3076a34b008aed8ba142c955329a8874)
2025-05-18input/seatop_down: Update decorations for touchscreen inputsFurkan Sahin-0/+1
fixes #8675 (cherry picked from commit 6021f4d83fc1d7e179c334a010af9b37e44a1bb2)
2025-05-18transaction: Ensure all tabs are visible in tabbed modealex-huff-0/+2
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. (cherry picked from commit 4ab411cab0f441994fd41ef8ac80ef849bfab271)
2025-05-18config/output: Fix missing output config supersedesKenny Levinsen-0/+10
color_transform and allow_tearing was not handled by supersede_output_config which could lead to configuration being incorrectly applied. (cherry picked from commit f9945d81fb52c81ab60034dcfc41a2f36f0ed226)
2025-05-18config/output: Use INT_MAX as x/y unset valueKenny Levinsen-8/+8
We oftne use -1 to indicate unset values. In case of output (x, y), we would consider the fields set if they are not both -1. This means that (0, -1) and (-1, 0) are valid coordinates, but (-1, -1) is not. We support negative output positioning, so we cannot use -1 to mean unset. Zero is also not an option as that would disallow reverting a set position back to (0, 0). INT_MAX is an unreasonable output position, so use it to indicate unset values, and only use the value when both are set. (cherry picked from commit 8ac1f72c9ef88b2919457e3598059f963df69305)
2025-05-18Fix includes with relative pathsPavel 'LEdoian' Turinsky-20/+4
The function `load_include_configs` already changes the directory to the one containing the parent config. Therefore, `load_include_config` trying to assemble the "full" path leads to repetition of path segments, making the `realpath` call fail with ENOENT. Just calling `realpath` on the path itself from the directory with the parent configuration is sufficient, so there is no point in passing `parent_dir` to `load_include_config`. (cherry picked from commit 6cac61b6b96c4a48a69f8ec3c06c2df560b01827)
2025-04-27build: bump version to 1.11-rc21.11-rc2Simon Ser-1/+1
2025-04-27sway/commands: Handle incorrect resize unitFurkan Sahin-1/+1
problem: an invalid usage of the command resize set will cause sway to crash because it doesn't check for an invalid height. solution: validate height along with width.
2025-04-27Replace signal() with sigaction()Simon Ser-8/+12
The man page for signal(3) reads: > new applications should use sigaction() rather than signal()
2025-04-21Use pthread_atfork() to restore signals and NOFILE limitSimon Ser-28/+23
This ensures these functions are always called (even when a library such as wlroots or libc perform the fork) and removes the need to manually call them.
2025-04-20build: bump version to 1.11-rc11.11-rc1Simon Ser-1/+1
2025-04-20Drop wl_drm againSimon Ser-7/+0
In [1] we re-introduced a debug flag to enable wl_drm. Time has passed and Xwayland + VA-API + amdvlk now all support linux-dmabuf-v1. [1]: https://github.com/swaywm/sway/pull/7916
2025-04-17server: move sway_terminate() definition to headerSimon Ser-2/+3
2025-04-17swaymsg, swaynag: drop sway_terminate() definitionsSimon Ser-9/+0
These are unused.
2025-04-17layer_shell: destroy layer_surface on assigned output destructionllyyr-1/+1
According to the spec, the closed event should be sent when the surface is no longer shown, because the output may have been destroyed or the user may have asked for it to be removed. In such cases, the clients should destroy the resource. This fixes mako not being able to show notifications if the assigned output was destroyed while a notificataion was still visible Fixes: 188811f80861 ("scene_graph: Port layer_shell")
2025-04-17Remove duplicate arrange_containerFilip Vujičić-1/+0
2025-04-14Fix crash on shutdown when Xwayland is disabledSimon Ser-3/+5
2025-04-14server: fix shutdown crash when running on x11 backendLoukas Agorgianitis-1/+3
Signed-off-by: Loukas Agorgianitis <loukas@agorgianitis.com>
2025-04-13server: recreate renderer in idle callback to avoid UAFFerdinand Bachmann-3/+16
Destroying the wlr_renderer in a callback to its own renderer_lost event is unsafe due to wl_signal_emit*() still accessing it after it was destroyed. Delegate recreation of renderer to an idle callback and ensure that only one such idle callback is scheduled at a time by storing the returned event source.
2025-04-13tree/container: remove event listeners on destroyFerdinand Bachmann-2/+18
Change begin_destroy to remove event listeners before the final destroy, since otherwise event listeners would be removed twice, which crashes. This fixes a crash in wlroots listener checks. See #8509.
2025-04-13input/text_input: remove event listeners on destroyFerdinand Bachmann-2/+38
sway_input_method_relay can be destroyed from two sources, either the seat is destroyed or the manager protocol objects are destroyed due compositor exit. This fixes a crash in wlroots listener checks. See #8509.
2025-04-13desktop/idle_inhibit: remove event listeners on destroyFerdinand Bachmann-0/+12
This fixes a crash in wlroots listener checks. See #8509.
2025-04-13input/input-manager: remove event listeners on finiFerdinand Bachmann-0/+11
This fixes a crash in wlroots listener checks. See #8509.
2025-04-13server: remove event listeners on finiFerdinand Bachmann-0/+21
This fixes a crash in wlroots listener checks. See #8509.
2025-04-13idle_inhibit: Check if layer surface output is enabledKenny Levinsen-2/+5
While we we cannot easily check for true visibility of layer surfaces as easily as for views, we can check at least check that the output associated with the surface is enabled.
2025-04-13idle_inhibit: Assume view is invisible by defaultKenny Levinsen-2/+2
We have historically considered surfaces without a view visible. This made sense in case of layer surfaces which do not have a view, but it also allows unmapped surfaces to act as global inhibitors irrespective of the current view state, which is not the intention fo the protocol. As we now explicitly handle layer surfaces, assume that views are only visible if they can be found and their visibility checked.
2025-04-13idle_inhibit: Explicitly handle layer surfacesKenny Levinsen-1/+8
Layer surfaces do not have a view, and while they can be occluded they are always visible on their associated output - assuming it is enabled.
2025-04-13idle_inhibit: Ignore inhibitors when lockedKenny Levinsen-0/+25
When a session is locked, no views are visible and there is no way to interact with the user session. This means that all inhibitors based on visibility - with the exception being inhibitors on the session lock surfaces themselves - become inert, allowing the session to go idle. The only inhibitor type on normal views that one could argue should remain active is INHIBIT_IDLE_OPEN, but for now we disable all view inhibitors regardless of type.
2025-04-12Use wl_event_loop_add_signal for exit signalsDaniel De Graaf-14/+18
This avoids calling non-async-signal-safe functions from within a signal handler.
2025-04-09ipc: standardize pretty print with raw printFurkan Sahin-1/+1
`swaymsg -t get_inputs --raw` calls it a pointer but `--pretty` calls it a Mouse. Previous commit 6737b90cb that set this to pointer probably forgo to update the pretty one. closes #8584
2025-03-27Fix tabbed/stacking container height regressionClaudia-6/+6
Commit c2d6aff added a bounds check on `height - title_bar_height`, repurposing the local variable `height` in an attempt to DRY out the expression. However, because re-assignment occurs inside the loop body, its result would leak across loop iterations, compounding its effect and leading to the artifact reported in issue #8625, where each child except the first in a tabbed container would acquire a visible waterline. Introduce a second variable and reset it in each loop iteration to get rid of the waterline. Fixes #8625.
2025-03-23man: clarify criteria (incl. PCRE2 usage)Dennis Baurichter-3/+13
Replace the XWayland-only class attribute in the examples: - The first example given should work for Wayland-native windows. - The example 'Kill all windows with the title "Emacs"' should use title, not class. Also, it's a substring (regex) match. There are many different implementations of regular expressions with incompatible syntax. For example, GNU grep alone provides three different ones. Clarify the use of PCRE2 by sway criteria.
2025-03-21Avoid crashing on too many containersKenny Levinsen-12/+33
If far too many containers are created, they can become so small that their size calculations come out negative, leading to crashes on asserts. Instead, set a lower bound for sizes and disable the container entirely if it goes below it, giving whatever space it used to the last container. The splits are not recalculated, so currently the effect is that if all containers have the same width fraction, they keep getting narrower until at some point they all round to zero and the last container will be given all the available space. A better behavior would have been if the additional container did not contribute to size and fraction calculations at all, but it's an extreme edge-case, anything is better than crashing, and this is easier to implement.
2025-03-20stringop: fix has_prefix() arg order in config parsingPaul Riou-3/+3
has_prefix() expects the prefix to be the 2nd argument, not the first. The config parsing was broken when using `--input-device=`. Introduced by: 0c60d1581f7b12ae472c786b7dfe27a1c6ec9a47 "Use has_prefix() instead of strncmp() throughout"
2025-03-20text_input: Fix ime panic in ext-session-lockShootingStarDragons-0/+29
in the origin text_input.c, we only check the sway_view and layershell, but now we have the third shell named sessionlock, so we need to modify both text_input.c and view.c to handle the new type of shell
2025-03-20desktop/output: Skip repaint if wlr_output is disabledKenny Levinsen-1/+1
When the repaint timer fires, we check if the sway_output is disabled, and if so, skip the output commit after having reset frame_pending. The sway_output enable flag is only updated if the output is disabled and removed from the layout, not if the power is disabled for e.g. idle. This can lead to situations where a commit is attempted on a disabled output, which will lead to an attempted and failed primary swapchain allocation. Use the wlr_output.enabled state to check if the output is active.
2025-03-18sway/commands: Return error if container is not in scratchpadPiotr Piwoński-2/+2
2025-03-16Fix output repositioning in global fullscreenmelvinm1-0/+2
Call wlr_scene_output_set_position when in global fullscreen to correctly set output positions when repositioning outputs (using swaymsg output or similar).