summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.bg.md7
-rw-r--r--README.de.md9
-rw-r--r--README.el.md2
-rw-r--r--README.fr.md8
-rw-r--r--README.it.md9
-rw-r--r--README.ja.md3
-rw-r--r--README.md8
-rw-r--r--README.pt.md6
-rw-r--r--README.ru.md8
-rw-r--r--README.uk.md10
-rw-r--r--completions/bash/swaybar2
-rw-r--r--completions/zsh/_sway4
-rw-r--r--completions/zsh/_swaybar13
-rw-r--r--completions/zsh/_swayidle22
-rw-r--r--completions/zsh/_swaylock40
-rw-r--r--completions/zsh/_swaymsg12
-rw-r--r--include/sway/commands.h1
-rw-r--r--include/sway/config.h2
-rw-r--r--include/sway/input/cursor.h2
-rw-r--r--include/sway/input/seat.h4
-rw-r--r--sway/commands.c1
-rw-r--r--sway/commands/seat/cursor.c49
-rw-r--r--sway/commands/tiling_drag_threshold.c22
-rw-r--r--sway/config.c1
-rw-r--r--sway/desktop/render.c2
-rw-r--r--sway/desktop/transaction.c4
-rw-r--r--sway/input/cursor.c75
-rw-r--r--sway/input/seat.c15
-rw-r--r--sway/meson.build1
-rw-r--r--sway/server.c2
-rw-r--r--sway/sway-output.5.scd12
-rw-r--r--sway/sway.5.scd21
-rw-r--r--sway/tree/view.c10
-rw-r--r--swayidle/main.c13
-rw-r--r--swaylock/password.c8
-rw-r--r--swaylock/seat.c6
36 files changed, 308 insertions, 106 deletions
diff --git a/README.bg.md b/README.bg.md
index efc99f15..87a15bed 100644
--- a/README.bg.md
+++ b/README.bg.md
@@ -1,8 +1,9 @@
1# sway 1# sway
2 2
3"**S**irCmpwn's **Way**land compositor" е в процес на разработка, съвместим с i3, [Wayland](http://wayland.freedesktop.org/) композитор. 3Sway е в процес на разработка, съвместим с i3,
4Прочетете [FAQ](https://github.com/swaywm/sway/wiki). Присъединете се в 4[Wayland](http://wayland.freedesktop.org/) композитор. Прочетете
5[IRC канала](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на 5[FAQ](https://github.com/swaywm/sway/wiki). Присъединете се в [IRC
6канала](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на
6irc.freenode.net). 7irc.freenode.net).
7 8
8[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png) 9[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png)
diff --git a/README.de.md b/README.de.md
index 2c2e14e8..bf92b196 100644
--- a/README.de.md
+++ b/README.de.md
@@ -3,10 +3,11 @@
3Der Fortschritt dieser Übersetzung kann [hier](https://github.com/swaywm/sway/issues/1318) 3Der Fortschritt dieser Übersetzung kann [hier](https://github.com/swaywm/sway/issues/1318)
4eingesehen werden. 4eingesehen werden.
5 5
6"**S**irCmpwn's **Way**land compositor" ist ein i3-kompatibler 6Sway ist ein i3-kompatibler
7[Wayland](http://wayland.freedesktop.org/)-Kompositor. Lies die 7[Wayland](http://wayland.freedesktop.org/)-Kompositor. Lies die
8[FAQ](https://github.com/swaywm/sway/wiki#faq). Tritt dem 8[FAQ](https://github.com/swaywm/sway/wiki#faq). Tritt dem
9[IRC-Channel](http://webchat.freenode.net/?channels=sway&uio=d4) bei (#sway in irc.freenode.net). 9[IRC-Channel](http://webchat.freenode.net/?channels=sway&uio=d4) bei (#sway in
10irc.freenode.net).
10 11
11[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png) 12[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png)
12 13
diff --git a/README.el.md b/README.el.md
index 3c9d65c9..79acd422 100644
--- a/README.el.md
+++ b/README.el.md
@@ -1,6 +1,6 @@
1# sway 1# sway
2 2
3"Ο Sway (**S**irCmpwn's **Way**land) είναι ένας **υπό ανάπτυξη** [Wayland](http://wayland.freedesktop.org/) διαχειριστής παραθύρων συμβατός με τον αντίστοιχο διαχειριστή παραθύρων i3 για τον X11. 3Sway είναι ένας **υπό ανάπτυξη** [Wayland](http://wayland.freedesktop.org/) διαχειριστής παραθύρων συμβατός με τον αντίστοιχο διαχειριστή παραθύρων i3 για τον X11.
4Διαβάστε τις [Συνήθεις Ερωτήσεις](https://github.com/swaywm/sway/wiki). Συνδεθείτε στο [κανάλι μας στο IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway στο 4Διαβάστε τις [Συνήθεις Ερωτήσεις](https://github.com/swaywm/sway/wiki). Συνδεθείτε στο [κανάλι μας στο IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway στο
5irc.freenode.net). 5irc.freenode.net).
6 6
diff --git a/README.fr.md b/README.fr.md
index 935d288f..8ad4d3b6 100644
--- a/README.fr.md
+++ b/README.fr.md
@@ -1,9 +1,9 @@
1# sway 1# sway
2 2
3"**S**irCmpwn's **Way**land compositor" est un compositeur [Wayland](http://wayland.freedesktop.org/) 3Sway est un compositeur [Wayland](http://wayland.freedesktop.org/) compatible
4compatible avec i3, **en cours de développement**. 4avec i3, **en cours de développement**. Lisez la
5Lisez la [FAQ](https://github.com/swaywm/sway/wiki). Rejoignez le 5[FAQ](https://github.com/swaywm/sway/wiki). Rejoignez le [canal
6[canal IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway sur 6IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway sur
7irc.freenode.net). 7irc.freenode.net).
8 8
9[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png) 9[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png)
diff --git a/README.it.md b/README.it.md
index af986844..8a83bc78 100644
--- a/README.it.md
+++ b/README.it.md
@@ -1,10 +1,9 @@
1# sway 1# sway
2 2
3"**S**irCmpwn's **Way**land compositor" è un compositor 3Sway è un compositor [Wayland](http://wayland.freedesktop.org/) **in via di
4[Wayland](http://wayland.freedesktop.org/) **in via di sviluppo** 4sviluppo** compatibile con i3. Leggi le [FAQ (in
5compatibile con i3. 5Inglese)](https://github.com/swaywm/sway/wiki). Unisciti al [canale IRC (in
6Leggi le [FAQ (in Inglese)](https://github.com/swaywm/sway/wiki). Unisciti al 6Inglese)](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
7[canale IRC (in Inglese)](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
8irc.freenode.net). 7irc.freenode.net).
9 8
10[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png) 9[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png)
diff --git a/README.ja.md b/README.ja.md
index b9e541f0..d82e78b2 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -1,7 +1,6 @@
1# sway 1# sway
2 2
3"**S**irCmpwn's **Way**land compositor"は**開発中**の 3Swayは**開発中**のi3互換な[Wayland](http://wayland.freedesktop.org/)コンポジタです。
4i3互換な[Wayland](http://wayland.freedesktop.org/)コンポジタです。
5[FAQ](https://github.com/swaywm/sway/wiki)も合わせてご覧ください。 4[FAQ](https://github.com/swaywm/sway/wiki)も合わせてご覧ください。
6[IRC チャンネル](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on irc.freenode.net)もあります。 5[IRC チャンネル](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on irc.freenode.net)もあります。
7 6
diff --git a/README.md b/README.md
index 6cb212fc..1deb9a4c 100644
--- a/README.md
+++ b/README.md
@@ -3,10 +3,10 @@
3[**English**](https://github.com/swaywm/sway/blob/master/README.md#sway--) - [日本語](https://github.com/swaywm/sway/blob/master/README.ja.md#sway--) - [Deutsch](https://github.com/swaywm/sway/blob/master/README.de.md#sway--) - [Ελληνικά](https://github.com/swaywm/sway/blob/master/README.el.md#sway--) - [Français](https://github.com/swaywm/sway/blob/master/README.fr.md#sway--) - [Українська](https://github.com/swaywm/sway/blob/master/README.uk.md#sway--) - [Italiano](https://github.com/swaywm/sway/blob/master/README.it.md#sway--) - [Português](https://github.com/swaywm/sway/blob/master/README.pt.md#sway--) - 3[**English**](https://github.com/swaywm/sway/blob/master/README.md#sway--) - [日本語](https://github.com/swaywm/sway/blob/master/README.ja.md#sway--) - [Deutsch](https://github.com/swaywm/sway/blob/master/README.de.md#sway--) - [Ελληνικά](https://github.com/swaywm/sway/blob/master/README.el.md#sway--) - [Français](https://github.com/swaywm/sway/blob/master/README.fr.md#sway--) - [Українська](https://github.com/swaywm/sway/blob/master/README.uk.md#sway--) - [Italiano](https://github.com/swaywm/sway/blob/master/README.it.md#sway--) - [Português](https://github.com/swaywm/sway/blob/master/README.pt.md#sway--) -
4[Русский](https://github.com/swaywm/sway/blob/master/README.ru.md#sway--) - [Български](https://github.com/swaywm/sway/blob/master/README.bg.md#sway--) 4[Русский](https://github.com/swaywm/sway/blob/master/README.ru.md#sway--) - [Български](https://github.com/swaywm/sway/blob/master/README.bg.md#sway--)
5 5
6"**S**irCmpwn's **Way**land compositor" is a **work in progress** 6sway is a **work in progress** i3-compatible
7i3-compatible [Wayland](http://wayland.freedesktop.org/) compositor. 7[Wayland](http://wayland.freedesktop.org/) compositor. Read the
8Read the [FAQ](https://github.com/swaywm/sway/wiki). Join the 8[FAQ](https://github.com/swaywm/sway/wiki). Join the [IRC
9[IRC channel](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on 9channel](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
10irc.freenode.net). 10irc.freenode.net).
11 11
12If you'd like to support sway development, please contribute to [SirCmpwn's 12If you'd like to support sway development, please contribute to [SirCmpwn's
diff --git a/README.pt.md b/README.pt.md
index 91e709c1..8cdfa548 100644
--- a/README.pt.md
+++ b/README.pt.md
@@ -1,8 +1,8 @@
1# sway 1# sway
2 2
3"**S**irCmpwn's **Way**land compositor" é um compositor [Wayland](http://wayland.freedesktop.org/) 3Sway é um compositor [Wayland](http://wayland.freedesktop.org/) compatível com o
4compatível com o i3. Leia o [FAQ](https://github.com/swaywm/sway/wiki). Participe do 4i3. Leia o [FAQ](https://github.com/swaywm/sway/wiki). Participe do [canal
5[canal IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway no 5IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway no
6irc.freenode.net). 6irc.freenode.net).
7 7
8[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png) 8[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png)
diff --git a/README.ru.md b/README.ru.md
index 4b34dc2d..255e36aa 100644
--- a/README.ru.md
+++ b/README.ru.md
@@ -1,9 +1,9 @@
1# sway 1# sway
2 2
3"**S**irCmpwn's **Way**land compositor" на данный момент **(в разработке)** 3Sway на данный момент **(в разработке)** i3-совместимый
4i3-совместимый [Wayland](http://wayland.freedesktop.org/) композитор. 4[Wayland](http://wayland.freedesktop.org/) композитор. Прочитайте
5Прочитайте [FAQ](https://github.com/swaywm/sway/wiki). Присоединяйтесь к 5[FAQ](https://github.com/swaywm/sway/wiki). Присоединяйтесь к [IRC
6[IRC каналу](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на 6каналу](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на
7irc.freenode.net). 7irc.freenode.net).
8 8
9[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png) 9[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png)
diff --git a/README.uk.md b/README.uk.md
index 9ae7425a..5e9345b3 100644
--- a/README.uk.md
+++ b/README.uk.md
@@ -1,10 +1,10 @@
1# sway 1# sway
2 2
3**Sway** ("**S**irCmpwn's **Way**land compositor") це сумісний з i3 композитор 3**Sway** це сумісний з i3 композитор [Wayland](http://wayland.freedesktop.org/)
4[Wayland](http://wayland.freedesktop.org/) (**у стані розробки**). 4(**у стані розробки**). Ознайомтесь з
5Ознайомтесь з [ЧаПами](https://github.com/swaywm/sway/wiki). 5[ЧаПами](https://github.com/swaywm/sway/wiki). Приєднуйтесь до [спільноти в
6Приєднуйтесь до [спільноти в IRC](http://webchat.freenode.net/?channels=sway&uio=d4) 6IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на
7(#sway на irc.freenode.net). 7irc.freenode.net).
8 8
9[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png) 9[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png)
10 10
diff --git a/completions/bash/swaybar b/completions/bash/swaybar
index 504588f1..1e085c65 100644
--- a/completions/bash/swaybar
+++ b/completions/bash/swaybar
@@ -27,7 +27,7 @@ _swaybar()
27 return 27 return
28 ;; 28 ;;
29 -b|--bar_id) 29 -b|--bar_id)
30 bars=($(swaymsg -t get_bar_config | sed -e '/^\[/,/\]$/{//d;s/^ *"\(.*\)",\?.*$/\1/}')) 30 bars=($(swaymsg -t get_bar_config | jq -r '.[]'))
31 COMPREPLY=($(compgen -W "${bars[*]}" -- "$cur")) 31 COMPREPLY=($(compgen -W "${bars[*]}" -- "$cur"))
32 return 32 return
33 ;; 33 ;;
diff --git a/completions/zsh/_sway b/completions/zsh/_sway
index 05112002..a7f55cc5 100644
--- a/completions/zsh/_sway
+++ b/completions/zsh/_sway
@@ -13,8 +13,8 @@
13# 13#
14# ------------------------------- 14# -------------------------------
15_arguments -s \ 15_arguments -s \
16 '(-v --version)'{-v,--version}'[shows version]' \ 16 '(-v --version)'{-v,--version}'[Show the version number and quit]' \
17 '(-h --help)'{-h,--help}'[shows help message]' \ 17 '(-h --help)'{-h,--help}'[Show help message and quit]' \
18 '(-c --config)'{-c,--config}'[Specify a config file]:files:_files' \ 18 '(-c --config)'{-c,--config}'[Specify a config file]:files:_files' \
19 '(-C --validate)'{-C,--validate}'[Check validity of the config file, then exit]' \ 19 '(-C --validate)'{-C,--validate}'[Check validity of the config file, then exit]' \
20 '(-d --debug)'{-d,--debug}'[Enables full logging, including debug information]' \ 20 '(-d --debug)'{-d,--debug}'[Enables full logging, including debug information]' \
diff --git a/completions/zsh/_swaybar b/completions/zsh/_swaybar
new file mode 100644
index 00000000..af2cee95
--- /dev/null
+++ b/completions/zsh/_swaybar
@@ -0,0 +1,13 @@
1#compdef swaybar
2#
3# Completion script for swaybar
4#
5
6local bars=($(swaymsg -t get_bar_config | jq -r '.[]'))
7
8_arguments -s \
9 '(-h --help)'{-h,--help}'[Show help message and quit]' \
10 '(-v --version)'{-v,--version}'[Show version and quit]' \
11 '(-s --socket)'{-s,--socket}'[Connect to sway via socket]:filename:_files' \
12 '(-b --bar_id)'{-b,--bar-id}'[Bar ID for which to get the configuration]:filename:($bars)'\
13 '(-d --debug)'{-d,--debug}'[Enable debugging]'
diff --git a/completions/zsh/_swayidle b/completions/zsh/_swayidle
new file mode 100644
index 00000000..b419bc2c
--- /dev/null
+++ b/completions/zsh/_swayidle
@@ -0,0 +1,22 @@
1#compdef swayidle
2#
3# Completion script for swayidle
4#
5
6local events=('timeout:Execute timeout command if there is no activity for timeout seconds'
7 'before-sleep:Execute before-sleep command before sleep')
8local resume=('resume:Execute command when there is activity again')
9
10if (($#words <= 2)); then
11 _arguments -C \
12 '(-h --help)'{-h,--help}'[Show help message and quit]' \
13 '(-d)'-d'[Enable debug output]'
14 _describe -t "events" 'swayidle' events
15
16elif [[ "$words[-3]" == before-sleep || "$words[-3]" == resume ]]; then
17 _describe -t "events" 'swayidle' events
18
19elif [[ "$words[-4]" == timeout ]]; then
20 _describe -t "events" 'swayidle' events
21 _describe -t "resume" 'swayidle' resume
22fi
diff --git a/completions/zsh/_swaylock b/completions/zsh/_swaylock
index 8fb4834c..9bc84ec9 100644
--- a/completions/zsh/_swaylock
+++ b/completions/zsh/_swaylock
@@ -4,11 +4,37 @@
4# 4#
5 5
6_arguments -s \ 6_arguments -s \
7 '(-v --version)'{-v,--version}'[Show the version number and quit]' \ 7 '(-C --config)'{-C,--config}'[Path to the config file]:filename:_files' \
8 '(-h --help)'{-h,--help}'[Show help message and quit]' \ 8 '(-c --color)'{-c,--color}'[Turn the screen into the given color instead of white]:color:' \
9 '(-f --daemonize)'{-f,--daemonize}'[Detach from the controlling terminal]' \ 9 '(-e --ignore-empty-password)'{-e,--ignore-empty-password}'[When an empty password is provided, do not validate it]' \
10 '(-c --color)'{-c,--color}'[Specify a color (rrggbb)]' \ 10 '(-f --daemonize)'{-f,--daemonize}'[Detach from the controlling terminal after locking]' \
11 '(-i --image)'{-i,--image}'[Display an image]:files:_files' \ 11 '(-h --help)'{-h,--help}'[Show help message and quit]' \
12 '(-s --scaling)'{-s,--scaling}'[Scaling mode]:mode:(stretch fill fit center tile)' \ 12 '(-i --image)'{-i,--image}'[Display an image]:filename:_files' \
13 '(-s --scaling)'{-s,--scaling}'[Scaling mode]:mode:(stretch fill fit center tile)' \
14 '(-t --tiling)'{-t,--tiling}'[Same as --scaling=tile]' \
13 '(-u --no-unlock-indicator)'{-u,--no-unlock-indicator}'[Disable the unlock indicator]' \ 15 '(-u --no-unlock-indicator)'{-u,--no-unlock-indicator}'[Disable the unlock indicator]' \
14 '(--socket)'--socket'[Use the specified socket path.]:files:_files' \ 16 '(-v --version)'{-v,--version}'[Show the version number and quit]' \
17 '(--bs-hl-color)'--bs-hl-color'[Sets the color of backspace highlights segments]:color:' \
18 '(--font)'--font'[Sets the font of the text]:font:' \
19 '(--indicator-radius)'--indicator-radius'[Sets the indicator radius]:radius:' \
20 '(--indicator-thickness)'--indicator-thickness'[Sets the indicator thickness]:thickness:' \
21 '(--inside-color)'--inside-color'[Sets the color of the inside of the indicator]:color:' \
22 '(--inside-clear-color)'--inside-clear-color'[Sets the color of the inside of the indicator when cleared]:color:' \
23 '(--inside-clear-color)'--inside-clear-color'[Sets the color of the inside of the indicator when verifying]:color:' \
24 '(--inside-wrong-color)'--inside-wrong-color'[Sets the color of the inside of the indicator when invalid]:color:' \
25 '(--key-hl-color)'--key-hl-color'[Sets the color of the key press highlight segments]:color:' \
26 '(--line-color)'--line-color'[Sets the color of the line between the inside and ring]:color:' \
27 '(--line-clear-color)'--line-clear-color'[Sets the color of the line between the inside and ring when cleared]:color:' \
28 '(--line-ver-color)'--line-ver-color'[Sets the color of the line between the inside and ring when verifying]:color:' \
29 '(--line-wrong-color)'--line-wrong-color'[Sets the color of the line between the inside and ring when invalid]:color:' \
30 '(-n --line-uses-inside)'{-n,--line-uses-inside}'[Use the inside color for the line between the inside and ring]' \
31 '(-r --line-uses-ring)'{-r,--line--uses-ring}'[Use the ring color for the line between the inside and ring]' \
32 '(--ring-color)'--ring-color'[Sets the color of the ring of the indicator]:color:' \
33 '(--ring-clear-color)'--ring-clear-color'[Sets the color of the ring of the indicator when cleared]:color:' \
34 '(--ring-ver-color)'--ring-ver-color'[Sets the color of the ring of the indicator when verifying]:color:' \
35 '(--ring-wrong-color)'--ring-wrong-color'[Sets the color of the ring of the indicator when invalid]:color:' \
36 '(--separator-color)'--separator-color'[Sets the color of the lines that separate highlight segments]:color:' \
37 '(--text-color)'--text-color'[Sets the color of the text]:color:' \
38 '(--text-clear-color)'--text-clear-color'[Sets the color of the text when cleared]:color:' \
39 '(--text-ver-color)'--text-ver-color'[Sets the color of the text when verifying]:color:' \
40 '(--text-wrong-color)'--text-wrong-color'[Sets the color of the text when invalid]:color:' \ No newline at end of file
diff --git a/completions/zsh/_swaymsg b/completions/zsh/_swaymsg
index a7a1c8e0..0ba45d4a 100644
--- a/completions/zsh/_swaymsg
+++ b/completions/zsh/_swaymsg
@@ -28,8 +28,10 @@ types=(
28) 28)
29 29
30_arguments -s \ 30_arguments -s \
31 '(-v --version)'{-v,--version}'[Print the version (of swaymsg) and quit]' \ 31 '(-v --version)'{-v,--version}'[Show the version number and quit]' \
32 '(-h --help)'{-h,--help}'[Shows help message]' \ 32 '(-m --monitor)'{-m,--monitor}'[Monitor until killed (-t SUBSCRIBE only)]' \
33 '(-q --quiet)'{-q,--quiet}'[Sends the IPC message but does not print the response from sway]' \ 33 '(-h --help)'{-h,--help}'[Show help message and quit]' \
34 '(-s --socket)'{-s,--socket}'[Use the specified socket path.]:files:_files' \ 34 '(-q --quiet)'{-q,--quiet}'[Be quiet]' \
35 '(-t --type)'{-t,--type}'[Specify the type of IPC message.]:type:{_describe "type" types}' 35 '(-r --raw)'{-r,--raw}'[Use raw output even if using a tty]' \
36 '(-s --socket)'{-s,--socket}'[Use the specified socket path]:files:_files' \
37 '(-t --type)'{-t,--type}'[Specify the message type]:type:{_describe "type" types}'
diff --git a/include/sway/commands.h b/include/sway/commands.h
index 0e2d7931..7d0ff838 100644
--- a/include/sway/commands.h
+++ b/include/sway/commands.h
@@ -172,6 +172,7 @@ sway_cmd cmd_swaybg_command;
172sway_cmd cmd_swaynag_command; 172sway_cmd cmd_swaynag_command;
173sway_cmd cmd_swap; 173sway_cmd cmd_swap;
174sway_cmd cmd_tiling_drag; 174sway_cmd cmd_tiling_drag;
175sway_cmd cmd_tiling_drag_threshold;
175sway_cmd cmd_title_align; 176sway_cmd cmd_title_align;
176sway_cmd cmd_title_format; 177sway_cmd cmd_title_format;
177sway_cmd cmd_titlebar_border_thickness; 178sway_cmd cmd_titlebar_border_thickness;
diff --git a/include/sway/config.h b/include/sway/config.h
index f604b054..ebf16e6a 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -426,7 +426,9 @@ struct sway_config {
426 bool auto_back_and_forth; 426 bool auto_back_and_forth;
427 bool show_marks; 427 bool show_marks;
428 enum alignment title_align; 428 enum alignment title_align;
429
429 bool tiling_drag; 430 bool tiling_drag;
431 int tiling_drag_threshold;
430 432
431 bool smart_gaps; 433 bool smart_gaps;
432 int gaps_inner; 434 int gaps_inner;
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h
index 78489e21..22e278b0 100644
--- a/include/sway/input/cursor.h
+++ b/include/sway/input/cursor.h
@@ -61,6 +61,8 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat);
61void cursor_rebase(struct sway_cursor *cursor); 61void cursor_rebase(struct sway_cursor *cursor);
62 62
63void cursor_handle_activity(struct sway_cursor *cursor); 63void cursor_handle_activity(struct sway_cursor *cursor);
64void cursor_unhide(struct sway_cursor *cursor);
65int cursor_get_timeout(struct sway_cursor *cursor);
64 66
65/** 67/**
66 * Like cursor_rebase, but also allows focus to change when the cursor enters a 68 * Like cursor_rebase, but also allows focus to change when the cursor enters a
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index d665c86e..a3c20346 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -39,6 +39,7 @@ enum sway_seat_operation {
39 OP_NONE, 39 OP_NONE,
40 OP_DOWN, 40 OP_DOWN,
41 OP_MOVE_FLOATING, 41 OP_MOVE_FLOATING,
42 OP_MOVE_TILING_THRESHOLD,
42 OP_MOVE_TILING, 43 OP_MOVE_TILING,
43 OP_RESIZE_FLOATING, 44 OP_RESIZE_FLOATING,
44 OP_RESIZE_TILING, 45 OP_RESIZE_TILING,
@@ -186,6 +187,9 @@ void seat_begin_down(struct sway_seat *seat, struct sway_container *con,
186void seat_begin_move_floating(struct sway_seat *seat, 187void seat_begin_move_floating(struct sway_seat *seat,
187 struct sway_container *con, uint32_t button); 188 struct sway_container *con, uint32_t button);
188 189
190void seat_begin_move_tiling_threshold(struct sway_seat *seat,
191 struct sway_container *con, uint32_t button);
192
189void seat_begin_move_tiling(struct sway_seat *seat, 193void seat_begin_move_tiling(struct sway_seat *seat,
190 struct sway_container *con, uint32_t button); 194 struct sway_container *con, uint32_t button);
191 195
diff --git a/sway/commands.c b/sway/commands.c
index cd595b03..4e524a88 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -87,6 +87,7 @@ static struct cmd_handler handlers[] = {
87 { "smart_borders", cmd_smart_borders }, 87 { "smart_borders", cmd_smart_borders },
88 { "smart_gaps", cmd_smart_gaps }, 88 { "smart_gaps", cmd_smart_gaps },
89 { "tiling_drag", cmd_tiling_drag }, 89 { "tiling_drag", cmd_tiling_drag },
90 { "tiling_drag_threshold", cmd_tiling_drag_threshold },
90 { "title_align", cmd_title_align }, 91 { "title_align", cmd_title_align },
91 { "titlebar_border_thickness", cmd_titlebar_border_thickness }, 92 { "titlebar_border_thickness", cmd_titlebar_border_thickness },
92 { "titlebar_padding", cmd_titlebar_padding }, 93 { "titlebar_padding", cmd_titlebar_padding },
diff --git a/sway/commands/seat/cursor.c b/sway/commands/seat/cursor.c
index 495c2338..b4728543 100644
--- a/sway/commands/seat/cursor.c
+++ b/sway/commands/seat/cursor.c
@@ -17,18 +17,8 @@ static const char *expected_syntax = "Expected 'cursor <move> <x> <y>' or "
17 "'cursor <set> <x> <y>' or " 17 "'cursor <set> <x> <y>' or "
18 "'curor <press|release> <left|right|1|2|3...>'"; 18 "'curor <press|release> <left|right|1|2|3...>'";
19 19
20struct cmd_results *seat_cmd_cursor(int argc, char **argv) { 20static struct cmd_results *handle_command(struct sway_cursor *cursor,
21 struct cmd_results *error = NULL; 21 int argc, char **argv) {
22 if ((error = checkarg(argc, "cursor", EXPECTED_AT_LEAST, 2))) {
23 return error;
24 }
25 struct sway_seat *seat = config->handler_context.seat;
26 if (!seat) {
27 return cmd_results_new(CMD_FAILURE, "cursor", "No seat defined");
28 }
29
30 struct sway_cursor *cursor = seat->cursor;
31
32 if (strcasecmp(argv[0], "move") == 0) { 22 if (strcasecmp(argv[0], "move") == 0) {
33 if (argc < 3) { 23 if (argc < 3) {
34 return cmd_results_new(CMD_INVALID, "cursor", expected_syntax); 24 return cmd_results_new(CMD_INVALID, "cursor", expected_syntax);
@@ -50,6 +40,7 @@ struct cmd_results *seat_cmd_cursor(int argc, char **argv) {
50 if (argc < 2) { 40 if (argc < 2) {
51 return cmd_results_new(CMD_INVALID, "cursor", expected_syntax); 41 return cmd_results_new(CMD_INVALID, "cursor", expected_syntax);
52 } 42 }
43 struct cmd_results *error = NULL;
53 if ((error = press_or_release(cursor, argv[0], argv[1]))) { 44 if ((error = press_or_release(cursor, argv[0], argv[1]))) {
54 return error; 45 return error;
55 } 46 }
@@ -58,6 +49,40 @@ struct cmd_results *seat_cmd_cursor(int argc, char **argv) {
58 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 49 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
59} 50}
60 51
52struct cmd_results *seat_cmd_cursor(int argc, char **argv) {
53 struct cmd_results *error = NULL;
54 if ((error = checkarg(argc, "cursor", EXPECTED_AT_LEAST, 2))) {
55 return error;
56 }
57 struct seat_config *sc = config->handler_context.seat_config;
58 if (!sc) {
59 return cmd_results_new(CMD_FAILURE, "cursor", "No seat defined");
60 }
61
62 if (config->reading || !config->active) {
63 return cmd_results_new(CMD_DEFER, NULL, NULL);
64 }
65
66 if (strcmp(sc->name, "*") != 0) {
67 struct sway_seat *seat = input_manager_get_seat(sc->name);
68 if (!seat) {
69 return cmd_results_new(CMD_FAILURE, "cursor",
70 "Failed to get seat");
71 }
72 error = handle_command(seat->cursor, argc, argv);
73 } else {
74 struct sway_seat *seat = NULL;
75 wl_list_for_each(seat, &server.input->seats, link) {
76 error = handle_command(seat->cursor, argc, argv);
77 if ((error && error->status != CMD_SUCCESS)) {
78 break;
79 }
80 }
81 }
82
83 return error ? error : cmd_results_new(CMD_SUCCESS, NULL, NULL);
84}
85
61static struct cmd_results *press_or_release(struct sway_cursor *cursor, 86static struct cmd_results *press_or_release(struct sway_cursor *cursor,
62 char *action, char *button_str) { 87 char *action, char *button_str) {
63 enum wlr_button_state state; 88 enum wlr_button_state state;
diff --git a/sway/commands/tiling_drag_threshold.c b/sway/commands/tiling_drag_threshold.c
new file mode 100644
index 00000000..6b0531c3
--- /dev/null
+++ b/sway/commands/tiling_drag_threshold.c
@@ -0,0 +1,22 @@
1#include <string.h>
2#include "sway/commands.h"
3#include "sway/config.h"
4#include "log.h"
5
6struct cmd_results *cmd_tiling_drag_threshold(int argc, char **argv) {
7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "tiling_drag_threshold", EXPECTED_EQUAL_TO, 1))) {
9 return error;
10 }
11
12 char *inv;
13 int value = strtol(argv[0], &inv, 10);
14 if (*inv != '\0' || value < 0) {
15 return cmd_results_new(CMD_INVALID, "tiling_drag_threshold",
16 "Invalid threshold specified");
17 }
18
19 config->tiling_drag_threshold = value;
20
21 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
22}
diff --git a/sway/config.c b/sway/config.c
index 9f32d44c..8a0b293c 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -232,6 +232,7 @@ static void config_defaults(struct sway_config *config) {
232 config->show_marks = true; 232 config->show_marks = true;
233 config->title_align = ALIGN_LEFT; 233 config->title_align = ALIGN_LEFT;
234 config->tiling_drag = true; 234 config->tiling_drag = true;
235 config->tiling_drag_threshold = 9;
235 236
236 config->smart_gaps = false; 237 config->smart_gaps = false;
237 config->gaps_inner = 0; 238 config->gaps_inner = 0;
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 14881e96..6c9fe23c 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -1017,7 +1017,7 @@ void output_render(struct sway_output *output, struct timespec *when,
1017 if (fullscreen_con->view) { 1017 if (fullscreen_con->view) {
1018 if (fullscreen_con->view->saved_buffer) { 1018 if (fullscreen_con->view->saved_buffer) {
1019 render_saved_view(fullscreen_con->view, output, damage, 1.0f); 1019 render_saved_view(fullscreen_con->view, output, damage, 1.0f);
1020 } else { 1020 } else if (fullscreen_con->view->surface) {
1021 render_view_toplevels(fullscreen_con->view, 1021 render_view_toplevels(fullscreen_con->view,
1022 output, damage, 1.0f); 1022 output, damage, 1.0f);
1023 } 1023 }
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index bf0038b4..f46938e2 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -363,7 +363,7 @@ static void transaction_progress_queue(void) {
363 363
364static int handle_timeout(void *data) { 364static int handle_timeout(void *data) {
365 struct sway_transaction *transaction = data; 365 struct sway_transaction *transaction = data;
366 wlr_log(WLR_DEBUG, "Transaction %p timed out (%li waiting)", 366 wlr_log(WLR_DEBUG, "Transaction %p timed out (%zi waiting)",
367 transaction, transaction->num_waiting); 367 transaction, transaction->num_waiting);
368 transaction->num_waiting = 0; 368 transaction->num_waiting = 0;
369 transaction_progress_queue(); 369 transaction_progress_queue();
@@ -472,7 +472,7 @@ static void set_instruction_ready(
472 struct timespec *start = &transaction->commit_time; 472 struct timespec *start = &transaction->commit_time;
473 float ms = (now.tv_sec - start->tv_sec) * 1000 + 473 float ms = (now.tv_sec - start->tv_sec) * 1000 +
474 (now.tv_nsec - start->tv_nsec) / 1000000.0; 474 (now.tv_nsec - start->tv_nsec) / 1000000.0;
475 wlr_log(WLR_DEBUG, "Transaction %p: %li/%li ready in %.1fms (%s)", 475 wlr_log(WLR_DEBUG, "Transaction %p: %zi/%zi ready in %.1fms (%s)",
476 transaction, 476 transaction,
477 transaction->num_configures - transaction->num_waiting + 1, 477 transaction->num_configures - transaction->num_waiting + 1,
478 transaction->num_configures, ms, 478 transaction->num_configures, ms,
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index f8302ddf..510030ae 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -384,6 +384,30 @@ static void handle_move_tiling_motion(struct sway_seat *seat,
384 desktop_damage_box(&seat->op_drop_box); 384 desktop_damage_box(&seat->op_drop_box);
385} 385}
386 386
387static void handle_move_tiling_threshold_motion(struct sway_seat *seat,
388 struct sway_cursor *cursor) {
389 double cx = seat->cursor->cursor->x;
390 double cy = seat->cursor->cursor->y;
391 double sx = seat->op_ref_lx;
392 double sy = seat->op_ref_ly;
393
394 // Get the scaled threshold for the output. Even if the operation goes
395 // across multiple outputs of varying scales, just use the scale for the
396 // output that the cursor is currently on for simplicity.
397 struct wlr_output *wlr_output = wlr_output_layout_output_at(
398 root->output_layout, cx, cy);
399 double output_scale = wlr_output ? wlr_output->scale : 1;
400 double threshold = config->tiling_drag_threshold * output_scale;
401 threshold *= threshold;
402
403 // If the threshold has been exceeded, start the actual drag
404 if ((cx - sx) * (cx - sx) + (cy - sy) * (cy - sy) > threshold) {
405 seat->operation = OP_MOVE_TILING;
406 cursor_set_image(cursor, "grab", NULL);
407 handle_move_tiling_motion(seat, cursor);
408 }
409}
410
387static void calculate_floating_constraints(struct sway_container *con, 411static void calculate_floating_constraints(struct sway_container *con,
388 int *min_width, int *max_width, int *min_height, int *max_height) { 412 int *min_width, int *max_width, int *min_height, int *max_height) {
389 if (config->floating_minimum_width == -1) { // no minimum 413 if (config->floating_minimum_width == -1) { // no minimum
@@ -597,7 +621,7 @@ static int hide_notify(void *data) {
597 return 1; 621 return 1;
598} 622}
599 623
600void cursor_handle_activity(struct sway_cursor *cursor) { 624int cursor_get_timeout(struct sway_cursor *cursor){
601 struct seat_config *sc = seat_get_config(cursor->seat); 625 struct seat_config *sc = seat_get_config(cursor->seat);
602 if (!sc) { 626 if (!sc) {
603 sc = seat_get_config_by_name("*"); 627 sc = seat_get_config_by_name("*");
@@ -606,20 +630,31 @@ void cursor_handle_activity(struct sway_cursor *cursor) {
606 if (timeout < 0) { 630 if (timeout < 0) {
607 timeout = 0; 631 timeout = 0;
608 } 632 }
609 wl_event_source_timer_update(cursor->hide_source, timeout); 633 return timeout;
634}
635
636void cursor_handle_activity(struct sway_cursor *cursor) {
637 wl_event_source_timer_update(
638 cursor->hide_source, cursor_get_timeout(cursor));
610 639
611 wlr_idle_notify_activity(server.idle, cursor->seat->wlr_seat); 640 wlr_idle_notify_activity(server.idle, cursor->seat->wlr_seat);
612 if (cursor->hidden) { 641 if (cursor->hidden) {
613 cursor->hidden = false; 642 cursor_unhide(cursor);
614 if (cursor->image_surface) { 643 }
615 cursor_set_image_surface(cursor, cursor->image_surface, 644}
616 cursor->hotspot_x, cursor->hotspot_y, 645
617 cursor->image_client); 646void cursor_unhide(struct sway_cursor *cursor) {
618 } else { 647 cursor->hidden = false;
619 const char *image = cursor->image; 648 if (cursor->image_surface) {
620 cursor->image = NULL; 649 cursor_set_image_surface(cursor,
621 cursor_set_image(cursor, image, cursor->image_client); 650 cursor->image_surface,
622 } 651 cursor->hotspot_x,
652 cursor->hotspot_y,
653 cursor->image_client);
654 } else {
655 const char *image = cursor->image;
656 cursor->image = NULL;
657 cursor_set_image(cursor, image, cursor->image_client);
623 } 658 }
624} 659}
625 660
@@ -640,6 +675,9 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor,
640 case OP_MOVE_FLOATING: 675 case OP_MOVE_FLOATING:
641 handle_move_floating_motion(seat, cursor); 676 handle_move_floating_motion(seat, cursor);
642 break; 677 break;
678 case OP_MOVE_TILING_THRESHOLD:
679 handle_move_tiling_threshold_motion(seat, cursor);
680 break;
643 case OP_MOVE_TILING: 681 case OP_MOVE_TILING:
644 handle_move_tiling_motion(seat, cursor); 682 handle_move_tiling_motion(seat, cursor);
645 break; 683 break;
@@ -984,12 +1022,21 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
984 if (config->tiling_drag && (mod_pressed || on_titlebar) && 1022 if (config->tiling_drag && (mod_pressed || on_titlebar) &&
985 state == WLR_BUTTON_PRESSED && !is_floating_or_child && 1023 state == WLR_BUTTON_PRESSED && !is_floating_or_child &&
986 cont && !cont->is_fullscreen) { 1024 cont && !cont->is_fullscreen) {
987 if (on_titlebar) { 1025 struct sway_container *focus = seat_get_focused_container(seat);
1026 bool focused = focus == cont || container_has_ancestor(focus, cont);
1027 if (on_titlebar && !focused) {
988 node = seat_get_focus_inactive(seat, &cont->node); 1028 node = seat_get_focus_inactive(seat, &cont->node);
989 seat_set_focus(seat, node); 1029 seat_set_focus(seat, node);
990 } 1030 }
1031
991 seat_pointer_notify_button(seat, time_msec, button, state); 1032 seat_pointer_notify_button(seat, time_msec, button, state);
992 seat_begin_move_tiling(seat, cont, button); 1033
1034 // If moving a container by it's title bar, use a threshold for the drag
1035 if (!mod_pressed && config->tiling_drag_threshold > 0) {
1036 seat_begin_move_tiling_threshold(seat, cont, button);
1037 } else {
1038 seat_begin_move_tiling(seat, cont, button);
1039 }
993 return; 1040 return;
994 } 1041 }
995 1042
diff --git a/sway/input/seat.c b/sway/input/seat.c
index fa82c9ce..52790039 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1052,6 +1052,17 @@ void seat_begin_move_floating(struct sway_seat *seat,
1052 cursor_set_image(seat->cursor, "grab", NULL); 1052 cursor_set_image(seat->cursor, "grab", NULL);
1053} 1053}
1054 1054
1055void seat_begin_move_tiling_threshold(struct sway_seat *seat,
1056 struct sway_container *con, uint32_t button) {
1057 seat->operation = OP_MOVE_TILING_THRESHOLD;
1058 seat->op_container = con;
1059 seat->op_button = button;
1060 seat->op_target_node = NULL;
1061 seat->op_target_edge = 0;
1062 seat->op_ref_lx = seat->cursor->cursor->x;
1063 seat->op_ref_ly = seat->cursor->cursor->y;
1064}
1065
1055void seat_begin_move_tiling(struct sway_seat *seat, 1066void seat_begin_move_tiling(struct sway_seat *seat,
1056 struct sway_container *con, uint32_t button) { 1067 struct sway_container *con, uint32_t button) {
1057 seat->operation = OP_MOVE_TILING; 1068 seat->operation = OP_MOVE_TILING;
@@ -1220,4 +1231,8 @@ void seat_consider_warp_to_focus(struct sway_seat *seat) {
1220 } else { 1231 } else {
1221 cursor_warp_to_workspace(seat->cursor, focus->sway_workspace); 1232 cursor_warp_to_workspace(seat->cursor, focus->sway_workspace);
1222 } 1233 }
1234 if (seat->cursor->hidden){
1235 cursor_unhide(seat->cursor);
1236 wl_event_source_timer_update(seat->cursor->hide_source, cursor_get_timeout(seat->cursor));
1237 }
1223} 1238}
diff --git a/sway/meson.build b/sway/meson.build
index 7f739287..98676ce0 100644
--- a/sway/meson.build
+++ b/sway/meson.build
@@ -89,6 +89,7 @@ sway_sources = files(
89 'commands/swaynag_command.c', 89 'commands/swaynag_command.c',
90 'commands/swap.c', 90 'commands/swap.c',
91 'commands/tiling_drag.c', 91 'commands/tiling_drag.c',
92 'commands/tiling_drag_threshold.c',
92 'commands/title_align.c', 93 'commands/title_align.c',
93 'commands/title_format.c', 94 'commands/title_format.c',
94 'commands/titlebar_border_thickness.c', 95 'commands/titlebar_border_thickness.c',
diff --git a/sway/server.c b/sway/server.c
index b1d7d3fc..13264a2c 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -7,6 +7,7 @@
7#include <wlr/backend/session.h> 7#include <wlr/backend/session.h>
8#include <wlr/render/wlr_renderer.h> 8#include <wlr/render/wlr_renderer.h>
9#include <wlr/types/wlr_compositor.h> 9#include <wlr/types/wlr_compositor.h>
10#include <wlr/types/wlr_data_control_v1.h>
10#include <wlr/types/wlr_export_dmabuf_v1.h> 11#include <wlr/types/wlr_export_dmabuf_v1.h>
11#include <wlr/types/wlr_gamma_control_v1.h> 12#include <wlr/types/wlr_gamma_control_v1.h>
12#include <wlr/types/wlr_gamma_control.h> 13#include <wlr/types/wlr_gamma_control.h>
@@ -140,6 +141,7 @@ bool server_init(struct sway_server *server) {
140 141
141 wlr_export_dmabuf_manager_v1_create(server->wl_display); 142 wlr_export_dmabuf_manager_v1_create(server->wl_display);
142 wlr_screencopy_manager_v1_create(server->wl_display); 143 wlr_screencopy_manager_v1_create(server->wl_display);
144 wlr_data_control_manager_v1_create(server->wl_display);
143 145
144 server->socket = wl_display_add_socket_auto(server->wl_display); 146 server->socket = wl_display_add_socket_auto(server->wl_display);
145 if (!server->socket) { 147 if (!server->socket) {
diff --git a/sway/sway-output.5.scd b/sway/sway-output.5.scd
index 9940d8e8..28524478 100644
--- a/sway/sway-output.5.scd
+++ b/sway/sway-output.5.scd
@@ -38,17 +38,20 @@ must be separated by one space. For example:
38 Places the specified output at the specific position in the global 38 Places the specified output at the specific position in the global
39 coordinate space. If scaling is active, it has to be considered when 39 coordinate space. If scaling is active, it has to be considered when
40 positioning. For example, if the scaling factor for the left output is 2, 40 positioning. For example, if the scaling factor for the left output is 2,
41 the relative position for the right output has to be divided by 2. 41 the relative position for the right output has to be divided by 2. The
42 reference point is the top left corner so if you want the bottoms aligned
43 this has to be considered as well.
42 44
43 Example: 45 Example:
44 46
45 output HDMI1 scale 2 47 output HDMI1 scale 2
46 48
47 output HDMI1 pos 0 0 res 3200x1800 49 output HDMI1 pos 0 1020 res 3200x1800
48 50
49 output eDP1 pos 1600 0 res 1920x1080 51 output eDP1 pos 1600 0 res 1920x1080
50 52
51 Note that the x-pos of eDP1 is 1600 = 3200/2. 53 Note that the left x-pos of eDP1 is 1600 = 3200/2 and the bottom y-pos is
54 1020 + (1800 / 2) = 1920 = 0 + 1920
52 55
53*output* <name> scale <factor> 56*output* <name> scale <factor>
54 Scales the specified output by the specified scale _factor_. An integer is 57 Scales the specified output by the specified scale _factor_. An integer is
@@ -57,7 +60,8 @@ must be separated by one space. For example:
57 represent the contents of your windows - they will be rendered at the next 60 represent the contents of your windows - they will be rendered at the next
58 highest integral scale factor and downscaled. You may be better served by 61 highest integral scale factor and downscaled. You may be better served by
59 setting an integral scale factor and adjusting the font size of your 62 setting an integral scale factor and adjusting the font size of your
60 applications to taste. 63 applications to taste. HiDPI isn't supported with Xwayland clients (windows
64 will blur).
61 65
62*output* <name> background|bg <file> <mode> [<fallback\_color>] 66*output* <name> background|bg <file> <mode> [<fallback\_color>]
63 Sets the wallpaper for the given output to the specified file, using the 67 Sets the wallpaper for the given output to the specified file, using the
diff --git a/sway/sway.5.scd b/sway/sway.5.scd
index e6abef56..3757a097 100644
--- a/sway/sway.5.scd
+++ b/sway/sway.5.scd
@@ -327,7 +327,8 @@ runtime.
327 A view that does not have focus. 327 A view that does not have focus.
328 328
329 *client.urgent* 329 *client.urgent*
330 A view with an urgency hint. *Note*: This is not currently implemented. 330 A view with an urgency hint. *Note*: Native Wayland windows do not
331 support urgency. Urgency only works for Xwayland windows.
331 332
332 The meaning of each color is: 333 The meaning of each color is:
333 334
@@ -431,7 +432,7 @@ The default colors are:
431 432
432*focus\_follows\_mouse* yes|no|always 433*focus\_follows\_mouse* yes|no|always
433 If set to _yes_, moving your mouse over a window will focus that window. If 434 If set to _yes_, moving your mouse over a window will focus that window. If
434 set to _always_, the window under the cursor will always be focused, even 435 set to _always_, the window under the cursor will always be focused, even
435 after switching between workspaces. 436 after switching between workspaces.
436 437
437*focus\_wrapping* yes|no|force 438*focus\_wrapping* yes|no|force
@@ -450,11 +451,11 @@ The default colors are:
450 Thickness of the titlebar border in pixels 451 Thickness of the titlebar border in pixels
451 452
452*titlebar\_padding* <horizontal> [<vertical>] 453*titlebar\_padding* <horizontal> [<vertical>]
453 Padding of the text in the titlebar. _horizontal_ value affects horizontal 454 Padding of the text in the titlebar. _horizontal_ value affects horizontal
454 padding of the text while _vertical_ value affects vertical padding (space 455 padding of the text while _vertical_ value affects vertical padding (space
455 above and below text). Padding includes titlebar borders so their value 456 above and below text). Padding includes titlebar borders so their value
456 should be greater than titlebar\_border\_thickness. If _vertical_ value is 457 should be greater than titlebar\_border\_thickness. If _vertical_ value is
457 not specified it is set to the _horizontal_ value. 458 not specified it is set to the _horizontal_ value.
458 459
459*for\_window* <criteria> <command> 460*for\_window* <criteria> <command>
460 Whenever a window that matches _criteria_ appears, run list of commands. 461 Whenever a window that matches _criteria_ appears, run list of commands.
@@ -572,6 +573,14 @@ The default colors are:
572 the _floating\_mod_ will also allow the container to be dragged. _toggle_ 573 the _floating\_mod_ will also allow the container to be dragged. _toggle_
573 should not be used in the config file. 574 should not be used in the config file.
574 575
576*tiling\_drag\_threshold* <threshold>
577 Sets the threshold that must be exceeded for a container to be dragged by
578 its titlebar. This has no effect if _floating\_mod_ is used or if
579 _tiling\_drag_ is set to _disable_. Once the threshold has been exceeded
580 once, the drag starts and the cursor can come back inside the threshold
581 without stopping the drag. _threshold_ is multiplied by the scale of the
582 output that the cursor on. The default is 9.
583
575*title\_align* left|center|right 584*title\_align* left|center|right
576 Sets the title alignment. If _right_ is selected and _show\_marks_ is set 585 Sets the title alignment. If _right_ is selected and _show\_marks_ is set
577 to _yes_, the marks will be shown on the _left_ side instead of the 586 to _yes_, the marks will be shown on the _left_ side instead of the
diff --git a/sway/tree/view.c b/sway/tree/view.c
index deb20676..5371ee20 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -654,14 +654,8 @@ void view_unmap(struct sway_view *view) {
654 654
655 struct sway_seat *seat; 655 struct sway_seat *seat;
656 wl_list_for_each(seat, &server.input->seats, link) { 656 wl_list_for_each(seat, &server.input->seats, link) {
657 if (config->mouse_warping == WARP_CONTAINER) { 657 seat->cursor->image_surface = NULL;
658 struct sway_node *node = seat_get_focus(seat); 658 seat_consider_warp_to_focus(seat);
659 if (node && node->type == N_CONTAINER) {
660 cursor_warp_to_container(seat->cursor, node->sway_container);
661 } else if (node && node->type == N_WORKSPACE) {
662 cursor_warp_to_workspace(seat->cursor, node->sway_workspace);
663 }
664 }
665 } 659 }
666 660
667 transaction_commit_dirty(); 661 transaction_commit_dirty();
diff --git a/swayidle/main.c b/swayidle/main.c
index 9a76e58c..41eecc41 100644
--- a/swayidle/main.c
+++ b/swayidle/main.c
@@ -1,6 +1,7 @@
1#define _POSIX_C_SOURCE 200809L 1#define _POSIX_C_SOURCE 200809L
2#include <assert.h> 2#include <assert.h>
3#include <errno.h> 3#include <errno.h>
4#include <fcntl.h>
4#include <getopt.h> 5#include <getopt.h>
5#include <pthread.h> 6#include <pthread.h>
6#include <signal.h> 7#include <signal.h>
@@ -104,9 +105,21 @@ static void acquire_sleep_lock(void) {
104 if (ret < 0) { 105 if (ret < 0) {
105 wlr_log(WLR_ERROR, "Failed to parse D-Bus response for Inhibit: %s", 106 wlr_log(WLR_ERROR, "Failed to parse D-Bus response for Inhibit: %s",
106 strerror(-ret)); 107 strerror(-ret));
108 sd_bus_error_free(&error);
109 sd_bus_message_unref(msg);
110 return;
107 } else { 111 } else {
108 wlr_log(WLR_INFO, "Got sleep lock: %d", lock_fd); 112 wlr_log(WLR_INFO, "Got sleep lock: %d", lock_fd);
109 } 113 }
114
115 // sd_bus_message_unref closes the file descriptor so we need
116 // to copy it beforehand
117 lock_fd = fcntl(lock_fd, F_DUPFD_CLOEXEC, 3);
118 if (lock_fd < 0) {
119 wlr_log(WLR_ERROR, "Failed to copy sleep lock fd: %s",
120 strerror(errno));
121 }
122
110 sd_bus_error_free(&error); 123 sd_bus_error_free(&error);
111 sd_bus_message_unref(msg); 124 sd_bus_message_unref(msg);
112} 125}
diff --git a/swaylock/password.c b/swaylock/password.c
index 3059203a..3bd113ad 100644
--- a/swaylock/password.c
+++ b/swaylock/password.c
@@ -146,14 +146,6 @@ void swaylock_handle_key(struct swaylock_state *state,
146 schedule_indicator_clear(state); 146 schedule_indicator_clear(state);
147 break; 147 break;
148 case XKB_KEY_Caps_Lock: 148 case XKB_KEY_Caps_Lock:
149 /* The state is getting active after this
150 * so we need to manually toggle it */
151 state->xkb.caps_lock = !state->xkb.caps_lock;
152 state->auth_state = AUTH_STATE_INPUT_NOP;
153 damage_state(state);
154 schedule_indicator_clear(state);
155 schedule_password_clear(state);
156 break;
157 case XKB_KEY_Shift_L: 149 case XKB_KEY_Shift_L:
158 case XKB_KEY_Shift_R: 150 case XKB_KEY_Shift_R:
159 case XKB_KEY_Control_L: 151 case XKB_KEY_Control_L:
diff --git a/swaylock/seat.c b/swaylock/seat.c
index 7b72114f..f0b1385e 100644
--- a/swaylock/seat.c
+++ b/swaylock/seat.c
@@ -63,8 +63,12 @@ static void keyboard_modifiers(void *data, struct wl_keyboard *wl_keyboard,
63 struct swaylock_state *state = data; 63 struct swaylock_state *state = data;
64 xkb_state_update_mask(state->xkb.state, 64 xkb_state_update_mask(state->xkb.state,
65 mods_depressed, mods_latched, mods_locked, 0, 0, group); 65 mods_depressed, mods_latched, mods_locked, 0, 0, group);
66 state->xkb.caps_lock = xkb_state_mod_name_is_active(state->xkb.state, 66 int caps_lock = xkb_state_mod_name_is_active(state->xkb.state,
67 XKB_MOD_NAME_CAPS, XKB_STATE_MODS_LOCKED); 67 XKB_MOD_NAME_CAPS, XKB_STATE_MODS_LOCKED);
68 if (caps_lock != state->xkb.caps_lock) {
69 state->xkb.caps_lock = caps_lock;
70 damage_state(state);
71 }
68 state->xkb.control = xkb_state_mod_name_is_active(state->xkb.state, 72 state->xkb.control = xkb_state_mod_name_is_active(state->xkb.state,
69 XKB_MOD_NAME_CTRL, 73 XKB_MOD_NAME_CTRL,
70 XKB_STATE_MODS_DEPRESSED | XKB_STATE_MODS_LATCHED); 74 XKB_STATE_MODS_DEPRESSED | XKB_STATE_MODS_LATCHED);