Git Product home page Git Product logo

sway's Introduction

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: additional image formats for system tray)
  • swaybg (optional: wallpaper)
  • scdoc (optional: man pages) *
  • git (optional: version info) *

* Compile-time dep

Run these commands:

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

sway's People

Contributors

1ace avatar acrisci avatar ammgws avatar cedws avatar christophgysin avatar ddevault avatar deathlyfrantic avatar deklov avatar emantor avatar emersion avatar frsfnrrg avatar hummer12007 avatar ianyfan avatar kennylevinsen avatar lbonn avatar luminarys avatar martinetd avatar mikkeloscar avatar minus7 avatar mstoeckl avatar nefsen402 avatar progandy avatar redsoxfan avatar rpigott avatar ryandwyer avatar sce avatar taiyu-len avatar vyivel avatar willakat avatar xyene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sway's Issues

Add in testing/CI

It would probably be a good idea at some point in the near future to setup test cases, and possibly some CI service to make testing easier.

Views become black and inaccesible on tty switch in second monitor

I have a dual monitor setup, and when using sway if I switch to another tty, on switching back, all views on the first monitor distort, move to the background, and become black. If I create a new view in that monitor, the views are no longer black, but they are still in the background and inaccesible. Based on my log, I believe that this is because wlc is somehow temporarily reactivating one of my disabled monitors before deactivating it again. The issue is probably caused by wlc, but it also may in part be an issue with sway.

Log:

