aboutsummaryrefslogtreecommitdiff
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 @@
# sway
-"**S**irCmpwn's **Way**land compositor" е в процес на разработка, съвместим с i3, [Wayland](http://wayland.freedesktop.org/) композитор.
-Прочетете [FAQ](https://github.com/swaywm/sway/wiki). Присъединете се в
-[IRC канала](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на
+Sway е в процес на разработка, съвместим с i3,
+[Wayland](http://wayland.freedesktop.org/) композитор. Прочетете
+[FAQ](https://github.com/swaywm/sway/wiki). Присъединете се в [IRC
+канала](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на
irc.freenode.net).
[![](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 @@
Der Fortschritt dieser Übersetzung kann [hier](https://github.com/swaywm/sway/issues/1318)
eingesehen werden.
-"**S**irCmpwn's **Way**land compositor" ist ein i3-kompatibler
-[Wayland](http://wayland.freedesktop.org/)-Kompositor. Lies die
-[FAQ](https://github.com/swaywm/sway/wiki#faq). Tritt dem
-[IRC-Channel](http://webchat.freenode.net/?channels=sway&uio=d4) bei (#sway in irc.freenode.net).
+Sway ist ein i3-kompatibler
+[Wayland](http://wayland.freedesktop.org/)-Kompositor. Lies die
+[FAQ](https://github.com/swaywm/sway/wiki#faq). Tritt dem
+[IRC-Channel](http://webchat.freenode.net/?channels=sway&uio=d4) bei (#sway in
+irc.freenode.net).
[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png)
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 @@
# sway
-"Ο Sway (**S**irCmpwn's **Way**land) είναι ένας **υπό ανάπτυξη** [Wayland](http://wayland.freedesktop.org/) διαχειριστής παραθύρων συμβατός με τον αντίστοιχο διαχειριστή παραθύρων i3 για τον X11.
+Sway είναι ένας **υπό ανάπτυξη** [Wayland](http://wayland.freedesktop.org/) διαχειριστής παραθύρων συμβατός με τον αντίστοιχο διαχειριστή παραθύρων i3 για τον X11.
Διαβάστε τις [Συνήθεις Ερωτήσεις](https://github.com/swaywm/sway/wiki). Συνδεθείτε στο [κανάλι μας στο IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway στο
irc.freenode.net).
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 @@
# sway
-"**S**irCmpwn's **Way**land compositor" est un compositeur [Wayland](http://wayland.freedesktop.org/)
-compatible avec i3, **en cours de développement**.
-Lisez la [FAQ](https://github.com/swaywm/sway/wiki). Rejoignez le
-[canal IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway sur
+Sway est un compositeur [Wayland](http://wayland.freedesktop.org/) compatible
+avec i3, **en cours de développement**. Lisez la
+[FAQ](https://github.com/swaywm/sway/wiki). Rejoignez le [canal
+IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway sur
irc.freenode.net).
[![](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 @@
# sway
-"**S**irCmpwn's **Way**land compositor" è un compositor
-[Wayland](http://wayland.freedesktop.org/) **in via di sviluppo**
-compatibile con i3.
-Leggi le [FAQ (in Inglese)](https://github.com/swaywm/sway/wiki). Unisciti al
-[canale IRC (in Inglese)](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
+Sway è un compositor [Wayland](http://wayland.freedesktop.org/) **in via di
+sviluppo** compatibile con i3. Leggi le [FAQ (in
+Inglese)](https://github.com/swaywm/sway/wiki). Unisciti al [canale IRC (in
+Inglese)](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
irc.freenode.net).
[![](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 @@
# sway
-"**S**irCmpwn's **Way**land compositor"は**開発中**の
-i3互換な[Wayland](http://wayland.freedesktop.org/)コンポジタです。
+Swayは**開発中**のi3互換な[Wayland](http://wayland.freedesktop.org/)コンポジタです。
[FAQ](https://github.com/swaywm/sway/wiki)も合わせてご覧ください。
[IRC チャンネル](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on irc.freenode.net)もあります。
diff --git a/README.md b/README.md
index 6cb212fc..1deb9a4c 100644
--- a/README.md
+++ b/README.md
@@ -3,10 +3,10 @@
[**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--) -
[Русский](https://github.com/swaywm/sway/blob/master/README.ru.md#sway--) - [Български](https://github.com/swaywm/sway/blob/master/README.bg.md#sway--)
-"**S**irCmpwn's **Way**land compositor" is a **work in progress**
-i3-compatible [Wayland](http://wayland.freedesktop.org/) compositor.
-Read the [FAQ](https://github.com/swaywm/sway/wiki). Join the
-[IRC channel](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
+sway is a **work in progress** i3-compatible
+[Wayland](http://wayland.freedesktop.org/) compositor. Read the
+[FAQ](https://github.com/swaywm/sway/wiki). Join the [IRC
+channel](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
irc.freenode.net).
If 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 @@
# sway
-"**S**irCmpwn's **Way**land compositor" é um compositor [Wayland](http://wayland.freedesktop.org/)
-compatível com o i3. Leia o [FAQ](https://github.com/swaywm/sway/wiki). Participe do
-[canal IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway no
+Sway é um compositor [Wayland](http://wayland.freedesktop.org/) compatível com o
+i3. Leia o [FAQ](https://github.com/swaywm/sway/wiki). Participe do [canal
+IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway no
irc.freenode.net).
[![](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 @@
# sway
-"**S**irCmpwn's **Way**land compositor" на данный момент **(в разработке)**
-i3-совместимый [Wayland](http://wayland.freedesktop.org/) композитор.
-Прочитайте [FAQ](https://github.com/swaywm/sway/wiki). Присоединяйтесь к
-[IRC каналу](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на
+Sway на данный момент **(в разработке)** i3-совместимый
+[Wayland](http://wayland.freedesktop.org/) композитор. Прочитайте
+[FAQ](https://github.com/swaywm/sway/wiki). Присоединяйтесь к [IRC
+каналу](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на
irc.freenode.net).
[![](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 @@
# sway
-**Sway** ("**S**irCmpwn's **Way**land compositor") це сумісний з i3 композитор
-[Wayland](http://wayland.freedesktop.org/) (**у стані розробки**).
-Ознайомтесь з [ЧаПами](https://github.com/swaywm/sway/wiki).
-Приєднуйтесь до [спільноти в IRC](http://webchat.freenode.net/?channels=sway&uio=d4)
-(#sway на irc.freenode.net).
+**Sway** це сумісний з i3 композитор [Wayland](http://wayland.freedesktop.org/)
+(**у стані розробки**). Ознайомтесь з
+[ЧаПами](https://github.com/swaywm/sway/wiki). Приєднуйтесь до [спільноти в
+IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на
+irc.freenode.net).
[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png)
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()
return
;;
-b|--bar_id)
- bars=($(swaymsg -t get_bar_config | sed -e '/^\[/,/\]$/{//d;s/^ *"\(.*\)",\?.*$/\1/}'))
+ bars=($(swaymsg -t get_bar_config | jq -r '.[]'))
COMPREPLY=($(compgen -W "${bars[*]}" -- "$cur"))
return
;;
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 @@
#
# -------------------------------
_arguments -s \
- '(-v --version)'{-v,--version}'[shows version]' \
- '(-h --help)'{-h,--help}'[shows help message]' \
+ '(-v --version)'{-v,--version}'[Show the version number and quit]' \
+ '(-h --help)'{-h,--help}'[Show help message and quit]' \
'(-c --config)'{-c,--config}'[Specify a config file]:files:_files' \
'(-C --validate)'{-C,--validate}'[Check validity of the config file, then exit]' \
'(-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 @@
+#compdef swaybar
+#
+# Completion script for swaybar
+#
+
+local bars=($(swaymsg -t get_bar_config | jq -r '.[]'))
+
+_arguments -s \
+ '(-h --help)'{-h,--help}'[Show help message and quit]' \
+ '(-v --version)'{-v,--version}'[Show version and quit]' \
+ '(-s --socket)'{-s,--socket}'[Connect to sway via socket]:filename:_files' \
+ '(-b --bar_id)'{-b,--bar-id}'[Bar ID for which to get the configuration]:filename:($bars)'\
+ '(-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 @@
+#compdef swayidle
+#
+# Completion script for swayidle
+#
+
+local events=('timeout:Execute timeout command if there is no activity for timeout seconds'
+ 'before-sleep:Execute before-sleep command before sleep')
+local resume=('resume:Execute command when there is activity again')
+
+if (($#words <= 2)); then
+ _arguments -C \
+ '(-h --help)'{-h,--help}'[Show help message and quit]' \
+ '(-d)'-d'[Enable debug output]'
+ _describe -t "events" 'swayidle' events
+
+elif [[ "$words[-3]" == before-sleep || "$words[-3]" == resume ]]; then
+ _describe -t "events" 'swayidle' events
+
+elif [[ "$words[-4]" == timeout ]]; then
+ _describe -t "events" 'swayidle' events
+ _describe -t "resume" 'swayidle' resume
+fi
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 @@
#
_arguments -s \
- '(-v --version)'{-v,--version}'[Show the version number and quit]' \
- '(-h --help)'{-h,--help}'[Show help message and quit]' \
- '(-f --daemonize)'{-f,--daemonize}'[Detach from the controlling terminal]' \
- '(-c --color)'{-c,--color}'[Specify a color (rrggbb)]' \
- '(-i --image)'{-i,--image}'[Display an image]:files:_files' \
- '(-s --scaling)'{-s,--scaling}'[Scaling mode]:mode:(stretch fill fit center tile)' \
+ '(-C --config)'{-C,--config}'[Path to the config file]:filename:_files' \
+ '(-c --color)'{-c,--color}'[Turn the screen into the given color instead of white]:color:' \
+ '(-e --ignore-empty-password)'{-e,--ignore-empty-password}'[When an empty password is provided, do not validate it]' \
+ '(-f --daemonize)'{-f,--daemonize}'[Detach from the controlling terminal after locking]' \
+ '(-h --help)'{-h,--help}'[Show help message and quit]' \
+ '(-i --image)'{-i,--image}'[Display an image]:filename:_files' \
+ '(-s --scaling)'{-s,--scaling}'[Scaling mode]:mode:(stretch fill fit center tile)' \
+ '(-t --tiling)'{-t,--tiling}'[Same as --scaling=tile]' \
'(-u --no-unlock-indicator)'{-u,--no-unlock-indicator}'[Disable the unlock indicator]' \
- '(--socket)'--socket'[Use the specified socket path.]:files:_files' \
+ '(-v --version)'{-v,--version}'[Show the version number and quit]' \
+ '(--bs-hl-color)'--bs-hl-color'[Sets the color of backspace highlights segments]:color:' \
+ '(--font)'--font'[Sets the font of the text]:font:' \
+ '(--indicator-radius)'--indicator-radius'[Sets the indicator radius]:radius:' \
+ '(--indicator-thickness)'--indicator-thickness'[Sets the indicator thickness]:thickness:' \
+ '(--inside-color)'--inside-color'[Sets the color of the inside of the indicator]:color:' \
+ '(--inside-clear-color)'--inside-clear-color'[Sets the color of the inside of the indicator when cleared]:color:' \
+ '(--inside-clear-color)'--inside-clear-color'[Sets the color of the inside of the indicator when verifying]:color:' \
+ '(--inside-wrong-color)'--inside-wrong-color'[Sets the color of the inside of the indicator when invalid]:color:' \
+ '(--key-hl-color)'--key-hl-color'[Sets the color of the key press highlight segments]:color:' \
+ '(--line-color)'--line-color'[Sets the color of the line between the inside and ring]:color:' \
+ '(--line-clear-color)'--line-clear-color'[Sets the color of the line between the inside and ring when cleared]:color:' \
+ '(--line-ver-color)'--line-ver-color'[Sets the color of the line between the inside and ring when verifying]:color:' \
+ '(--line-wrong-color)'--line-wrong-color'[Sets the color of the line between the inside and ring when invalid]:color:' \
+ '(-n --line-uses-inside)'{-n,--line-uses-inside}'[Use the inside color for the line between the inside and ring]' \
+ '(-r --line-uses-ring)'{-r,--line--uses-ring}'[Use the ring color for the line between the inside and ring]' \
+ '(--ring-color)'--ring-color'[Sets the color of the ring of the indicator]:color:' \
+ '(--ring-clear-color)'--ring-clear-color'[Sets the color of the ring of the indicator when cleared]:color:' \
+ '(--ring-ver-color)'--ring-ver-color'[Sets the color of the ring of the indicator when verifying]:color:' \
+ '(--ring-wrong-color)'--ring-wrong-color'[Sets the color of the ring of the indicator when invalid]:color:' \
+ '(--separator-color)'--separator-color'[Sets the color of the lines that separate highlight segments]:color:' \
+ '(--text-color)'--text-color'[Sets the color of the text]:color:' \
+ '(--text-clear-color)'--text-clear-color'[Sets the color of the text when cleared]:color:' \
+ '(--text-ver-color)'--text-ver-color'[Sets the color of the text when verifying]:color:' \
+ '(--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=(
)
_arguments -s \
- '(-v --version)'{-v,--version}'[Print the version (of swaymsg) and quit]' \
- '(-h --help)'{-h,--help}'[Shows help message]' \
- '(-q --quiet)'{-q,--quiet}'[Sends the IPC message but does not print the response from sway]' \
- '(-s --socket)'{-s,--socket}'[Use the specified socket path.]:files:_files' \
- '(-t --type)'{-t,--type}'[Specify the type of IPC message.]:type:{_describe "type" types}'
+ '(-v --version)'{-v,--version}'[Show the version number and quit]' \
+ '(-m --monitor)'{-m,--monitor}'[Monitor until killed (-t SUBSCRIBE only)]' \
+ '(-h --help)'{-h,--help}'[Show help message and quit]' \
+ '(-q --quiet)'{-q,--quiet}'[Be quiet]' \
+ '(-r --raw)'{-r,--raw}'[Use raw output even if using a tty]' \
+ '(-s --socket)'{-s,--socket}'[Use the specified socket path]:files:_files' \
+ '(-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;
sway_cmd cmd_swaynag_command;
sway_cmd cmd_swap;
sway_cmd cmd_tiling_drag;
+sway_cmd cmd_tiling_drag_threshold;
sway_cmd cmd_title_align;
sway_cmd cmd_title_format;
sway_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 {
bool auto_back_and_forth;
bool show_marks;
enum alignment title_align;
+
bool tiling_drag;
+ int tiling_drag_threshold;
bool smart_gaps;
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);
void cursor_rebase(struct sway_cursor *cursor);
void cursor_handle_activity(struct sway_cursor *cursor);
+void cursor_unhide(struct sway_cursor *cursor);
+int cursor_get_timeout(struct sway_cursor *cursor);
/**
* 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 {
OP_NONE,
OP_DOWN,
OP_MOVE_FLOATING,
+ OP_MOVE_TILING_THRESHOLD,
OP_MOVE_TILING,
OP_RESIZE_FLOATING,
OP_RESIZE_TILING,
@@ -186,6 +187,9 @@ void seat_begin_down(struct sway_seat *seat, struct sway_container *con,
void seat_begin_move_floating(struct sway_seat *seat,
struct sway_container *con, uint32_t button);
+void seat_begin_move_tiling_threshold(struct sway_seat *seat,
+ struct sway_container *con, uint32_t button);
+
void seat_begin_move_tiling(struct sway_seat *seat,
struct sway_container *con, uint32_t button);
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[] = {
{ "smart_borders", cmd_smart_borders },
{ "smart_gaps", cmd_smart_gaps },
{ "tiling_drag", cmd_tiling_drag },
+ { "tiling_drag_threshold", cmd_tiling_drag_threshold },
{ "title_align", cmd_title_align },
{ "titlebar_border_thickness", cmd_titlebar_border_thickness },
{ "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 "
"'cursor <set> <x> <y>' or "
"'curor <press|release> <left|right|1|2|3...>'";
-struct cmd_results *seat_cmd_cursor(int argc, char **argv) {
- struct cmd_results *error = NULL;
- if ((error = checkarg(argc, "cursor", EXPECTED_AT_LEAST, 2))) {
- return error;
- }
- struct sway_seat *seat = config->handler_context.seat;
- if (!seat) {
- return cmd_results_new(CMD_FAILURE, "cursor", "No seat defined");
- }
-
- struct sway_cursor *cursor = seat->cursor;
-
+static struct cmd_results *handle_command(struct sway_cursor *cursor,
+ int argc, char **argv) {
if (strcasecmp(argv[0], "move") == 0) {
if (argc < 3) {
return cmd_results_new(CMD_INVALID, "cursor", expected_syntax);
@@ -50,6 +40,7 @@ struct cmd_results *seat_cmd_cursor(int argc, char **argv) {
if (argc < 2) {
return cmd_results_new(CMD_INVALID, "cursor", expected_syntax);
}
+ struct cmd_results *error = NULL;
if ((error = press_or_release(cursor, argv[0], argv[1]))) {
return error;
}
@@ -58,6 +49,40 @@ struct cmd_results *seat_cmd_cursor(int argc, char **argv) {
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
+struct cmd_results *seat_cmd_cursor(int argc, char **argv) {
+ struct cmd_results *error = NULL;
+ if ((error = checkarg(argc, "cursor", EXPECTED_AT_LEAST, 2))) {
+ return error;
+ }
+ struct seat_config *sc = config->handler_context.seat_config;
+ if (!sc) {
+ return cmd_results_new(CMD_FAILURE, "cursor", "No seat defined");
+ }
+
+ if (config->reading || !config->active) {
+ return cmd_results_new(CMD_DEFER, NULL, NULL);
+ }
+
+ if (strcmp(sc->name, "*") != 0) {
+ struct sway_seat *seat = input_manager_get_seat(sc->name);
+ if (!seat) {
+ return cmd_results_new(CMD_FAILURE, "cursor",
+ "Failed to get seat");
+ }
+ error = handle_command(seat->cursor, argc, argv);
+ } else {
+ struct sway_seat *seat = NULL;
+ wl_list_for_each(seat, &server.input->seats, link) {
+ error = handle_command(seat->cursor, argc, argv);
+ if ((error && error->status != CMD_SUCCESS)) {
+ break;
+ }
+ }
+ }
+
+ return error ? error : cmd_results_new(CMD_SUCCESS, NULL, NULL);
+}
+
static struct cmd_results *press_or_release(struct sway_cursor *cursor,
char *action, char *button_str) {
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 @@
+#include <string.h>
+#include "sway/commands.h"
+#include "sway/config.h"
+#include "log.h"
+
+struct cmd_results *cmd_tiling_drag_threshold(int argc, char **argv) {
+ struct cmd_results *error = NULL;
+ if ((error = checkarg(argc, "tiling_drag_threshold", EXPECTED_EQUAL_TO, 1))) {
+ return error;
+ }
+
+ char *inv;
+ int value = strtol(argv[0], &inv, 10);
+ if (*inv != '\0' || value < 0) {
+ return cmd_results_new(CMD_INVALID, "tiling_drag_threshold",
+ "Invalid threshold specified");
+ }
+
+ config->tiling_drag_threshold = value;
+
+ return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+}
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) {
config->show_marks = true;
config->title_align = ALIGN_LEFT;
config->tiling_drag = true;
+ config->tiling_drag_threshold = 9;
config->smart_gaps = false;
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,
if (fullscreen_con->view) {
if (fullscreen_con->view->saved_buffer) {
render_saved_view(fullscreen_con->view, output, damage, 1.0f);
- } else {
+ } else if (fullscreen_con->view->surface) {
render_view_toplevels(fullscreen_con->view,
output, damage, 1.0f);
}
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) {
static int handle_timeout(void *data) {
struct sway_transaction *transaction = data;
- wlr_log(WLR_DEBUG, "Transaction %p timed out (%li waiting)",
+ wlr_log(WLR_DEBUG, "Transaction %p timed out (%zi waiting)",
transaction, transaction->num_waiting);
transaction->num_waiting = 0;
transaction_progress_queue();
@@ -472,7 +472,7 @@ static void set_instruction_ready(
struct timespec *start = &transaction->commit_time;
float ms = (now.tv_sec - start->tv_sec) * 1000 +
(now.tv_nsec - start->tv_nsec) / 1000000.0;
- wlr_log(WLR_DEBUG, "Transaction %p: %li/%li ready in %.1fms (%s)",
+ wlr_log(WLR_DEBUG, "Transaction %p: %zi/%zi ready in %.1fms (%s)",
transaction,
transaction->num_configures - transaction->num_waiting + 1,
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,
desktop_damage_box(&seat->op_drop_box);
}
+static void handle_move_tiling_threshold_motion(struct sway_seat *seat,
+ struct sway_cursor *cursor) {
+ double cx = seat->cursor->cursor->x;
+ double cy = seat->cursor->cursor->y;
+ double sx = seat->op_ref_lx;
+ double sy = seat->op_ref_ly;
+
+ // Get the scaled threshold for the output. Even if the operation goes
+ // across multiple outputs of varying scales, just use the scale for the
+ // output that the cursor is currently on for simplicity.
+ struct wlr_output *wlr_output = wlr_output_layout_output_at(
+ root->output_layout, cx, cy);
+ double output_scale = wlr_output ? wlr_output->scale : 1;
+ double threshold = config->tiling_drag_threshold * output_scale;
+ threshold *= threshold;
+
+ // If the threshold has been exceeded, start the actual drag
+ if ((cx - sx) * (cx - sx) + (cy - sy) * (cy - sy) > threshold) {
+ seat->operation = OP_MOVE_TILING;
+ cursor_set_image(cursor, "grab", NULL);
+ handle_move_tiling_motion(seat, cursor);
+ }
+}
+
static void calculate_floating_constraints(struct sway_container *con,
int *min_width, int *max_width, int *min_height, int *max_height) {
if (config->floating_minimum_width == -1) { // no minimum
@@ -597,7 +621,7 @@ static int hide_notify(void *data) {
return 1;
}
-void cursor_handle_activity(struct sway_cursor *cursor) {
+int cursor_get_timeout(struct sway_cursor *cursor){
struct seat_config *sc = seat_get_config(cursor->seat);
if (!sc) {
sc = seat_get_config_by_name("*");
@@ -606,20 +630,31 @@ void cursor_handle_activity(struct sway_cursor *cursor) {
if (timeout < 0) {
timeout = 0;
}
- wl_event_source_timer_update(cursor->hide_source, timeout);
+ return timeout;
+}
+
+void cursor_handle_activity(struct sway_cursor *cursor) {
+ wl_event_source_timer_update(
+ cursor->hide_source, cursor_get_timeout(cursor));
wlr_idle_notify_activity(server.idle, cursor->seat->wlr_seat);
if (cursor->hidden) {
- cursor->hidden = false;
- if (cursor->image_surface) {
- cursor_set_image_surface(cursor, cursor->image_surface,
- cursor->hotspot_x, cursor->hotspot_y,
- cursor->image_client);
- } else {
- const char *image = cursor->image;
- cursor->image = NULL;
- cursor_set_image(cursor, image, cursor->image_client);
- }
+ cursor_unhide(cursor);
+ }
+}
+
+void cursor_unhide(struct sway_cursor *cursor) {
+ cursor->hidden = false;
+ if (cursor->image_surface) {
+ cursor_set_image_surface(cursor,
+ cursor->image_surface,
+ cursor->hotspot_x,
+ cursor->hotspot_y,
+ cursor->image_client);
+ } else {
+ const char *image = cursor->image;
+ cursor->image = NULL;
+ cursor_set_image(cursor, image, cursor->image_client);
}
}
@@ -640,6 +675,9 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor,
case OP_MOVE_FLOATING:
handle_move_floating_motion(seat, cursor);
break;
+ case OP_MOVE_TILING_THRESHOLD:
+ handle_move_tiling_threshold_motion(seat, cursor);
+ break;
case OP_MOVE_TILING:
handle_move_tiling_motion(seat, cursor);
break;
@@ -984,12 +1022,21 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
if (config->tiling_drag && (mod_pressed || on_titlebar) &&
state == WLR_BUTTON_PRESSED && !is_floating_or_child &&
cont && !cont->is_fullscreen) {
- if (on_titlebar) {
+ struct sway_container *focus = seat_get_focused_container(seat);
+ bool focused = focus == cont || container_has_ancestor(focus, cont);
+ if (on_titlebar && !focused) {
node = seat_get_focus_inactive(seat, &cont->node);
seat_set_focus(seat, node);
}
+
seat_pointer_notify_button(seat, time_msec, button, state);
- seat_begin_move_tiling(seat, cont, button);
+
+ // If moving a container by it's title bar, use a threshold for the drag
+ if (!mod_pressed && config->tiling_drag_threshold > 0) {
+ seat_begin_move_tiling_threshold(seat, cont, button);
+ } else {
+ seat_begin_move_tiling(seat, cont, button);
+ }
return;
}
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,
cursor_set_image(seat->cursor, "grab", NULL);
}
+void seat_begin_move_tiling_threshold(struct sway_seat *seat,
+ struct sway_container *con, uint32_t button) {
+ seat->operation = OP_MOVE_TILING_THRESHOLD;
+ seat->op_container = con;
+ seat->op_button = button;
+ seat->op_target_node = NULL;
+ seat->op_target_edge = 0;
+ seat->op_ref_lx = seat->cursor->cursor->x;
+ seat->op_ref_ly = seat->cursor->cursor->y;
+}
+
void seat_begin_move_tiling(struct sway_seat *seat,
struct sway_container *con, uint32_t button) {
seat->operation = OP_MOVE_TILING;
@@ -1220,4 +1231,8 @@ void seat_consider_warp_to_focus(struct sway_seat *seat) {
} else {
cursor_warp_to_workspace(seat->cursor, focus->sway_workspace);
}
+ if (seat->cursor->hidden){
+ cursor_unhide(seat->cursor);
+ wl_event_source_timer_update(seat->cursor->hide_source, cursor_get_timeout(seat->cursor));
+ }
}
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(
'commands/swaynag_command.c',
'commands/swap.c',
'commands/tiling_drag.c',
+ 'commands/tiling_drag_threshold.c',
'commands/title_align.c',
'commands/title_format.c',
'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 @@
#include <wlr/backend/session.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_compositor.h>
+#include <wlr/types/wlr_data_control_v1.h>
#include <wlr/types/wlr_export_dmabuf_v1.h>
#include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_gamma_control.h>
@@ -140,6 +141,7 @@ bool server_init(struct sway_server *server) {
wlr_export_dmabuf_manager_v1_create(server->wl_display);
wlr_screencopy_manager_v1_create(server->wl_display);
+ wlr_data_control_manager_v1_create(server->wl_display);
server->socket = wl_display_add_socket_auto(server->wl_display);
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:
Places the specified output at the specific position in the global
coordinate space. If scaling is active, it has to be considered when
positioning. For example, if the scaling factor for the left output is 2,
- the relative position for the right output has to be divided by 2.
+ the relative position for the right output has to be divided by 2. The
+ reference point is the top left corner so if you want the bottoms aligned
+ this has to be considered as well.
Example:
output HDMI1 scale 2
- output HDMI1 pos 0 0 res 3200x1800
+ output HDMI1 pos 0 1020 res 3200x1800
output eDP1 pos 1600 0 res 1920x1080
- Note that the x-pos of eDP1 is 1600 = 3200/2.
+ Note that the left x-pos of eDP1 is 1600 = 3200/2 and the bottom y-pos is
+ 1020 + (1800 / 2) = 1920 = 0 + 1920
*output* <name> scale <factor>
Scales the specified output by the specified scale _factor_. An integer is
@@ -57,7 +60,8 @@ must be separated by one space. For example:
represent the contents of your windows - they will be rendered at the next
highest integral scale factor and downscaled. You may be better served by
setting an integral scale factor and adjusting the font size of your
- applications to taste.
+ applications to taste. HiDPI isn't supported with Xwayland clients (windows
+ will blur).
*output* <name> background|bg <file> <mode> [<fallback\_color>]
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.
A view that does not have focus.
*client.urgent*
- A view with an urgency hint. *Note*: This is not currently implemented.
+ A view with an urgency hint. *Note*: Native Wayland windows do not
+ support urgency. Urgency only works for Xwayland windows.
The meaning of each color is:
@@ -431,7 +432,7 @@ The default colors are:
*focus\_follows\_mouse* yes|no|always
If set to _yes_, moving your mouse over a window will focus that window. If
- set to _always_, the window under the cursor will always be focused, even
+ set to _always_, the window under the cursor will always be focused, even
after switching between workspaces.
*focus\_wrapping* yes|no|force
@@ -450,11 +451,11 @@ The default colors are:
Thickness of the titlebar border in pixels
*titlebar\_padding* <horizontal> [<vertical>]
- Padding of the text in the titlebar. _horizontal_ value affects horizontal
- padding of the text while _vertical_ value affects vertical padding (space
- above and below text). Padding includes titlebar borders so their value
+ Padding of the text in the titlebar. _horizontal_ value affects horizontal
+ padding of the text while _vertical_ value affects vertical padding (space
+ above and below text). Padding includes titlebar borders so their value
should be greater than titlebar\_border\_thickness. If _vertical_ value is
- not specified it is set to the _horizontal_ value.
+ not specified it is set to the _horizontal_ value.
*for\_window* <criteria> <command>
Whenever a window that matches _criteria_ appears, run list of commands.
@@ -572,6 +573,14 @@ The default colors are:
the _floating\_mod_ will also allow the container to be dragged. _toggle_
should not be used in the config file.
+*tiling\_drag\_threshold* <threshold>
+ Sets the threshold that must be exceeded for a container to be dragged by
+ its titlebar. This has no effect if _floating\_mod_ is used or if
+ _tiling\_drag_ is set to _disable_. Once the threshold has been exceeded
+ once, the drag starts and the cursor can come back inside the threshold
+ without stopping the drag. _threshold_ is multiplied by the scale of the
+ output that the cursor on. The default is 9.
+
*title\_align* left|center|right
Sets the title alignment. If _right_ is selected and _show\_marks_ is set
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) {
struct sway_seat *seat;
wl_list_for_each(seat, &server.input->seats, link) {
- if (config->mouse_warping == WARP_CONTAINER) {
- struct sway_node *node = seat_get_focus(seat);
- if (node && node->type == N_CONTAINER) {
- cursor_warp_to_container(seat->cursor, node->sway_container);
- } else if (node && node->type == N_WORKSPACE) {
- cursor_warp_to_workspace(seat->cursor, node->sway_workspace);
- }
- }
+ seat->cursor->image_surface = NULL;
+ seat_consider_warp_to_focus(seat);
}
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 @@
#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <errno.h>
+#include <fcntl.h>
#include <getopt.h>
#include <pthread.h>
#include <signal.h>
@@ -104,9 +105,21 @@ static void acquire_sleep_lock(void) {
if (ret < 0) {
wlr_log(WLR_ERROR, "Failed to parse D-Bus response for Inhibit: %s",
strerror(-ret));
+ sd_bus_error_free(&error);
+ sd_bus_message_unref(msg);
+ return;
} else {
wlr_log(WLR_INFO, "Got sleep lock: %d", lock_fd);
}
+
+ // sd_bus_message_unref closes the file descriptor so we need
+ // to copy it beforehand
+ lock_fd = fcntl(lock_fd, F_DUPFD_CLOEXEC, 3);
+ if (lock_fd < 0) {
+ wlr_log(WLR_ERROR, "Failed to copy sleep lock fd: %s",
+ strerror(errno));
+ }
+
sd_bus_error_free(&error);
sd_bus_message_unref(msg);
}
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,
schedule_indicator_clear(state);
break;
case XKB_KEY_Caps_Lock:
- /* The state is getting active after this
- * so we need to manually toggle it */
- state->xkb.caps_lock = !state->xkb.caps_lock;
- state->auth_state = AUTH_STATE_INPUT_NOP;
- damage_state(state);
- schedule_indicator_clear(state);
- schedule_password_clear(state);
- break;
case XKB_KEY_Shift_L:
case XKB_KEY_Shift_R:
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,
struct swaylock_state *state = data;
xkb_state_update_mask(state->xkb.state,
mods_depressed, mods_latched, mods_locked, 0, 0, group);
- state->xkb.caps_lock = xkb_state_mod_name_is_active(state->xkb.state,
+ int caps_lock = xkb_state_mod_name_is_active(state->xkb.state,
XKB_MOD_NAME_CAPS, XKB_STATE_MODS_LOCKED);
+ if (caps_lock != state->xkb.caps_lock) {
+ state->xkb.caps_lock = caps_lock;
+ damage_state(state);
+ }
state->xkb.control = xkb_state_mod_name_is_active(state->xkb.state,
XKB_MOD_NAME_CTRL,
XKB_STATE_MODS_DEPRESSED | XKB_STATE_MODS_LATCHED);