1
1
mirror of https://github.com/swaywm/sway synced 2026-05-03 14:20:40 +02:00
Furkan Sahin c857ca3a97 tree/workspace: fix crash on dragging container to workspace edge
When a container is moved, `finalize_move` previously assumed that
calling `workspace_split` would always result in a workspace with exactly
1 child (the wrapper container). Consequently, it safely assumed that
inserting a container with `after = 1` was always valid.

However, if the moved container was the only child of its workspace,
calling `container_detach` drops the workspace's tiling length to 0.
Calling `workspace_split` on an empty workspace simply changes its
layout enum and returns, leaving the length at 0. Passing `after`
(which evaluates to 1 when moving right/down) into
`workspace_insert_tiling` then causes an out-of-bounds insertion and a
subsequent segmentation fault during `container_build_representation`.

This commit fixes the issue by dynamically calculating the insertion
index based on the actual length of the workspace's tiling list at the
moment of insertion, rather than overloading the `after` boolean flag
as a hardcoded index.
2026-04-26 16:31:54 +02:00
2019-12-16 14:35:58 -05:00
2024-02-23 17:43:19 +03:00
2025-11-20 12:31:30 +01:00
2016-07-04 14:12:32 +02:00
2023-03-26 23:22:30 +02:00
2017-01-06 13:45:48 -05:00
2024-05-21 11:44:39 -04:00
2026-03-26 16:30:37 +01:00

sway

English - عربي - Azərbaycanca - Česky - Deutsch - Dansk - Español - Français - ქართული - Ελληνικά - हिन्दी - Magyar - فارسی - Italiano - 日本語 - 한국어 - Nederlands - Norsk - Polski - Português - Română - Русский - Српски - Svenska - Türkçe - Українська - 中文-简体 - 中文-繁體

sway is an i3-compatible Wayland compositor. Read the FAQ. Join the IRC channel (#sway on irc.libera.chat).

Release Signatures

Releases are signed with E88F5E48 and published on GitHub.

Installation

From Packages

Sway is available in many distributions. Try installing the "sway" package for yours.

Compiling from Source

Check out this wiki page if you want to build the HEAD of sway and wlroots for testing or development.

Install dependencies:

  • meson *
  • wlroots
  • wayland
  • wayland-protocols *
  • pcre2
  • json-c
  • pango
  • cairo
  • gdk-pixbuf2 (optional: additional image formats for system tray)
  • swaybg (optional: wallpaper)
  • scdoc (optional: man pages) *
  • git (optional: version info) *

* Compile-time dep

Run these commands:

meson setup build/
ninja -C build/
sudo ninja -C build/ install

Configuration

If you already use i3, then copy your i3 config to ~/.config/sway/config and it'll work out of the box. Otherwise, copy the sample configuration file to ~/.config/sway/config. It is usually located at /etc/sway/config. Run man 5 sway for information on the configuration.

Running

Run sway from a TTY or from a display manager.

S
Description
i3-compatible Wayland compositor
https://swaywm.org Readme MIT 33 MiB
Languages
C 98.4%
Meson 1.2%
Shell 0.4%