Handling command 'output eDP-1 disable'
Configured output eDP-1 to -1 x -1 @ -1, -1
Handling command 'output VGA-1 res 1280x1024 pos 0,0'
Configured output VGA-1 to 1280 x 1024 @ 0, 0
Handling command 'output HDMI-A-1 res 1920x1080 pos 1280,0'
Configured output HDMI-A-1 to 1920 x 1080 @ 1280, 0
[wlc] libinput: resume
[wlc] Activating tty
[wlc] MODE: (0) 1600x900 *
[wlc] MODE: (1) 1280x1024 !
[wlc] MODE: (1) 1280x1024 
[wlc] MODE: (1) 1152x864 
[wlc] MODE: (1) 1024x768 
[wlc] MODE: (1) 1024x768 
[wlc] MODE: (1) 1024x768 
[wlc] MODE: (1) 832x624 
[wlc] MODE: (1) 800x600 
[wlc] MODE: (1) 800x600 
[wlc] MODE: (1) 800x600 
[wlc] MODE: (1) 800x600 
[wlc] MODE: (1) 848x480 
[wlc] MODE: (1) 640x480 
[wlc] MODE: (1) 640x480 
[wlc] MODE: (1) 640x480 
[wlc] MODE: (1) 640x480 
[wlc] MODE: (1) 640x480 
[wlc] MODE: (1) 720x400 
[wlc] MODE: (2) 1920x1080 !
[wlc] MODE: (2) 1920x1080 
[wlc] MODE: (2) 1920x1080 
[wlc] MODE: (2) 1920x1080 
[wlc] MODE: (2) 1920x1080 
[wlc] MODE: (2) 1920x1080 
[wlc] MODE: (2) 1680x1050 
[wlc] MODE: (2) 1280x1024 
[wlc] MODE: (2) 1280x1024 
[wlc] MODE: (2) 1440x900 
[wlc] MODE: (2) 1280x960 
[wlc] MODE: (2) 1280x800 
[wlc] MODE: (2) 1152x864 
[wlc] MODE: (2) 1280x720 
[wlc] MODE: (2) 1280x720 
[wlc] MODE: (2) 1280x720 
[wlc] MODE: (2) 1440x576 
[wlc] MODE: (2) 1024x768 
[wlc] MODE: (2) 1024x768 
[wlc] MODE: (2) 1024x768 
[wlc] MODE: (2) 1440x480 
[wlc] MODE: (2) 1440x480 
[wlc] MODE: (2) 832x624 
[wlc] MODE: (2) 800x600 
[wlc] MODE: (2) 800x600 
[wlc] MODE: (2) 800x600 
[wlc] MODE: (2) 800x600 
[wlc] MODE: (2) 720x576 
[wlc] MODE: (2) 720x480 
[wlc] MODE: (2) 720x480 
[wlc] MODE: (2) 640x480 
[wlc] MODE: (2) 640x480 
[wlc] MODE: (2) 640x480 
[wlc] MODE: (2) 640x480 
[wlc] MODE: (2) 720x400 
[wlc] eDP-1 Chose mode (0) 1600x900
Output 1 resolution changed to 1600 x 900
[wlc] EGL context is double buffered
[wlc] EGL version: 1.4 (DRI2)
[wlc] EGL vendor: Mesa Project
[wlc] EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2 OpenGL_ES3 
[wlc] EGL context (RGB888)
[wlc] GL version: OpenGL ES 3.0 Mesa 10.6.5
[wlc] GL vendor: Intel Open Source Technology Center
[wlc] GLES2 renderer initialized
[wlc] Set new bsurface to output (1)
Added output 1:eDP-1
Matched output config for eDP-1
[wlc] Output (1) terminated...
[wlc] Released drm surface (0x2659f18)
[wlc] Removed bsurface from output (1)
[wlc] Removed output (1)
[wlc] VGA-1 Chose mode (0) 1280x1024
Output 1 resolution changed to 1280 x 1024
[wlc] EGL context is double buffered
[wlc] EGL version: 1.4 (DRI2)
[wlc] EGL vendor: Mesa Project
[wlc] EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2 OpenGL_ES3 
[wlc] EGL context (RGB888)
[wlc] GL version: OpenGL ES 3.0 Mesa 10.6.5
[wlc] GL vendor: Intel Open Source Technology Center
[wlc] GLES2 renderer initialized
[wlc] Set new bsurface to output (1)
Added output 1:VGA-1
Matched output config for VGA-1
Set VGA-1 position to 0, 0
Adding 0x26c9d90 (1, 1280.000000x1024.000000) to 0x617d98 (0, 0.000000x0.000000)
Workspace: Generating new name
Got valid workspace command for target: 'web'
Workspace: Found free name web
Added workspace web for output 1
Adding 0x26be120 (2, 1280.000000x1024.000000) to 0x26c9d90 (1, 1280.000000x1024.000000)
Setting focus to 0x26c9d90:1
[wlc] Added output (1)
[wlc] HDMI-A-1 Chose mode (0) 1920x1080
Output 2 resolution changed to 1920 x 1080
[wlc] EGL context is double buffered
[wlc] EGL version: 1.4 (DRI2)
[wlc] EGL vendor: Mesa Project
[wlc] EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2 OpenGL_ES3 
[wlc] EGL context (RGB888)
[wlc] GL version: OpenGL ES 3.0 Mesa 10.6.5
[wlc] GL vendor: Intel Open Source Technology Center
[wlc] GLES2 renderer initialized
[wlc] Set new bsurface to output (2)
Added output 2:HDMI-A-1
Matched output config for HDMI-A-1
Set HDMI-A-1 position to 1280, 0
Adding 0x2b9b2a0 (1, 1920.000000x1080.000000) to 0x617d98 (0, 0.000000x0.000000)
Workspace: Generating new name
Got valid workspace command for target: 'web'
Got valid workspace command for target: 'term'
Workspace: Found free name term
Added workspace term for output 2
Adding 0x2b87990 (2, 1920.000000x1080.000000) to 0x2b9b2a0 (1, 1920.000000x1080.000000)
[wlc] Added output (2)
[wlc] become active
[wlc] Xwayland started (DISPLAY :1)
[wlc] xfixes (5.0)
Compositor is ready, executing cmds in queue
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
Handling command 'exec urxvt'
Executing urxvt
handle:3 type:0 state:0 parent:0 mask:1 (x:0 y:0 w:512 h:320) title:urxvt class:urxvt appid:(null)
Adding new view 3:urxvt to container 0x26be120 2
Adding 0x2b91b40 (4, 0.000000x0.000000) to 0x26be120 (2, 1280.000000x1024.000000)
Setting focus to 0x2b91b40:3
Arranging layout for 0x26c9d90
Arranging workspace #0 at 10.000000, 10.000000
Arranging layout for 0x26be120
Arranging 0x26be120 horizontally
Calculating arrangement for 0x2b91b40:4 (will scale 1260.000000 by 1.000000)
Set view to 1260 x 1004 @ 10, 10
focus:R|(0x617d98)(p:(nil))(f:0x26c9d90)(h:-1)Type:Root|layout:NONE|w:0.000000|h:0.000000|x:0.000000|y:0.000000|vis:t|name:(null)|children:2
|focus:X|(0x26c9d90)(p:0x617d98)(f:0x26be120)(h:1)Type:Output|layout:NONE|w:1280.000000|h:1024.000000|x:0.000000|y:0.000000|vis:f|name:VGA-1|children:1
|-focus:W|(0x26be120)(p:0x26c9d90)(f:0x2b91b40)(h:-1)Type:Workspace|layout:Horiz|w:1260.000000|h:1004.000000|x:10.000000|y:10.000000|vis:f|name:web|children:1
|--focus:K|(0x2b91b40)(p:0x26be120)(f:(nil))(h:3)Type:View|layout:NONE|w:1260.000000|h:1004.000000|x:10.000000|y:10.000000|vis:t|name:urxvt|children:0
|focus:X|(0x2b9b2a0)(p:0x617d98)(f:0x2b87990)(h:2)Type:Output|layout:NONE|w:1920.000000|h:1080.000000|x:1280.000000|y:0.000000|vis:f|name:HDMI-A-1|children:1
|-focus:X|(0x2b87990)(p:0x2b9b2a0)(f:(nil))(h:-1)Type:Workspace|layout:Horiz|w:1920.000000|h:1080.000000|x:1280.000000|y:0.000000|vis:f|name:term|children:0
[wlc] libinput: suspend
[wlc] Pending bsurface set for output (1)
[wlc] Released drm surface (0x265a268)
[wlc] Removed bsurface from output (2)
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] INPUT DEVICE REMOVED
[wlc] Released drm surface (0x2659f18)
[wlc] Removed bsurface from output (1)
[wlc] Activate vt: 2
[wlc] SIGUSR1
[wlc] libinput: suspend
[wlc] Releasing tty
[wlc] deactive
[wlc] SIGUSR2
[wlc] libinput: resume
[wlc] Activating tty
[wlc] MODE: (0) 1600x900 !
[wlc] MODE: (1) 1280x1024 !
[wlc] MODE: (1) 1280x1024 
[wlc] MODE: (1) 1152x864 
[wlc] MODE: (1) 1024x768 
[wlc] MODE: (1) 1024x768 
[wlc] MODE: (1) 1024x768 
[wlc] MODE: (1) 832x624 
[wlc] MODE: (1) 800x600 
[wlc] MODE: (1) 800x600 
[wlc] MODE: (1) 800x600 
[wlc] MODE: (1) 800x600 
[wlc] MODE: (1) 848x480 
[wlc] MODE: (1) 640x480 
[wlc] MODE: (1) 640x480 
[wlc] MODE: (1) 640x480 
[wlc] MODE: (1) 640x480 
[wlc] MODE: (1) 640x480 
[wlc] MODE: (1) 720x400 
[wlc] MODE: (2) 1920x1080 !
[wlc] MODE: (2) 1920x1080 
[wlc] MODE: (2) 1920x1080 
[wlc] MODE: (2) 1920x1080 
[wlc] MODE: (2) 1920x1080 
[wlc] MODE: (2) 1920x1080 
[wlc] MODE: (2) 1680x1050 
[wlc] MODE: (2) 1280x1024 
[wlc] MODE: (2) 1280x1024 
[wlc] MODE: (2) 1440x900 
[wlc] MODE: (2) 1280x960 
[wlc] MODE: (2) 1280x800 
[wlc] MODE: (2) 1152x864 
[wlc] MODE: (2) 1280x720 
[wlc] MODE: (2) 1280x720 
[wlc] MODE: (2) 1280x720 
[wlc] MODE: (2) 1440x576 
[wlc] MODE: (2) 1024x768 
[wlc] MODE: (2) 1024x768 
[wlc] MODE: (2) 1024x768 
[wlc] MODE: (2) 1440x480 
[wlc] MODE: (2) 1440x480 
[wlc] MODE: (2) 832x624 
[wlc] MODE: (2) 800x600 
[wlc] MODE: (2) 800x600 
[wlc] MODE: (2) 800x600 
[wlc] MODE: (2) 800x600 
[wlc] MODE: (2) 720x576 
[wlc] MODE: (2) 720x480 
[wlc] MODE: (2) 720x480 
[wlc] MODE: (2) 640x480 
[wlc] MODE: (2) 640x480 
[wlc] MODE: (2) 640x480 
[wlc] MODE: (2) 640x480 
[wlc] MODE: (2) 720x400 
[wlc] eDP-1 Chose mode (0) 1600x900
Output 1 resolution changed to 1600 x 900
Arranging layout for 0x617d98
Arranging output at 0
Arranging layout for 0x26c9d90
Arranging workspace #0 at 10.000000, 10.000000
Arranging layout for 0x26be120
Arranging 0x26be120 horizontally
Calculating arrangement for 0x2b91b40:4 (will scale 1580.000000 by 1.253968)
Set view to 1580 x 880 @ 10, 10
focus:R|(0x617d98)(p:(nil))(f:0x26c9d90)(h:-1)Type:Root|layout:NONE|w:0.000000|h:0.000000|x:0.000000|y:0.000000|vis:t|name:(null)|children:2
|focus:X|(0x26c9d90)(p:0x617d98)(f:0x26be120)(h:1)Type:Output|layout:NONE|w:1600.000000|h:900.000000|x:0.000000|y:0.000000|vis:f|name:VGA-1|children:1
|-focus:W|(0x26be120)(p:0x26c9d90)(f:0x2b91b40)(h:-1)Type:Workspace|layout:Horiz|w:1580.000000|h:880.000000|x:10.000000|y:10.000000|vis:f|name:web|children:1
|--focus:K|(0x2b91b40)(p:0x26be120)(f:(nil))(h:3)Type:View|layout:NONE|w:1580.000000|h:880.000000|x:10.000000|y:10.000000|vis:t|name:urxvt|children:0
|focus:X|(0x2b9b2a0)(p:0x617d98)(f:0x2b87990)(h:2)Type:Output|layout:NONE|w:1920.000000|h:1080.000000|x:1280.000000|y:0.000000|vis:f|name:HDMI-A-1|children:1
|-focus:X|(0x2b87990)(p:0x2b9b2a0)(f:(nil))(h:-1)Type:Workspace|layout:Horiz|w:1920.000000|h:1080.000000|x:1280.000000|y:0.000000|vis:f|name:term|children:0
Arranging output at 1600
Arranging layout for 0x2b9b2a0
Arranging workspace #0 at 10.000000, 10.000000
Arranging layout for 0x2b87990
focus:R|(0x617d98)(p:(nil))(f:0x26c9d90)(h:-1)Type:Root|layout:NONE|w:0.000000|h:0.000000|x:0.000000|y:0.000000|vis:t|name:(null)|children:2
|focus:X|(0x26c9d90)(p:0x617d98)(f:0x26be120)(h:1)Type:Output|layout:NONE|w:1600.000000|h:900.000000|x:0.000000|y:0.000000|vis:f|name:VGA-1|children:1
|-focus:W|(0x26be120)(p:0x26c9d90)(f:0x2b91b40)(h:-1)Type:Workspace|layout:Horiz|w:1580.000000|h:880.000000|x:10.000000|y:10.000000|vis:f|name:web|children:1
|--focus:K|(0x2b91b40)(p:0x26be120)(f:(nil))(h:3)Type:View|layout:NONE|w:1580.000000|h:880.000000|x:10.000000|y:10.000000|vis:t|name:urxvt|children:0
|focus:X|(0x2b9b2a0)(p:0x617d98)(f:0x2b87990)(h:2)Type:Output|layout:NONE|w:1920.000000|h:1080.000000|x:1280.000000|y:0.000000|vis:f|name:HDMI-A-1|children:1
|-focus:X|(0x2b87990)(p:0x2b9b2a0)(f:(nil))(h:-1)Type:Workspace|layout:Horiz|w:1900.000000|h:1060.000000|x:10.000000|y:10.000000|vis:f|name:term|children:0
[wlc] EGL context is double buffered
[wlc] EGL version: 1.4 (DRI2)
[wlc] EGL vendor: Mesa Project
[wlc] EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2 OpenGL_ES3 
[wlc] EGL context (RGB888)
[wlc] GL version: OpenGL ES 3.0 Mesa 10.6.5
[wlc] GL vendor: Intel Open Source Technology Center
[wlc] GLES2 renderer initialized
[wlc] Set new bsurface to output (1)
Added output 1:eDP-1
Matched output config for eDP-1
[wlc] Output (1) terminated...
OUTPUT: Destroying output '1'
Switching to workspace 0x2b87990:term
Setting focus to 0x2b87990:-1
Arranging layout for 0x2b87990
focus:R|(0x617d98)(p:(nil))(f:0x2b9b2a0)(h:-1)Type:Root|layout:NONE|w:0.000000|h:0.000000|x:0.000000|y:0.000000|vis:t|name:(null)|children:1
|focus:X|(0x2b9b2a0)(p:0x617d98)(f:0x2b87990)(h:2)Type:Output|layout:NONE|w:1920.000000|h:1080.000000|x:1280.000000|y:0.000000|vis:f|name:HDMI-A-1|children:1
|-focus:K|(0x2b87990)(p:0x2b9b2a0)(f:(nil))(h:-1)Type:Workspace|layout:Horiz|w:1900.000000|h:1060.000000|x:10.000000|y:10.000000|vis:f|name:term|children:0
[wlc] Released drm surface (0x2659f18)
[wlc] Removed bsurface from output (1)
[wlc] Removed output (1)
[wlc] VGA-1 Chose mode (0) 1280x1024
Output 1 resolution changed to 1280 x 1024
[wlc] EGL context is double buffered
[wlc] EGL version: 1.4 (DRI2)
[wlc] EGL vendor: Mesa Project
[wlc] EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2 OpenGL_ES3 
[wlc] EGL context (RGB888)
[wlc] GL version: OpenGL ES 3.0 Mesa 10.6.5
[wlc] GL vendor: Intel Open Source Technology Center
[wlc] GLES2 renderer initialized
[wlc] Set new bsurface to output (1)
Added output 1:VGA-1
Matched output config for VGA-1
Set VGA-1 position to 0, 0
Adding 0x2bb6cc0 (1, 1280.000000x1024.000000) to 0x617d98 (0, 0.000000x0.000000)
Workspace: Generating new name
Got valid workspace command for target: 'web'
Workspace: Found free name web
Added workspace web for output 1
Adding 0x2a6c350 (2, 1280.000000x1024.000000) to 0x2bb6cc0 (1, 1280.000000x1024.000000)
Setting focus to 0x2bb6cc0:1
[wlc] Added output (1)
[wlc] HDMI-A-1 Chose mode (0) 1920x1080
[wlc] EGL context is double buffered
[wlc] EGL version: 1.4 (DRI2)
[wlc] EGL vendor: Mesa Project
[wlc] EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2 OpenGL_ES3 
[wlc] EGL context (RGB888)
[wlc] GL version: OpenGL ES 3.0 Mesa 10.6.5
[wlc] GL vendor: Intel Open Source Technology Center
[wlc] GLES2 renderer initialized
[wlc] Set new bsurface to output (2)
Added output 2:HDMI-A-1
Matched output config for HDMI-A-1
Set HDMI-A-1 position to 1280, 0
Adding 0x26d51e0 (1, 1920.000000x1080.000000) to 0x617d98 (0, 0.000000x0.000000)
Workspace: Generating new name
Got valid workspace command for target: 'web'
Got valid workspace command for target: 'term'
Got valid workspace command for target: 'dev'
Workspace: Found free name dev
Added workspace dev for output 2
Adding 0x2af7bb0 (2, 1920.000000x1080.000000) to 0x26d51e0 (1, 1920.000000x1080.000000)
[wlc] Added output (2)
[wlc] become active
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
[wlc] INPUT DEVICE ADDED
Handling command 'exit'
[wlc] Terminating wlc...
[wlc] Terminating compositor...
[wlc] Terminating output (1)...
[wlc] Output (2) terminated...
OUTPUT: Destroying output '2'
Switching to workspace 0x2a6c350:web
Setting focus to 0x2a6c350:-1
Arranging layout for 0x2a6c350
focus:R|(0x617d98)(p:(nil))(f:0x2bb6cc0)(h:-1)Type:Root|layout:NONE|w:0.000000|h:0.000000|x:0.000000|y:0.000000|vis:t|name:(null)|children:2
|focus:X|(0x2bb6cc0)(p:0x617d98)(f:0x2a6c350)(h:1)Type:Output|layout:NONE|w:1280.000000|h:1024.000000|x:0.000000|y:0.000000|vis:f|name:VGA-1|children:1
|-focus:K|(0x2a6c350)(p:0x2bb6cc0)(f:(nil))(h:-1)Type:Workspace|layout:Horiz|w:1280.000000|h:1024.000000|x:0.000000|y:0.000000|vis:f|name:web|children:0
|focus:X|(0x26d51e0)(p:0x617d98)(f:0x2af7bb0)(h:2)Type:Output|layout:NONE|w:1920.000000|h:1080.000000|x:1280.000000|y:0.000000|vis:f|name:HDMI-A-1|children:1
|-focus:X|(0x2af7bb0)(p:0x26d51e0)(f:(nil))(h:-1)Type:Workspace|layout:Horiz|w:1920.000000|h:1080.000000|x:1280.000000|y:0.000000|vis:f|name:dev|children:0
[wlc] Released drm surface (0x265a268)
[wlc] Removed bsurface from output (2)
[wlc] Removed output (2)
[wlc] Output (1) terminated...
OUTPUT: Destroying output '1'
Switching to workspace 0x2af7bb0:dev
Setting focus to 0x2af7bb0:-1
Arranging layout for 0x2af7bb0
focus:R|(0x617d98)(p:(nil))(f:0x26d51e0)(h:-1)Type:Root|layout:NONE|w:0.000000|h:0.000000|x:0.000000|y:0.000000|vis:t|name:(null)|children:1
|focus:X|(0x26d51e0)(p:0x617d98)(f:0x2af7bb0)(h:2)Type:Output|layout:NONE|w:1920.000000|h:1080.000000|x:1280.000000|y:0.000000|vis:f|name:HDMI-A-1|children:1
|-focus:K|(0x2af7bb0)(p:0x26d51e0)(f:(nil))(h:-1)Type:Workspace|layout:Horiz|w:1920.000000|h:1080.000000|x:1280.000000|y:0.000000|vis:f|name:dev|children:0
[wlc] Released drm surface (0x2659f18)
[wlc] Removed bsurface from output (1)
[wlc] Removed output (1)
[wlc] Compositor terminated...
[wlc] Cleanup wlc
[wlc] Closed drm
Destroying window 3
Setting focus to 0x2af7bb0:-1
[wlc] Closing Xwayland
Error: Signal 11. Printing backtrace
Backtrace: ./bin/sway(error_handler+0x66) [0x407706]
Backtrace: /usr/lib/libc.so.6(+0x33680) [0x7fc9dacc0680]
Backtrace: /usr/lib/libEGL.so(+0xf00c) [0x7fc9d607500c]
Backtrace: /usr/lib/libEGL.so(+0xea07) [0x7fc9d6074a07]
Backtrace: /usr/lib/libwayland-server.so.0(+0x65dc) [0x7fc9daa815dc]
Backtrace: /usr/lib/libwayland-server.so.0(wl_map_for_each+0x4d) [0x7fc9daa86aad]
Backtrace: /usr/lib/libwayland-server.so.0(wl_client_destroy+0x78) [0x7fc9daa82218]
Backtrace: /usr/local/lib64/libwlc.so.0(wlc_xwayland_terminate+0x64) [0x7fc9db718195]
Backtrace: /usr/local/lib64/libwlc.so.0(wlc_cleanup+0x43) [0x7fc9db717157]
Backtrace: /usr/local/lib64/libwlc.so.0(wlc_run+0xba) [0x7fc9db7174d0]
Backtrace: ./bin/sway(main+0x336) [0x40c416]
Backtrace: /usr/lib/libc.so.6(__libc_start_main+0xf0) [0x7fc9dacad610]
Backtrace: ./bin/sway(_start+0x29) [0x403e89]

