aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.de.md2
-rw-r--r--README.el.md2
-rw-r--r--README.fr.md2
-rw-r--r--README.it.md2
-rw-r--r--README.ja.md2
-rw-r--r--README.md2
-rw-r--r--README.pt.md2
-rw-r--r--README.ru.md2
-rw-r--r--README.uk.md2
-rw-r--r--completions/bash/sway46
-rw-r--r--completions/bash/swayidle48
-rw-r--r--completions/bash/swaylock66
-rw-r--r--completions/bash/swaymsg57
-rw-r--r--completions/zsh/_sway2
-rw-r--r--completions/zsh/_swaygrab23
-rw-r--r--include/sway/input/keyboard.h3
-rw-r--r--include/sway/tree/container.h2
-rw-r--r--include/swaygrab/json.h10
-rw-r--r--include/util.h1
-rw-r--r--meson.build14
-rw-r--r--meson_options.txt1
-rw-r--r--security.d/00-defaults.in6
-rw-r--r--sway/desktop/output.c6
-rw-r--r--sway/desktop/xwayland.c12
-rw-r--r--sway/input/keyboard.c40
-rw-r--r--sway/sway.1.scd2
-rw-r--r--sway/tree/container.c6
-rw-r--r--swayidle/swayidle.1.scd2
28 files changed, 293 insertions, 72 deletions
diff --git a/README.de.md b/README.de.md
index 206a1040..a872e888 100644
--- a/README.de.md
+++ b/README.de.md
@@ -64,8 +64,6 @@ Abhängigkeiten:
64* cairo 64* cairo
65* gdk-pixbuf2 * 65* gdk-pixbuf2 *
66* pam ** 66* pam **
67* imagemagick (erforderlich für Bildaufnahme mit swaygrab)
68* ffmpeg (erforderlich für Videoaufnahme swaygrab)
69* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (erforderlich für man pages) 67* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (erforderlich für man pages)
70 68
71_\*Nur erforderlich für swaybar, swaybg, und swaylock_ 69_\*Nur erforderlich für swaybar, swaybg, und swaylock_
diff --git a/README.el.md b/README.el.md
index 5c70beff..6887fe8e 100644
--- a/README.el.md
+++ b/README.el.md
@@ -57,8 +57,6 @@ To username μου στο Freenode είναι kon14 και θα με βρείτ
57* cairo 57* cairo
58* gdk-pixbuf2 * 58* gdk-pixbuf2 *
59* pam ** 59* pam **
60* imagemagick (αναγκαίο για καταγραφή εικόνας μέσω του swaygrab)
61* ffmpeg (αναγκαίο για καταγραφή video μέσω του swaygrab)
62* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (required for man pages) 60* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (required for man pages)
63 61
64_\*Απαιτείται μόνο για swaybar, swaybg, and swaylock_ 62_\*Απαιτείται μόνο για swaybar, swaybg, and swaylock_
diff --git a/README.fr.md b/README.fr.md
index 0d2573f9..6ea4d14c 100644
--- a/README.fr.md
+++ b/README.fr.md
@@ -59,8 +59,6 @@ Installez les dépendances :
59* cairo 59* cairo
60* gdk-pixbuf2 * 60* gdk-pixbuf2 *
61* pam ** 61* pam **
62* imagemagick (requis pour la capture d'image avec swaygrab)
63* ffmpeg (requis pour la capture vidéo avec swaygrab)
64* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (requis pour les pages man) 62* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (requis pour les pages man)
65 63
66_\*Uniquement requis pour swaybar, swaybg, and swaylock_ 64_\*Uniquement requis pour swaybar, swaybg, and swaylock_
diff --git a/README.it.md b/README.it.md
index 0d81ea54..3b1b1ebc 100644
--- a/README.it.md
+++ b/README.it.md
@@ -60,8 +60,6 @@ Installa queste dipendenze:
60* cairo 60* cairo
61* gdk-pixbuf2 * 61* gdk-pixbuf2 *
62* pam ** 62* pam **
63* imagemagick (richiesto per catturare immagini con swaygrab)
64* ffmpeg (rrichiesto per catturare video con swaygrab)
65* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (rrichiesto per man pages) 63* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (rrichiesto per man pages)
66 64
67_\*Richiesto solo per swaybar, swaybg, e swaylock_ 65_\*Richiesto solo per swaybar, swaybg, e swaylock_
diff --git a/README.ja.md b/README.ja.md
index 476d7472..7b437966 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -50,8 +50,6 @@ Swayは沢山のディストリビューションで提供されています。"
50* cairo 50* cairo
51* gdk-pixbuf2 * 51* gdk-pixbuf2 *
52* pam ** 52* pam **
53* imagemagick (swaygrabでスクリーンショットを撮るのに必要です)
54* ffmpeg (swaygrabで画面を録画するのに必要です)
55* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (manで必要です) 53* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (manで必要です)
56 54
57_\*swaybar,swaybg,swaylockでのみ必要です_ 55_\*swaybar,swaybg,swaylockでのみ必要です_
diff --git a/README.md b/README.md
index 49140fb8..ce753265 100644
--- a/README.md
+++ b/README.md
@@ -58,8 +58,6 @@ Install dependencies:
58* gdk-pixbuf2 * 58* gdk-pixbuf2 *
59* pam ** 59* pam **
60* dbus >= 1.10 *** 60* dbus >= 1.10 ***
61* imagemagick (required for image capture with swaygrab)
62* ffmpeg (required for video capture with swaygrab)
63* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (required for man pages) 61* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (required for man pages)
64 62
65_\*Only required for swaybar, swaybg, and swaylock_ 63_\*Only required for swaybar, swaybg, and swaylock_
diff --git a/README.pt.md b/README.pt.md
index d1ef245f..9089c8c6 100644
--- a/README.pt.md
+++ b/README.pt.md
@@ -66,8 +66,6 @@ Antes de iniciar a compilação, instale as dependências:
66* cairo 66* cairo
67* gdk-pixbuf2 * 67* gdk-pixbuf2 *
68* pam ** 68* pam **
69* imagemagick (capturar imagem com o swaygrab)
70* ffmpeg (capturar vídeo com o swaygrab)
71* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (man pages) 69* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (man pages)
72 70
73_\*Dependência apenas de swaybar, swaybg, e swaylock_ 71_\*Dependência apenas de swaybar, swaybg, e swaylock_
diff --git a/README.ru.md b/README.ru.md
index 3b3de19a..68675db3 100644
--- a/README.ru.md
+++ b/README.ru.md
@@ -62,8 +62,6 @@ Sway доступен во многих дистрибутивах и наход
62* gdk-pixbuf2 * 62* gdk-pixbuf2 *
63* pam ** 63* pam **
64* dbus >= 1.10 *** 64* dbus >= 1.10 ***
65* imagemagick (требуется для захвата изображений через swaygrab)
66* ffmpeg (требуется для захвата видео через swaygrab)
67* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (required for man pages) 65* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (required for man pages)
68 66
69_\*Требуется только для swaybar, swaybg и swaylock_ 67_\*Требуется только для swaybar, swaybg и swaylock_
diff --git a/README.uk.md b/README.uk.md
index 55698487..c31a3ea9 100644
--- a/README.uk.md
+++ b/README.uk.md
@@ -66,8 +66,6 @@ Sway доступний у багатьох дистрибутивах Linux (а
66* cairo 66* cairo
67* gdk-pixbuf2 * 67* gdk-pixbuf2 *
68* pam ** 68* pam **
69* imagemagick (для захоплення зображень за допомогою swaygrab)
70* ffmpeg (для захоплення відео за допомогою swaygrab)
71* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (required for man pages) 69* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (required for man pages)
72 70
73_\*Лише для swaybar, swaybg та swaylock_ 71_\*Лише для swaybar, swaybg та swaylock_
diff --git a/completions/bash/sway b/completions/bash/sway
new file mode 100644
index 00000000..edd752cd
--- /dev/null
+++ b/completions/bash/sway
@@ -0,0 +1,46 @@
1# sway(1) completion
2
3_sway()
4{
5 local cur prev
6 _get_comp_words_by_ref cur prev
7
8 short=(
9 -h
10 -c
11 -C
12 -d
13 -v
14 -V
15 )
16
17 long=(
18 --help
19 --config
20 --validate
21 --debug
22 --version
23 --verbose
24 --get-socketpath
25 )
26
27 case $prev in
28 -c|--config)
29 _filedir
30 return
31 ;;
32 esac
33
34 if [[ $cur == --* ]]; then
35 COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
36 elif [[ $cur == -* ]]; then
37 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
38 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
39 else
40 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
41 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
42 COMPREPLY+=($(compgen -c -- "$cur"))
43 fi
44
45} &&
46complete -F _sway sway
diff --git a/completions/bash/swayidle b/completions/bash/swayidle
new file mode 100644
index 00000000..a0cdc8b2
--- /dev/null
+++ b/completions/bash/swayidle
@@ -0,0 +1,48 @@
1# swaymsg(1) completion
2
3_swayidle()
4{
5 local cur prev
6 _get_comp_words_by_ref -n : cur prev
7 local prev2=${COMP_WORDS[COMP_CWORD-2]}
8 local prev3=${COMP_WORDS[COMP_CWORD-3]}
9
10 events=(
11 'timeout'
12 'before-sleep'
13 )
14
15 short=(
16 -h
17 -d
18 )
19
20 if [ "$prev" = timeout ]; then
21 # timeout <timeout>
22 return
23 elif [ "$prev2" = timeout ]; then
24 # timeout <timeout> <timeout command>
25 COMPREPLY=($(compgen -c -- "$cur"))
26 return
27 elif [ "$prev3" = timeout ]; then
28 # timeout <timeout> <timeout command> [resume <resume command>]
29 COMPREPLY=(resume)
30 # optional argument; no return here as user may skip 'resume'
31 fi
32
33 case "$prev" in
34 resume)
35 COMPREPLY=($(compgen -c -- "$cur"))
36 return
37 ;;
38 before-sleep)
39 COMPREPLY=($(compgen -c -- "$cur"))
40 return
41 ;;
42 esac
43
44 COMPREPLY+=($(compgen -W "${events[*]}" -- "$cur"))
45 COMPREPLY+=($(compgen -W "${short[*]}" -- "$cur"))
46
47} &&
48complete -F _swayidle swayidle
diff --git a/completions/bash/swaylock b/completions/bash/swaylock
new file mode 100644
index 00000000..33925480
--- /dev/null
+++ b/completions/bash/swaylock
@@ -0,0 +1,66 @@
1# swaylock(1) completion
2
3_swaylock()
4{
5 local cur prev
6 _get_comp_words_by_ref -n : cur prev
7
8 short=(
9 -h
10 -c
11 -s
12 -t
13 -v
14 -i
15 -u
16 -f
17 )
18
19 long=(
20 --help
21 --color
22 --scaling
23 --tiling
24 --version
25 --image
26 --no-unlock-indicator
27 --daemonize
28 )
29
30 scaling=(
31 'stretch'
32 'fill'
33 'fit'
34 'center'
35 'tile'
36 )
37
38 case $prev in
39 -c|--color)
40 return
41 ;;
42 --scaling)
43 COMPREPLY=($(compgen -W "${scaling[*]}" -- "$cur"))
44 return
45 ;;
46 -i|--image)
47 if grep -q : <<< "$cur"; then
48 output="${cur%%:*}:"
49 cur="${cur#*:}"
50 else
51 output=
52 fi
53 COMPREPLY=($(compgen -f -- "$cur"))
54 return
55 ;;
56 esac
57
58 if [[ $cur == --* ]]; then
59 COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
60 else
61 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
62 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
63 fi
64
65} &&
66complete -F _swaylock swaylock
diff --git a/completions/bash/swaymsg b/completions/bash/swaymsg
new file mode 100644
index 00000000..8ec90b6f
--- /dev/null
+++ b/completions/bash/swaymsg
@@ -0,0 +1,57 @@
1# swaymsg(1) completion
2
3_swaymsg()
4{
5 local cur prev
6 _get_comp_words_by_ref cur prev
7
8 types=(
9 'get_workspaces'
10 'get_seats'
11 'get_inputs'
12 'get_outputs'
13 'get_tree'
14 'get_marks'
15 'get_bar_config'
16 'get_version'
17 'get_clipboard'
18 )
19
20 short=(
21 -h
22 -q
23 -r
24 -s
25 -t
26 -v
27 )
28
29 long=(
30 --help
31 --quiet
32 --raw
33 --socket
34 --type
35 --verbose
36 )
37
38 case $prev in
39 -s|--socket)
40 _filedir
41 return
42 ;;
43 -t|--type)
44 COMPREPLY=($(compgen -W "${types[*]}" -- "$cur"))
45 return
46 ;;
47 esac
48
49 if [[ $cur == --* ]]; then
50 COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
51 else
52 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
53 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
54 fi
55
56} &&
57complete -F _swaymsg swaymsg
diff --git a/completions/zsh/_sway b/completions/zsh/_sway
index bab90fbf..05112002 100644
--- a/completions/zsh/_sway
+++ b/completions/zsh/_sway
@@ -18,5 +18,5 @@ _arguments -s \
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]' \
21 '(-v --verbose)'{-v,--verbose}'[Enables more verbose logging]' \ 21 '(-V --verbose)'{-V,--verbose}'[Enables more verbose logging]' \
22 '(--get-socketpath)'--get-socketpath'[Gets the IPC socket path and prints it, then exits]' 22 '(--get-socketpath)'--get-socketpath'[Gets the IPC socket path and prints it, then exits]'
diff --git a/completions/zsh/_swaygrab b/completions/zsh/_swaygrab
deleted file mode 100644
index 0f9846f4..00000000
--- a/completions/zsh/_swaygrab
+++ /dev/null
@@ -1,23 +0,0 @@
1#compdef swaygrab
2#-----------------
3# Description
4# -----------
5#
6# Completion script for swaygrab in sway wm (http://swaywm.org)
7#
8# -----------------------------------------------------
9# Author
10# ------
11#
12# * Seth Barberee <seth.barberee@gmail.com>
13#
14# ------------------------------------------
15
16_arguments -s \
17 '(-h --help)'{-h,--help}'[Shows help message]' \
18 '(-c --capture)'{-c,--capture}'[Captures multiple frames as video and passes them to ffmpeg]' \
19 '(-o --output)'{-o,--output}'[Use the specified output. If not specified then current focused output will be used]' \
20 '(-v --version)'{-v,--version}'[Print the version (of swaymsg) and quit]' \
21 '(-s --socket)'{-s,--socket}'[Use the specified socket path.]:files:_files' \
22 '(-r --rate)'{-r,--rate}'[Specify a framerate (in fps). Used in combination with -c. Default is 30 and must be an integer]' \
23 '(--raw)--raw[Instead of ImageMagick or ffmpeg, dump raw rgba data to stdout]'
diff --git a/include/sway/input/keyboard.h b/include/sway/input/keyboard.h
index 6713398e..6d28454c 100644
--- a/include/sway/input/keyboard.h
+++ b/include/sway/input/keyboard.h
@@ -38,6 +38,9 @@ struct sway_keyboard {
38 struct sway_shortcut_state state_keysyms_raw; 38 struct sway_shortcut_state state_keysyms_raw;
39 struct sway_shortcut_state state_keycodes; 39 struct sway_shortcut_state state_keycodes;
40 struct sway_binding *held_binding; 40 struct sway_binding *held_binding;
41
42 struct wl_event_source *key_repeat_source;
43 struct sway_binding *repeat_binding;
41}; 44};
42 45
43struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, 46struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat,
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index d91b3bf1..d4a42a71 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -270,6 +270,8 @@ int container_count_descendants_of_type(struct sway_container *con,
270 270
271void container_create_notify(struct sway_container *container); 271void container_create_notify(struct sway_container *container);
272 272
273void container_update_textures_recursive(struct sway_container *con);
274
273void container_damage_whole(struct sway_container *container); 275void container_damage_whole(struct sway_container *container);
274 276
275bool container_reap_empty(struct sway_container *con); 277bool container_reap_empty(struct sway_container *con);
diff --git a/include/swaygrab/json.h b/include/swaygrab/json.h
deleted file mode 100644
index c1093ef1..00000000
--- a/include/swaygrab/json.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#include <json-c/json.h>
2#include "wlc/wlc.h"
3
4void init_json_tree(int socketfd);
5void free_json_tree();
6char *get_focused_output();
7char *create_payload(const char *output, struct wlc_geometry *g);
8struct wlc_geometry *get_container_geometry(json_object *container);
9json_object *get_focused_container();
10json_object *get_output_container(const char *output);
diff --git a/include/util.h b/include/util.h
index bda941ce..9277fa6e 100644
--- a/include/util.h
+++ b/include/util.h
@@ -2,6 +2,7 @@
2#define _SWAY_UTIL_H 2#define _SWAY_UTIL_H
3 3
4#include <stdint.h> 4#include <stdint.h>
5#include <stdbool.h>
5#include <unistd.h> 6#include <unistd.h>
6#include <sys/types.h> 7#include <sys/types.h>
7#include <xkbcommon/xkbcommon.h> 8#include <xkbcommon/xkbcommon.h>
diff --git a/meson.build b/meson.build
index 06299618..05d334d2 100644
--- a/meson.build
+++ b/meson.build
@@ -12,6 +12,7 @@ project(
12add_project_arguments('-Wno-unused-parameter', language: 'c') 12add_project_arguments('-Wno-unused-parameter', language: 'c')
13add_project_arguments('-Wno-unused-function', language: 'c') 13add_project_arguments('-Wno-unused-function', language: 'c')
14add_project_arguments('-Wno-unused-result', language: 'c') 14add_project_arguments('-Wno-unused-result', language: 'c')
15add_project_arguments('-DWLR_USE_UNSTABLE', language: 'c')
15 16
16cc = meson.get_compiler('c') 17cc = meson.get_compiler('c')
17 18
@@ -182,7 +183,6 @@ endif
182if (get_option('zsh_completions')) 183if (get_option('zsh_completions'))
183 zsh_files = files( 184 zsh_files = files(
184 'completions/zsh/_sway', 185 'completions/zsh/_sway',
185 'completions/zsh/_swaygrab',
186 'completions/zsh/_swaylock', 186 'completions/zsh/_swaylock',
187 'completions/zsh/_swaymsg', 187 'completions/zsh/_swaymsg',
188 ) 188 )
@@ -190,3 +190,15 @@ if (get_option('zsh_completions'))
190 190
191 install_data(zsh_files, install_dir: zsh_install_dir) 191 install_data(zsh_files, install_dir: zsh_install_dir)
192endif 192endif
193
194if (get_option('bash_completions'))
195 bash_files = files(
196 'completions/bash/sway',
197 'completions/bash/swayidle',
198 'completions/bash/swaylock',
199 'completions/bash/swaymsg',
200 )
201 bash_install_dir = datadir + '/bash-completion/completions'
202
203 install_data(bash_files, install_dir: bash_install_dir)
204endif
diff --git a/meson_options.txt b/meson_options.txt
index 6c7f241d..7a23c206 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,5 @@
1option('sway_version', type : 'string', description: 'The version string reported in `sway --version`.') 1option('sway_version', type : 'string', description: 'The version string reported in `sway --version`.')
2option('default_wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.') 2option('default_wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.')
3option('zsh_completions', type: 'boolean', value: true, description: 'Install zsh shell completions.') 3option('zsh_completions', type: 'boolean', value: true, description: 'Install zsh shell completions.')
4option('bash_completions', type: 'boolean', value: true, description: 'Install bash shell completions.')
4option('enable-xwayland', type: 'boolean', value: true, description: 'Enable support for X11 applications') 5option('enable-xwayland', type: 'boolean', value: true, description: 'Enable support for X11 applications')
diff --git a/security.d/00-defaults.in b/security.d/00-defaults.in
index e4626477..be7b9d06 100644
--- a/security.d/00-defaults.in
+++ b/security.d/00-defaults.in
@@ -12,7 +12,6 @@
12permit * fullscreen keyboard mouse 12permit * fullscreen keyboard mouse
13permit @prefix@/bin/swaylock lock 13permit @prefix@/bin/swaylock lock
14permit @prefix@/bin/swaybg background 14permit @prefix@/bin/swaybg background
15permit @prefix@/bin/swaygrab screenshot
16permit @prefix@/bin/swaybar panel 15permit @prefix@/bin/swaybar panel
17 16
18# Configures enabled IPC features for specific programs 17# Configures enabled IPC features for specific programs
@@ -36,11 +35,6 @@ ipc @prefix@/bin/swaybar {
36 } 35 }
37} 36}
38 37
39ipc @prefix@/bin/swaygrab {
40 outputs enabled
41 tree enabled
42}
43
44ipc @prefix@/bin/swaylock { 38ipc @prefix@/bin/swaylock {
45 outputs enabled 39 outputs enabled
46} 40}
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index d9ccb00d..6b2eb0c2 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -522,14 +522,10 @@ static void handle_transform(struct wl_listener *listener, void *data) {
522 transaction_commit_dirty(); 522 transaction_commit_dirty();
523} 523}
524 524
525static void handle_scale_iterator(struct sway_container *view, void *data) {
526 view_update_marks_textures(view->sway_view);
527}
528
529static void handle_scale(struct wl_listener *listener, void *data) { 525static void handle_scale(struct wl_listener *listener, void *data) {
530 struct sway_output *output = wl_container_of(listener, output, scale); 526 struct sway_output *output = wl_container_of(listener, output, scale);
531 arrange_layers(output); 527 arrange_layers(output);
532 container_descendants(output->swayc, C_VIEW, handle_scale_iterator, NULL); 528 container_update_textures_recursive(output->swayc);
533 arrange_windows(output->swayc); 529 arrange_windows(output->swayc);
534 transaction_commit_dirty(); 530 transaction_commit_dirty();
535} 531}
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 390ca580..398446f8 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -69,11 +69,13 @@ static void unmanaged_handle_map(struct wl_listener *listener, void *data) {
69 surface->ly = xsurface->y; 69 surface->ly = xsurface->y;
70 desktop_damage_surface(xsurface->surface, surface->lx, surface->ly, true); 70 desktop_damage_surface(xsurface->surface, surface->lx, surface->ly, true);
71 71
72 struct sway_seat *seat = input_manager_current_seat(input_manager); 72 if (wlr_xwayland_or_surface_wants_focus(xsurface)) {
73 struct wlr_xwayland *xwayland = 73 struct sway_seat *seat = input_manager_current_seat(input_manager);
74 seat->input->server->xwayland.wlr_xwayland; 74 struct wlr_xwayland *xwayland =
75 wlr_xwayland_set_seat(xwayland, seat->wlr_seat); 75 seat->input->server->xwayland.wlr_xwayland;
76 seat_set_focus_surface(seat, xsurface->surface, false); 76 wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
77 seat_set_focus_surface(seat, xsurface->surface, false);
78 }
77} 79}
78 80
79static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) { 81static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) {
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 8dc8239c..160ef10b 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -264,6 +264,7 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) {
264 } 264 }
265 265
266 // Identify and execute active pressed binding 266 // Identify and execute active pressed binding
267 struct sway_binding *next_repeat_binding = NULL;
267 if (event->state == WLR_KEY_PRESSED) { 268 if (event->state == WLR_KEY_PRESSED) {
268 struct sway_binding *binding_pressed = NULL; 269 struct sway_binding *binding_pressed = NULL;
269 get_active_binding(&keyboard->state_keycodes, 270 get_active_binding(&keyboard->state_keycodes,
@@ -279,6 +280,21 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) {
279 if (binding_pressed) { 280 if (binding_pressed) {
280 seat_execute_command(seat, binding_pressed); 281 seat_execute_command(seat, binding_pressed);
281 handled = true; 282 handled = true;
283 next_repeat_binding = binding_pressed;
284 }
285 }
286
287 // Set up (or clear) keyboard repeat for a pressed binding
288 if (next_repeat_binding && wlr_device->keyboard->repeat_info.delay > 0) {
289 keyboard->repeat_binding = next_repeat_binding;
290 if (wl_event_source_timer_update(keyboard->key_repeat_source,
291 wlr_device->keyboard->repeat_info.delay) < 0) {
292 wlr_log(WLR_DEBUG, "failed to set key repeat timer");
293 }
294 } else if (keyboard->repeat_binding) {
295 keyboard->repeat_binding = NULL;
296 if (wl_event_source_timer_update(keyboard->key_repeat_source, 0) < 0) {
297 wlr_log(WLR_DEBUG, "failed to disarm key repeat timer");
282 } 298 }
283 } 299 }
284 300
@@ -303,6 +319,26 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) {
303 transaction_commit_dirty(); 319 transaction_commit_dirty();
304} 320}
305 321
322static int handle_keyboard_repeat(void *data) {
323 struct sway_keyboard *keyboard = (struct sway_keyboard *)data;
324 struct wlr_keyboard *wlr_device =
325 keyboard->seat_device->input_device->wlr_device->keyboard;
326 if (keyboard->repeat_binding) {
327 if (wlr_device->repeat_info.rate > 0) {
328 // We queue the next event first, as the command might cancel it
329 if (wl_event_source_timer_update(keyboard->key_repeat_source,
330 1000 / wlr_device->repeat_info.rate) < 0) {
331 wlr_log(WLR_DEBUG, "failed to update key repeat timer");
332 }
333 }
334
335 seat_execute_command(keyboard->seat_device->sway_seat,
336 keyboard->repeat_binding);
337 transaction_commit_dirty();
338 }
339 return 0;
340}
341
306static void handle_keyboard_modifiers(struct wl_listener *listener, 342static void handle_keyboard_modifiers(struct wl_listener *listener,
307 void *data) { 343 void *data) {
308 struct sway_keyboard *keyboard = 344 struct sway_keyboard *keyboard =
@@ -328,6 +364,9 @@ struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat,
328 wl_list_init(&keyboard->keyboard_key.link); 364 wl_list_init(&keyboard->keyboard_key.link);
329 wl_list_init(&keyboard->keyboard_modifiers.link); 365 wl_list_init(&keyboard->keyboard_modifiers.link);
330 366
367 keyboard->key_repeat_source = wl_event_loop_add_timer(server.wl_event_loop,
368 handle_keyboard_repeat, keyboard);
369
331 return keyboard; 370 return keyboard;
332} 371}
333 372
@@ -441,5 +480,6 @@ void sway_keyboard_destroy(struct sway_keyboard *keyboard) {
441 } 480 }
442 wl_list_remove(&keyboard->keyboard_key.link); 481 wl_list_remove(&keyboard->keyboard_key.link);
443 wl_list_remove(&keyboard->keyboard_modifiers.link); 482 wl_list_remove(&keyboard->keyboard_modifiers.link);
483 wl_event_source_remove(keyboard->key_repeat_source);
444 free(keyboard); 484 free(keyboard);
445} 485}
diff --git a/sway/sway.1.scd b/sway/sway.1.scd
index 5b770cce..0c2ee974 100644
--- a/sway/sway.1.scd
+++ b/sway/sway.1.scd
@@ -92,4 +92,4 @@ source contributors. For more information about sway development, see
92 92
93# SEE ALSO 93# SEE ALSO
94 94
95*sway*(5) *swaymsg*(1) *swaygrab*(1) *sway-input*(5) *sway-bar*(5) 95*sway*(5) *swaymsg*(1) *sway-input*(5) *sway-bar*(5)
diff --git a/sway/tree/container.c b/sway/tree/container.c
index b7442002..4e85021d 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -67,7 +67,7 @@ void container_create_notify(struct sway_container *container) {
67 } 67 }
68} 68}
69 69
70static void container_update_textures_recursive(struct sway_container *con) { 70void container_update_textures_recursive(struct sway_container *con) {
71 if (con->type == C_CONTAINER || con->type == C_VIEW) { 71 if (con->type == C_CONTAINER || con->type == C_VIEW) {
72 container_update_title_textures(con); 72 container_update_title_textures(con);
73 } 73 }
@@ -79,6 +79,10 @@ static void container_update_textures_recursive(struct sway_container *con) {
79 struct sway_container *child = con->children->items[i]; 79 struct sway_container *child = con->children->items[i];
80 container_update_textures_recursive(child); 80 container_update_textures_recursive(child);
81 } 81 }
82
83 if (con->type == C_WORKSPACE) {
84 container_update_textures_recursive(con->sway_workspace->floating);
85 }
82 } 86 }
83} 87}
84 88
diff --git a/swayidle/swayidle.1.scd b/swayidle/swayidle.1.scd
index 5cd4a7fd..7c1b138a 100644
--- a/swayidle/swayidle.1.scd
+++ b/swayidle/swayidle.1.scd
@@ -58,4 +58,4 @@ https://github.com/swaywm/sway.
58 58
59# SEE ALSO 59# SEE ALSO
60 60
61*sway*(5) *swaymsg*(1) *swaygrab*(1) *sway-input*(5) *sway-bar*(5) 61*sway*(5) *swaymsg*(1) *sway-input*(5) *sway-bar*(5)