i3-compatible Wayland compositor
Find a file
Alexander Orzechowski 4f6f3d224a seat: Don't try to activate an unmapped view
Sway does not remove a view from the view tree instantly after a
surface is unmapped: It has to wait for a transaction to finish.
This creates an opportunity for input events to come in that
try to dereference a surface from an unmapped view.

```
0  0x0000561c14e957e8 in seat_is_input_allowed (seat=0x561c177fb680, surface=0x0) at ../sway/input/seat.c:1068
        client = 0x561c184fc3c0
1  0x0000561c14e93053 in seat_send_activate (node=0x561c184fc3c0, seat=0x561c177fb680) at ../sway/input/seat.c:127
2  0x0000561c14e9335b in seat_send_focus (node=0x561c184fc3c0, seat=0x561c177fb680) at ../sway/input/seat.c:195
        view = 0x561c177fb680
3  0x0000561c14e95cb1 in seat_set_workspace_focus (seat=0x561c177fb680, node=0x561c184fc3c0) at ../sway/input/seat.c:1197
        last_focus = 0x561c1826c700
        last_workspace = 0x561c17d016d0
        new_workspace = 0x0
        container = 0x561c184fc3c0
        new_output = 0x0
        new_output_last_ws = 0x0
4  0x0000561c14e95fca in seat_set_focus (seat=0x561c177fb680, node=0x561c184fc3c0) at ../sway/input/seat.c:1268
5  0x0000561c14e9929c in handle_pointer_axis (seat=0x561c177fb680, event=0x7ffdf0d94d40) at ../sway/input/seatop_default.c:735
        new_focus = 0x561c184fc3c0
        layout = L_NONE
        input_device = 0x561c178b3ff0
        ic = 0x561c178745d0
        cursor = 0x561c177fbdf0
        e = 0x561c186ca340
        surface = 0x0
        sx = 1340.280056476593
        sy = 354.24998700618744
        node = 0x561c184fc3c0
        cont = 0x561c184fc3c0
        edge = WLR_EDGE_NONE
        on_border = false
        on_titlebar = true
        on_titlebar_border = false
        on_contents = false
        on_workspace = false
        scroll_factor = 1
        handled = false
        keyboard = 0x561c1789e8e0
        modifiers = 0
        device = 0x561c179ef3a8
        dev_id = 0x561c18732260 "1133:49291:Logitech_G502_HERO_Gaming_Mouse"
        button = 768
        binding = 0x0
6  0x0000561c14e96cfe in seatop_pointer_axis (seat=0x561c177fb680, event=0x7ffdf0d94d40) at ../sway/input/seat.c:1581
7  0x0000561c14e8cf82 in dispatch_cursor_axis (cursor=0x561c177fbdf0, event=0x7ffdf0d94d40) at ../sway/input/cursor.c:368
8  0x0000561c14e8cfd7 in handle_pointer_axis (listener=0x561c177fbf98, data=0x7ffdf0d94d40) at ../sway/input/cursor.c:375
        cursor = 0x561c177fbdf0
        event = 0x7ffdf0d94d40
9  0x00007f69226faf6e in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
10 0x00007f6922de10d5 in handle_pointer_axis (listener=0x561c178d9650, data=0x7ffdf0d94d40) at ../subprojects/wlroots/types/wlr_cursor.c:469
        event = 0x7ffdf0d94d40
        device = 0x561c178d95d0
11 0x00007f69226faf6e in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
12 0x00007f6922daa6b8 in handle_pointer_axis_value120 (event=0x561c1845b060, pointer=0x561c179ef3a8, source=WLR_AXIS_SOURCE_WHEEL) at ../subprojects/wlroots/backend/libinput/pointer.c:160
        i = 0
        pevent = 0x561c1845b060
        wlr_event = {pointer = 0x561c179ef3a8, time_msec = 277761620, source = WLR_AXIS_SOURCE_WHEEL, orientation = WLR_AXIS_ORIENTATION_VERTICAL, delta = -15, delta_discrete = -120}
        axes = {LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL}
13 0x00007f6922da9b9e in handle_libinput_event (backend=0x561c16c7dff0, event=0x561c1845b060) at ../subprojects/wlroots/backend/libinput/events.c:184
        libinput_dev = 0x561c178f2570
        dev = 0x561c179ef220
        event_type = LIBINPUT_EVENT_POINTER_SCROLL_WHEEL
14 0x00007f6922da8b49 in handle_libinput_readable (fd=45, mask=1, _backend=0x561c16c7dff0) at ../subprojects/wlroots/backend/libinput/backend.c:58
        backend = 0x561c16c7dff0
        ret = 0
        event = 0x561c1845b060
15 0x00007f69226fc9e2 in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
16 0x00007f69226fd197 in wl_display_run () at /usr/lib/libwayland-server.so.0
17 0x0000561c14e815bb in server_run (server=0x561c14efea60 <server>) at ../sway/server.c:320
18 0x0000561c14e8053f in main (argc=1, argv=0x7ffdf0d951b8) at ../sway/main.c:411
        verbose = false
        debug = false
        validate = false
        allow_unsupported_gpu = false
        config_path = 0x0
        c = -1
```
2023-02-09 23:19:35 -05:00
.builds ci: install hwdata-dev on Alpine 2023-02-04 20:48:20 -07:00
.github/ISSUE_TEMPLATE github: don't truncate debug logs 2021-10-17 21:28:51 +02:00
assets License wallpapers as CC-0 2019-12-16 14:35:58 -05:00
client Use shm_open instead of mkstemp 2022-11-25 00:05:12 +01:00
common Reuse parsed PangoFontDescription 2022-07-01 13:05:58 +02:00
completions build: move completions to separate file 2022-11-28 18:51:45 -05:00
contrib grimshot: fix tilde expansion within quotes 2022-07-30 09:25:24 +02:00
include launcher: support external launcher tokens 2023-02-05 00:53:47 -07:00
protocols build: drop intermediate libraries for protocols 2022-11-25 10:51:20 +01:00
sway seat: Don't try to activate an unmapped view 2023-02-09 23:19:35 -05:00
swaybar Use correct length for strncmp comparison 2023-01-03 21:50:56 +01:00
swaymsg swaymsg: s/inactive/disabled/ 2023-02-02 12:00:06 -05:00
swaynag swaynag: call swaynag_destroy on clean exit 2023-01-16 10:47:42 -05:00
.editorconfig Create .editorconfig 2016-07-04 14:12:32 +02:00
.gitignore Allocate minimum size necessary in pango text functions. (#3473) 2019-01-20 15:03:30 +01:00
config.in Switch default menu to wmenu 2023-01-30 15:08:16 -05:00
CONTRIBUTING.md Fix IRC links in READMEs and templates 2021-05-26 08:25:13 +02:00
LICENSE MIT license 2017-01-06 13:45:48 -05:00
meson.build input: enable user xkb configs with cap_sys_nice 2023-01-11 11:32:09 +01:00
meson_options.txt Add meson options to enable/disable swaybar and swaynag 2021-07-21 18:24:09 +02:00
README.cs.md Fix typo in Czech README translation 2022-11-30 14:43:43 +01:00
README.de.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.dk.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.es.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.fr.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.gr.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.hi.md Add a Hindi (हिन्दी) translation to the README 2022-05-27 21:09:18 +02:00
README.hu.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.ir.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.it.md Translated README into Italian 2022-02-07 10:55:55 +01:00
README.ja.md Improve Japanese translation 2022-10-08 10:12:00 +02:00
README.ko.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.md Add Norwegian READMR 2023-02-02 17:45:01 +01:00
README.nl.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.no.md Add Norwegian READMR 2023-02-02 17:45:01 +01:00
README.pl.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.pt.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.ro.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.ru.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.sv.md Add Swedish README 2022-04-18 18:51:45 +02:00
README.tr.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.uk.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
README.zh-CN.md Polish the language in README.zh-CN.md & sync with English one 2022-05-24 07:40:47 +02:00
README.zh-TW.md Replace pcre with pcre2 2022-03-12 14:02:32 +01:00
sway.desktop Update language in sway.desktop & sway(1) 2019-03-10 15:09:52 -04:00

sway

English - Č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: system tray)
  • scdoc (optional: man pages) *
  • git (optional: version info) *

* Compile-time dep

Run these commands:

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

On systems without logind nor seatd, you need to suid the sway binary:

sudo chmod a+s /usr/local/bin/sway

Sway will drop root permissions shortly after startup.

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. Some display managers may work but are not supported by sway (gdm is known to work fairly well).