Better implemented move.

(Moved this discussion from a pull request into a issue)
Going to find a way to make move play nice with split/h and various other layouts, as currently we just shuffle up and down a list without a care for what this does to the output. It works fine for standard horizontal tiling but no good for anything else.

Moving away from GitHub

Strongly considering moving this project to Gitlab. Leave your opinions here. Advantages:

  • Gitlab is open source
  • Gitlab has free, well integrated CI including support for self-hosted workers
  • I prefer Gitlab's politics

bindsym $mod+Shift+number doesn't work

When I press $mod+Shift+3, I'd expect the current window to get moved to workspace 3. Instead, sway doesn't capture the keybinding, and it goes through to the program underneath. Keybindings like $mod+Shift+r or $mod+3 work correctly.

Sway treats comments as arguments

When running sway, I get (amongst others) the following error message:

Handling command 'set $mod Mod4       # Logo key. Use Mod1 for Alt.'
Invalid set command.(expected 2 arguments, got 9

Command failed: set

It looks like it interprets the comment at the end of the line as arguments to the set command.

(commit 786bb87, using AUR package sway-git)

All clicks are being consumed by sway

I haven't looked too far into this, but somehow pointer_mode_set is failing to correctly set the pointer mode resulting in EVENT_HANDLED being sent for all clicks. My first assumption would be that the logic for checking if the floating_modifier is being held is somehow giving incorrect results, but I'm not too sure.

view ordering

right now we use a poorly done "push everything we want visible to the front, push everything we dont to the back" kind of method of handling view ordering.
it works okish with no tabs or stacks, but should be fixed.

ill try to work on this today, will mostly involve changing arrange_windows a bit.

Sway doesn't compile under Debian Stretch due to C14

I filed something similar with WLC, apparently chck is incompatible with C14, which GCC 5 appears to default to, which is default in Debian Stretch

They ended up requiring CMake 3.1, and using a Cmake function to force it to C99

Man pages

I'll have to pull in my asciidoc stuff from other projects, but we should have man pages. Better than i3, too, cause we can provide a list of config commands in it.

Proper Resizing.

Resizing is a tricky thing to do properly and needs to be handled in more than a few situations. This issue will serve to list proposed ideas and to debate them.

  • Resizing windows using resize grow/shrink height/width:
    Check to see if the parent container has the layout which is in line with our type of movement(L_HORIZ for width). If it does not, or it has 0 children which are to the left/right or top/bottom of our current container, then move up to the next parent and check again. Repeat until root container is hit, or we get a proper check. Once we do, count the number of containers that are either to the left/right or top/bottom of our focused container. If there are only containers to one side or the other, increase the edge of the current container by the specified amount, and decrease the edges of all the siblings by the specified amount/sibling number. If there are containers on both sides, increase both sides of our container by amount/2 and decrease the other containers by the amoumt/number on that side * 1/2. These containers will have the recursive resizer applied to them to ensure that they are resized properly with all children.
  • Resizing windows using the mouse:
    Find the edge of the currently focused view that the mouse is closest to. Check the parent of the currently focused view's edge to see if it has the same X or Y coordinate as the currently focused view's edge. If it does, move up to the parent and perform the check again. If the parent does not share the edge, then resize all views within the current container in the proper direction, and resize all views in the bordering container in the opposite direction. A recursive function will perform this resizing, but its exact functionality is tbd.
  • Inserting a new view:
    There's some discussion between me and @taiyu-len about the best way to do this. I favor a method in which, all sibling containers have their width/height reduced by parent container width or height/number of siblings+1. This width/height and X/Y reduction will be performed by the recursive resizing function using edges determined by mouse direction, and the new view is inserted into the new space which should be around where the mouse was.
  • Recursive function to properly resize a container and all its children:
    This function should take a container, a direction, and a pixel value. It should add the pixel value(either positive or negative) to the container's X or Y on the proper edge and also add the pixel value to either the width or height. Then it should find the number of of children which have the same orientation as the provided edge(i.e. width corresponds to the number of containers on the left/right of eachother and vice versa), and apply the function using the pixel change divided by this number of children, and the given direction.

Thoughts, alternative ideas, etc?

Add wayland-session and xsession files

It would be nice to have a wayland-session file in /usr/share/wayland-sessions/ and an xsession file in /usr/share/xsessions/, so that display managers can detect sway and display an option to start it.

Those files could look like this for example:

[Desktop Entry]
Name=sway
Comment=SirCmpwn's Wayland window manager
Exec=sway
Type=Application

(note: I haven't tried out if the file above actually works)

swaygrab

We should implement a tool called "swaygrab" or similar that allows you to dump pixels from the screen, for the sake of taking screenshots and recording video.

Regressions with workspaces and focus

There were several problems with multiple outputs introduced by the focus changes in #65 that I missed.

  • Last workspace on an output is destroyed, leaving output inaccessible (Fixed by a64b10d)
  • Setting focus for outputs is broken (Fixed by a64b10d)
  • When leaving a workspace for one on another output, when the destination output has no views, the window on the previous output remains activated
  • Switching outputs with focus commands no longer works if the destination output has no views

cc @taiyu-len

IPC feature support

Message types and their implementation status:

  • command
  • subscribe
    • workspace
    • barconfig_update
    • output
    • mode
    • window
    • binding
  • get_workspaces
  • get_outputs
  • get_tree
  • get_marks
  • get_bar_config
  • get_version -- somewhat done, needs better version numbers
  • json string encoding (quotation marks, utf-8) -- using json-c

handling views depending on their type.

right now we are using this https://github.com/SirCmpwn/sway/blob/master/sway/handlers.c#L192
poorly done method to handle it.

there is some effort to mimic certain programs behaviors.
mostly dmenu and firefox popup windows.

however the information about the views that can be gained from wlc, is not enough to properly figure out how to handle views.

for dmenu here is all the information we can get
handle:3 type:1 state:0 parent:0 mask:1 (x:0 y:0 w:2704 h:15) title:(null) class:(null) appid:(null)
and for a program opened with wine.
handle:3 type:1 state:0 parent:0 mask:1 (x:30 y:8 w:540 h:538) title:(BElJ}:0<nEA!!4D6-%+%9%?%%W%m%0%i% class:custom.exe appid:(null)

they look the same (other then the title and class), but behave completely differently.

here is dmenu shown with xwininfo -all http://ix.io/klF
here is the program opened with wine http://ix.io/klG

so the issue is.
get more info about views, and have better handling depending on said info.

X11 Regressions.

It seems as if multiple output workspaces have somehow regressed in X, and workspaces have been imaginarily linked together(opening a view in one workspace somehow inserts it into the tree of another). There are also numerous segfaults occuring as a result of this.

Add version information

The --version command line switch as well as the get_version IPC command (see #98) could use this information. Should probably generated at compile time.

i3 IPC version information includes:

{
    "human_readable": "4.10.3-347-g586854b (2015-07-30, branch \"makepkg\")",
    "major": 4,
    "minor": 10,
    "patch": 3
}

More flexible logging

I personally run sway with sway ^ sway.log, but it'd be nice if we could specify a log file in the config or command line.

View stays black after moving onto second output

When there are 2 outputs, and you open a program (xterm in my case) on the first, then move it to the second output (move container to workspace 2) the view is black until you give it focus (e.g. hover with the mouse).

Sway is unusably slow

Hey! I was excited to hear about sway so I tried it out.
Unfortunately, it is super slow for me. I think it might be because I have Intel GMA 950 graphics card (I know, but I don't play games and for other uses it's sufficient; kvm works fine). I'm not sure if sway / wayland uses any 3D, or any other advanced GPU features so I'm asking you for help / answer to my problem. Also, as you can see in the htop window, it uses 100% of my CPU core most of the time.

I'm using Arch Linux and latest sway from git.

Here is the log: -deleted-
And here is the video: -deleted-

Thank you.

Focus issues with unmanaged views and xwayland views

Some weirdness is going on. One is easy to reproduce:

  1. Open firefox
  2. Type in a URL

It will behave quite strangely. I think this is because of unmanaged views getting focus automatically, but we probably shouldn't do that. Let's see if dmenu freaks out without it.

Signed/unsigned comparsion

When enabling the warnings with -Wextra -Wno-unused-parameter a couple of warnings show up. Since all numbers are treated as unsigned when comparing signed and unsigned, this could end badly if the signed number becomes negative (i.e. a huge unsigned value).

I suggest enabling those warnings for sway and explicitly casting to unsigned in places where it's safe and known to cause no harm.

[  6%] Building C object CMakeFiles/sway.dir/sway/main.c.o
[ 20%] Building C object CMakeFiles/sway.dir/sway/commands.c.o
[ 20%] Building C object CMakeFiles/sway.dir/sway/input_state.c.o
[ 26%] Building C object CMakeFiles/sway.dir/sway/container.c.o
sway/commands.c:109:17: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                for (j = 0; j < sizeof(modifiers) / sizeof(struct modifier_key); ++j) {
                            ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sway/input_state.c:51:55: warning: missing field 'init_view' initializer [-Wmissing-field-initializers]
struct pointer_state pointer_state = {0, 0, {0, 0}, {0}, {0, 0, 0, 0}};
                                                      ^
sway/commands.c:264:17: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                for (j = 0; j < sizeof(modifiers) / sizeof(struct modifier_key); ++j) {
                            ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[ 33%] Building C object CMakeFiles/sway.dir/sway/readline.c.o
[ 40%] Building C object CMakeFiles/sway.dir/sway/layout.c.o
2 warnings generated.
[ 46%] Building C object CMakeFiles/sway.dir/sway/config.c.o
sway/layout.c:119:16: warning: comparison of integers of different signs: 'int' and 'uint' (aka 'unsigned int') [-Wsign-compare]
        for (i = 0; i < clength; ++i) {
                    ~ ^ ~~~~~~~
sway/layout.c:132:42: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
                        else if (direction == MOVE_RIGHT && i < clength-1){
                                                            ~ ^ ~~~~~~~~~
[ 60%] Building C object CMakeFiles/sway.dir/sway/log.c.o
[ 53%] Building C object CMakeFiles/sway.dir/sway/handlers.c.o
sway/config.c:110:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
        for (i = 0; i < sizeof(search_paths) / sizeof(char *); ++i) {
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
sway/log.c:52:9: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (c > sizeof(verbosity_colors) / sizeof(char *)) {
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sway/log.c:75:9: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (c > sizeof(verbosity_colors) / sizeof(char *)) {
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 66%] Building C object CMakeFiles/sway.dir/sway/workspace.c.o
1 warning generated.
2 warnings generated.
[ 73%] Building C object CMakeFiles/sway.dir/sway/focus.c.o
[ 80%] Building C object CMakeFiles/sway.dir/sway/stringop.c.o
[ 86%] Building C object CMakeFiles/sway.dir/sway/list.c.o
[ 93%] Building C object CMakeFiles/sway.dir/sway/ipc.c.o
sway/ipc.c:128:22: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
                if (read_available >= client->payload_length) {
                    ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[100%] Linking C executable bin/sway
[100%] Built target sway

i3 feature support

Layouts

  • Horizontal tiling
  • Vertical tiling
  • Stacked
  • Tabbed
  • Floating
  • Saving layouts to disk will not support
  • Loading layouts from disk will not support

Config/commands

  • Config parser
  • Variables/set
  • bindsym
    • mouse bindings
    • --release
  • bindcode
    • --release
  • focus_follows_mouse
  • exit
  • exec
  • exec_always
  • fullscreen
  • workspace
    • left/right/up/down
    • number
    • next/prev
    • next_on_output/prev_on_output
    • <name>
    • <name> output <output>
    • back_and_forth
  • splith/splitv
  • focus
    • left/right/up/down
    • parent
    • mode_toggle
  • move
    • left/right/up/down
    • workspace to output
      • left/right/up/down
      • named output
    • position
  • kill
  • mode
  • layout
    • stacking
    • tabbed
    • splith
    • splitv
    • toggle split
  • bar
  • floating toggle
  • floating_modifier
  • for_window
  • font
  • default_orientation
  • workspace_layout
  • assign
  • popup_during_fullscreen
  • force_focus_wrapping
  • workspace_auto_back_and_forth
  • scratchpad
    • move scratchpad
    • scratchpad show
  • resize
    • grow
    • shrink
  • move position mouse
  • sticky toggle
  • show_marks
  • no_focus

Features

  • IPC
  • Restart in-place
  • Reload config on the fly
  • Resize containers with mouse
  • Command line options
  • Ignore i3 commands that aren't valid (i.e. force_xinerama)
  • swaybar
  • swaylock - usable, but incomplete
  • swaymsg
  • borders
  • color customization
  • Mode_switch
  • gaps
  • [criteria] command

See also:

IPC feature support: #98
i3bar feature support: #343
i3-gaps feature support: #307

cppcheck

Sorry for the premature posting, I accidentally hitted enter.
I made a cppcheck run and found the following issues:

[sway/commands.c:180]: (style) The scope of the variable 'i' can be reduced.
[sway/commands.c:512]: (error) Common realloc mistake: 'parts' nulled but not freed upon failure
[sway/commands.c:527]: (error) Common realloc mistake: 'parts' nulled but not freed upon failure
[sway/handlers.c:36] -> [sway/handlers.c:41]: (warning) Possible null pointer dereference: focused - otherwise it is redundant to check it against null.
[sway/handlers.c:200] -> [sway/handlers.c:201]: (warning) Possible null pointer dereference: c - otherwise it is redundant to check it against null.
[sway/handlers.c:158]: (style) The scope of the variable 'parent' can be reduced.
[sway/log.c:22]: (style) The scope of the variable 'flag' can be reduced.
[sway/readline.c:20]: (error) Common realloc mistake: 'string' nulled but not freed upon failure
[sway/readline.c:29]: (error) Common realloc mistake: 'string' nulled but not freed upon failure
[sway/stringop.c:89]: (style) The function 'code_strchr' is never used.
[sway/stringop.c:84]: (style) The function 'code_strstr' is never used.
[sway/list.c:46]: (style) The function 'list_cat' is never used.
[sway/log.c:36]: (style) The function 'sway_abort' is never used.
[sway/stringop.c:107]: (style) The function 'unescape_string' is never used.
[sway/workspace.c:144]: (style) The function 'workspace_prev' is never used.

Aside from the cosmetic fixes, there are some concerns that I got after inspecting the signaled lines. First, the total disregard for OOM situations. Is that intentional? I know it's common to just let it crash if that's the case, but I though I'd better rise the issue in case it wasn't something decided upon but an accident.
Other than that, there is a particularly suspicious piece of code. In the lines 36 to 41 in handlers.c, you first get the focused container to a focused pointer. It's alright up until that point. Later, my guess after a shallow inspection is that whoever wrote the code considered the focused windows could change, but never reassigned this possible change to focused. Then checks as if it was checked. That, or the first if, in line 37 can crash, since it dereferences focused to access the handle contained by it.
Other than that, if you want it, I can make a pull request for the trivial fixes at some point this week.

Unable to press keys on GTK file dialog

Open some application that would open the file picker. You could click "selecting them" on the Github comment field, for example. Does not receive focus.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.