summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Zandr Martin <zandrmartin@gmail.com>2016-09-02 13:46:19 -0500
committerLibravatar Zandr Martin <zandrmartin@gmail.com>2016-09-02 13:46:19 -0500
commit79ffea328c992c5109406771a59a9f016d85970d (patch)
tree5d965e72127f227ea0a38dc5c6e4fc14e08d9498
parentrefactor commands.c (diff)
parentMerge pull request #878 from lukaslihotzki/master (diff)
downloadsway-79ffea328c992c5109406771a59a9f016d85970d.tar.gz
sway-79ffea328c992c5109406771a59a9f016d85970d.tar.zst
sway-79ffea328c992c5109406771a59a9f016d85970d.zip
Merge branch 'master' of git://github.com/SirCmpwn/sway into commands-refactor
-rw-r--r--README.md1
-rw-r--r--common/ipc-client.c11
-rw-r--r--common/log.c16
-rw-r--r--common/util.c7
-rw-r--r--include/sway/border.h (renamed from include/border.h)0
-rw-r--r--include/sway/commands.h (renamed from include/commands.h)0
-rw-r--r--include/sway/config.h (renamed from include/config.h)0
-rw-r--r--include/sway/container.h (renamed from include/container.h)0
-rw-r--r--include/sway/criteria.h (renamed from include/criteria.h)0
-rw-r--r--include/sway/extensions.h (renamed from include/extensions.h)0
-rw-r--r--include/sway/focus.h (renamed from include/focus.h)0
-rw-r--r--include/sway/handlers.h (renamed from include/handlers.h)0
-rw-r--r--include/sway/input.h (renamed from include/input.h)0
-rw-r--r--include/sway/input_state.h (renamed from include/input_state.h)0
-rw-r--r--include/sway/ipc-json.h (renamed from include/ipc-json.h)0
-rw-r--r--include/sway/ipc-server.h (renamed from include/ipc-server.h)0
-rw-r--r--include/sway/layout.h (renamed from include/layout.h)0
-rw-r--r--include/sway/output.h (renamed from include/output.h)0
-rw-r--r--include/sway/resize.h (renamed from include/resize.h)0
-rw-r--r--include/sway/workspace.h (renamed from include/workspace.h)0
-rw-r--r--include/swaybar/bar.h (renamed from include/bar/bar.h)0
-rw-r--r--include/swaybar/config.h (renamed from include/bar/config.h)0
-rw-r--r--include/swaybar/ipc.h (renamed from include/bar/ipc.h)0
-rw-r--r--include/swaybar/render.h (renamed from include/bar/render.h)0
-rw-r--r--include/swaybar/status_line.h (renamed from include/bar/status_line.h)0
-rw-r--r--include/swaylock/swaylock.h (renamed from include/lock/lock.h)0
-rw-r--r--sway/border.c6
-rw-r--r--sway/commands.c30
-rw-r--r--sway/config.c14
-rw-r--r--sway/container.c20
-rw-r--r--sway/criteria.c6
-rw-r--r--sway/debug_log.c2
-rw-r--r--sway/extensions.c22
-rw-r--r--sway/focus.c30
-rw-r--r--sway/handlers.c35
-rw-r--r--sway/input.c4
-rw-r--r--sway/input_state.c5
-rw-r--r--sway/ipc-json.c4
-rw-r--r--sway/ipc-server.c12
-rw-r--r--sway/layout.c24
-rw-r--r--sway/main.c18
-rw-r--r--sway/output.c2
-rw-r--r--sway/resize.c10
-rw-r--r--sway/sway.5.txt3
-rw-r--r--sway/workspace.c20
-rw-r--r--swaybar/bar.c11
-rw-r--r--swaybar/config.c2
-rw-r--r--swaybar/ipc.c5
-rw-r--r--swaybar/main.c2
-rw-r--r--swaybar/render.c6
-rw-r--r--swaybar/status_line.c4
-rw-r--r--swaylock/main.c3
52 files changed, 162 insertions, 173 deletions
diff --git a/README.md b/README.md
index 4ea135e7..fc086bb1 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,7 @@ Sway is not supported by many distributions yet. Here's a list of packages
28available for you to install: 28available for you to install:
29 29
30* [Arch Linux](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#arch) 30* [Arch Linux](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#arch)
31* [Fedora](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#fedora)
31* [Gentoo](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#gentoo) 32* [Gentoo](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#gentoo)
32* [NixOS](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#nixos) 33* [NixOS](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#nixos)
33* [openSUSE Tumbleweed](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#opensuse) 34* [openSUSE Tumbleweed](https://github.com/SirCmpwn/sway/wiki/Install-from-packages#opensuse)
diff --git a/common/ipc-client.c b/common/ipc-client.c
index e155c168..106f9d86 100644
--- a/common/ipc-client.c
+++ b/common/ipc-client.c
@@ -1,16 +1,13 @@
1#include <stdint.h>
1#include <stdio.h> 2#include <stdio.h>
2#include <stdlib.h> 3#include <stdlib.h>
3#include <string.h> 4#include <string.h>
4#include <getopt.h>
5#include <stdint.h>
6#include <sys/un.h>
7#include <sys/socket.h> 5#include <sys/socket.h>
6#include <sys/un.h>
8#include <unistd.h> 7#include <unistd.h>
9#include "log.h"
10#include "stringop.h"
11#include "ipc.h"
12#include "readline.h"
13#include "ipc-client.h" 8#include "ipc-client.h"
9#include "readline.h"
10#include "log.h"
14 11
15static const char ipc_magic[] = {'i', '3', '-', 'i', 'p', 'c'}; 12static const char ipc_magic[] = {'i', '3', '-', 'i', 'p', 'c'};
16static const size_t ipc_header_size = sizeof(ipc_magic)+8; 13static const size_t ipc_header_size = sizeof(ipc_magic)+8;
diff --git a/common/log.c b/common/log.c
index 1da2ba2f..4f0baa3f 100644
--- a/common/log.c
+++ b/common/log.c
@@ -1,17 +1,15 @@
1#include "log.h" 1#include <errno.h>
2#include "sway.h" 2#include <libgen.h>
3#include "readline.h" 3#include <signal.h>
4#include <stdarg.h> 4#include <stdarg.h>
5#include <stdio.h> 5#include <stdio.h>
6#include <stdlib.h> 6#include <stdlib.h>
7#include <libgen.h>
8#include <fcntl.h>
9#include <unistd.h> 7#include <unistd.h>
10#include <signal.h>
11#include <time.h>
12#include <errno.h>
13#include <string.h> 8#include <string.h>
14#include <stringop.h> 9#include <time.h>
10#include "log.h"
11#include "sway.h"
12#include "readline.h"
15 13
16static int colored = 1; 14static int colored = 1;
17static log_importance_t loglevel_default = L_ERROR; 15static log_importance_t loglevel_default = L_ERROR;
diff --git a/common/util.c b/common/util.c
index f0b0fdf0..f2302676 100644
--- a/common/util.c
+++ b/common/util.c
@@ -1,10 +1,13 @@
1#include <math.h> 1#include <math.h>
2#include <stdint.h>
2#include <stdio.h> 3#include <stdio.h>
3#include <string.h>
4#include <stdlib.h> 4#include <stdlib.h>
5#include <string.h>
6#include <wlc/wlc.h>
7#include <xkbcommon/xkbcommon-names.h>
8#include "log.h"
5#include "readline.h" 9#include "readline.h"
6#include "util.h" 10#include "util.h"
7#include "log.h"
8 11
9int wrap(int i, int max) { 12int wrap(int i, int max) {
10 return ((i % max) + max) % max; 13 return ((i % max) + max) % max;
diff --git a/include/border.h b/include/sway/border.h
index c30c9da3..c30c9da3 100644
--- a/include/border.h
+++ b/include/sway/border.h
diff --git a/include/commands.h b/include/sway/commands.h
index f646c412..f646c412 100644
--- a/include/commands.h
+++ b/include/sway/commands.h
diff --git a/include/config.h b/include/sway/config.h
index 56deaf01..56deaf01 100644
--- a/include/config.h
+++ b/include/sway/config.h
diff --git a/include/container.h b/include/sway/container.h
index 4dd7f3a0..4dd7f3a0 100644
--- a/include/container.h
+++ b/include/sway/container.h
diff --git a/include/criteria.h b/include/sway/criteria.h
index 5c71d172..5c71d172 100644
--- a/include/criteria.h
+++ b/include/sway/criteria.h
diff --git a/include/extensions.h b/include/sway/extensions.h
index f6b0c00e..f6b0c00e 100644
--- a/include/extensions.h
+++ b/include/sway/extensions.h
diff --git a/include/focus.h b/include/sway/focus.h
index b532edc2..b532edc2 100644
--- a/include/focus.h
+++ b/include/sway/focus.h
diff --git a/include/handlers.h b/include/sway/handlers.h
index 956b98f4..956b98f4 100644
--- a/include/handlers.h
+++ b/include/sway/handlers.h
diff --git a/include/input.h b/include/sway/input.h
index 4ed9bffe..4ed9bffe 100644
--- a/include/input.h
+++ b/include/sway/input.h
diff --git a/include/input_state.h b/include/sway/input_state.h
index 903301fb..903301fb 100644
--- a/include/input_state.h
+++ b/include/sway/input_state.h
diff --git a/include/ipc-json.h b/include/sway/ipc-json.h
index 02b07a23..02b07a23 100644
--- a/include/ipc-json.h
+++ b/include/sway/ipc-json.h
diff --git a/include/ipc-server.h b/include/sway/ipc-server.h
index 1d199134..1d199134 100644
--- a/include/ipc-server.h
+++ b/include/sway/ipc-server.h
diff --git a/include/layout.h b/include/sway/layout.h
index b982365c..b982365c 100644
--- a/include/layout.h
+++ b/include/sway/layout.h
diff --git a/include/output.h b/include/sway/output.h
index e8afd5ed..e8afd5ed 100644
--- a/include/output.h
+++ b/include/sway/output.h
diff --git a/include/resize.h b/include/sway/resize.h
index 0d382994..0d382994 100644
--- a/include/resize.h
+++ b/include/sway/resize.h
diff --git a/include/workspace.h b/include/sway/workspace.h
index c268fafa..c268fafa 100644
--- a/include/workspace.h
+++ b/include/sway/workspace.h
diff --git a/include/bar/bar.h b/include/swaybar/bar.h
index a3c511d9..a3c511d9 100644
--- a/include/bar/bar.h
+++ b/include/swaybar/bar.h
diff --git a/include/bar/config.h b/include/swaybar/config.h
index 934116ca..934116ca 100644
--- a/include/bar/config.h
+++ b/include/swaybar/config.h
diff --git a/include/bar/ipc.h b/include/swaybar/ipc.h
index c11931d0..c11931d0 100644
--- a/include/bar/ipc.h
+++ b/include/swaybar/ipc.h
diff --git a/include/bar/render.h b/include/swaybar/render.h
index 114f43f4..114f43f4 100644
--- a/include/bar/render.h
+++ b/include/swaybar/render.h
diff --git a/include/bar/status_line.h b/include/swaybar/status_line.h
index 9b77e8a7..9b77e8a7 100644
--- a/include/bar/status_line.h
+++ b/include/swaybar/status_line.h
diff --git a/include/lock/lock.h b/include/swaylock/swaylock.h
index 1cf66e89..1cf66e89 100644
--- a/include/lock/lock.h
+++ b/include/swaylock/swaylock.h
diff --git a/sway/border.c b/sway/border.c
index 5cb02274..65f69411 100644
--- a/sway/border.c
+++ b/sway/border.c
@@ -1,12 +1,12 @@
1#include "border.h"
2#include <wlc/wlc-render.h> 1#include <wlc/wlc-render.h>
3#include <cairo/cairo.h> 2#include <cairo/cairo.h>
4#include <pango/pangocairo.h> 3#include <pango/pangocairo.h>
5#include <stdlib.h> 4#include <stdlib.h>
6#include <stdio.h> 5#include <stdio.h>
7#include <arpa/inet.h> 6#include <arpa/inet.h>
8#include "container.h" 7#include "sway/border.h"
9#include "config.h" 8#include "sway/container.h"
9#include "sway/config.h"
10#include "client/pango.h" 10#include "client/pango.h"
11 11
12void cairo_set_source_u32(cairo_t *cairo, uint32_t color) { 12void cairo_set_source_u32(cairo_t *cairo, uint32_t color) {
diff --git a/sway/commands.c b/sway/commands.c
index 7b0780ec..54c104b2 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -16,24 +16,24 @@
16#include <limits.h> 16#include <limits.h>
17#include <float.h> 17#include <float.h>
18#include <libinput.h> 18#include <libinput.h>
19#include "sway/layout.h"
20#include "sway/focus.h"
21#include "sway/workspace.h"
22#include "sway/commands.h"
23#include "sway/container.h"
24#include "sway/output.h"
25#include "sway/handlers.h"
26#include "sway/resize.h"
27#include "sway/input_state.h"
28#include "sway/criteria.h"
29#include "sway/ipc-server.h"
30#include "sway/input.h"
31#include "sway/border.h"
19#include "stringop.h" 32#include "stringop.h"
20#include "layout.h"
21#include "focus.h"
22#include "log.h"
23#include "util.h"
24#include "workspace.h"
25#include "commands.h"
26#include "container.h"
27#include "output.h"
28#include "handlers.h"
29#include "sway.h" 33#include "sway.h"
30#include "resize.h" 34#include "util.h"
31#include "input_state.h"
32#include "criteria.h"
33#include "ipc-server.h"
34#include "list.h" 35#include "list.h"
35#include "input.h" 36#include "log.h"
36#include "border.h"
37 37
38struct cmd_handler { 38struct cmd_handler {
39 char *command; 39 char *command;
diff --git a/sway/config.c b/sway/config.c
index bed233bd..a187fe3e 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -12,17 +12,17 @@
12#include <limits.h> 12#include <limits.h>
13#include <float.h> 13#include <float.h>
14#include "wayland-desktop-shell-server-protocol.h" 14#include "wayland-desktop-shell-server-protocol.h"
15#include "sway/commands.h"
16#include "sway/config.h"
17#include "sway/layout.h"
18#include "sway/input_state.h"
19#include "sway/criteria.h"
20#include "sway/input.h"
21#include "sway/border.h"
15#include "readline.h" 22#include "readline.h"
16#include "stringop.h" 23#include "stringop.h"
17#include "list.h" 24#include "list.h"
18#include "log.h" 25#include "log.h"
19#include "commands.h"
20#include "config.h"
21#include "layout.h"
22#include "input_state.h"
23#include "criteria.h"
24#include "input.h"
25#include "border.h"
26 26
27struct sway_config *config = NULL; 27struct sway_config *config = NULL;
28 28
diff --git a/sway/container.c b/sway/container.c
index c922bac3..5614293c 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -3,17 +3,17 @@
3#include <stdbool.h> 3#include <stdbool.h>
4#include <strings.h> 4#include <strings.h>
5#include <string.h> 5#include <string.h>
6#include "config.h" 6#include "sway/config.h"
7#include "stringop.h" 7#include "sway/container.h"
8#include "container.h" 8#include "sway/workspace.h"
9#include "workspace.h" 9#include "sway/focus.h"
10#include "focus.h" 10#include "sway/border.h"
11#include "border.h" 11#include "sway/layout.h"
12#include "layout.h" 12#include "sway/input_state.h"
13#include "input_state.h" 13#include "sway/ipc-server.h"
14#include "sway/output.h"
14#include "log.h" 15#include "log.h"
15#include "ipc-server.h" 16#include "stringop.h"
16#include "output.h"
17 17
18#define ASSERT_NONNULL(PTR) \ 18#define ASSERT_NONNULL(PTR) \
19 sway_assert (PTR, #PTR "must be non-null") 19 sway_assert (PTR, #PTR "must be non-null")
diff --git a/sway/criteria.c b/sway/criteria.c
index 53435d29..739a183e 100644
--- a/sway/criteria.c
+++ b/sway/criteria.c
@@ -2,12 +2,12 @@
2#include <stdio.h> 2#include <stdio.h>
3#include <stdbool.h> 3#include <stdbool.h>
4#include <regex.h> 4#include <regex.h>
5#include "criteria.h" 5#include "sway/criteria.h"
6#include "sway/container.h"
7#include "sway/config.h"
6#include "stringop.h" 8#include "stringop.h"
7#include "list.h" 9#include "list.h"
8#include "log.h" 10#include "log.h"
9#include "container.h"
10#include "config.h"
11 11
12enum criteria_type { // *must* keep in sync with criteria_strings[] 12enum criteria_type { // *must* keep in sync with criteria_strings[]
13 CRIT_CLASS, 13 CRIT_CLASS,
diff --git a/sway/debug_log.c b/sway/debug_log.c
index 7c988464..8d891a44 100644
--- a/sway/debug_log.c
+++ b/sway/debug_log.c
@@ -10,7 +10,7 @@
10#include <errno.h> 10#include <errno.h>
11#include <string.h> 11#include <string.h>
12#include <stringop.h> 12#include <stringop.h>
13#include "workspace.h" 13#include "sway/workspace.h"
14 14
15/* XXX:DEBUG:XXX */ 15/* XXX:DEBUG:XXX */
16static void container_log(const swayc_t *c, int depth) { 16static void container_log(const swayc_t *c, int depth) {
diff --git a/sway/extensions.c b/sway/extensions.c
index 4611f33e..60cd8d41 100644
--- a/sway/extensions.c
+++ b/sway/extensions.c
@@ -4,11 +4,11 @@
4#include <wlc/wlc-render.h> 4#include <wlc/wlc-render.h>
5#include "wayland-desktop-shell-server-protocol.h" 5#include "wayland-desktop-shell-server-protocol.h"
6#include "wayland-swaylock-server-protocol.h" 6#include "wayland-swaylock-server-protocol.h"
7#include "layout.h" 7#include "sway/layout.h"
8#include "sway/input_state.h"
9#include "sway/extensions.h"
10#include "sway/ipc-server.h"
8#include "log.h" 11#include "log.h"
9#include "input_state.h"
10#include "extensions.h"
11#include "ipc-server.h"
12 12
13struct desktop_shell_state desktop_shell; 13struct desktop_shell_state desktop_shell;
14 14
@@ -119,27 +119,21 @@ static void set_lock_surface(struct wl_client *client, struct wl_resource *resou
119 if (!swayc_is_child_of(view, workspace)) { 119 if (!swayc_is_child_of(view, workspace)) {
120 move_container_to(view, workspace); 120 move_container_to(view, workspace);
121 } 121 }
122 // make the view floating so it doesn't rearrange other 122 // make the view floating so it doesn't rearrange other siblings.
123 // siblings.
124 if (!view->is_floating) { 123 if (!view->is_floating) {
125 // Remove view from its current location
126 destroy_container(remove_child(view)); 124 destroy_container(remove_child(view));
127 // and move it into workspace floating
128 add_floating(workspace, view); 125 add_floating(workspace, view);
129 } 126 }
130 wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true); 127 wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true);
131 workspace->fullscreen = view; 128 wlc_view_bring_to_front(view->handle);
132 ipc_event_window(view, "fullscreen_mode"); 129 wlc_view_focus(view->handle);
133 desktop_shell.is_locked = true; 130 desktop_shell.is_locked = true;
134 // reset input state
135 input_init(); 131 input_init();
136 // set focus if the lockscreen is spawned on the currently 132 arrange_windows(workspace, -1, -1);
137 // active output
138 swayc_t *focus_output = swayc_active_output(); 133 swayc_t *focus_output = swayc_active_output();
139 if (focus_output == output) { 134 if (focus_output == output) {
140 set_focused_container(view); 135 set_focused_container(view);
141 } 136 }
142 arrange_windows(workspace, -1, -1);
143 list_add(desktop_shell.lock_surfaces, surface); 137 list_add(desktop_shell.lock_surfaces, surface);
144 wl_resource_set_destructor(surface, lock_surface_destructor); 138 wl_resource_set_destructor(surface, lock_surface_destructor);
145 } else { 139 } else {
diff --git a/sway/focus.c b/sway/focus.c
index 145e5584..02e61ac2 100644
--- a/sway/focus.c
+++ b/sway/focus.c
@@ -1,13 +1,13 @@
1#include <wlc/wlc.h> 1#include <wlc/wlc.h>
2 2#include "sway/focus.h"
3#include "focus.h" 3#include "sway/workspace.h"
4#include "sway/layout.h"
5#include "sway/config.h"
6#include "sway/extensions.h"
7#include "sway/input_state.h"
8#include "sway/ipc-server.h"
9#include "sway/border.h"
4#include "log.h" 10#include "log.h"
5#include "workspace.h"
6#include "layout.h"
7#include "config.h"
8#include "input_state.h"
9#include "ipc-server.h"
10#include "border.h"
11 11
12bool locked_container_focus = false; 12bool locked_container_focus = false;
13bool suspend_workspace_cleanup = false; 13bool suspend_workspace_cleanup = false;
@@ -89,7 +89,6 @@ swayc_t *get_focused_container(swayc_t *parent) {
89 if (!parent) { 89 if (!parent) {
90 return swayc_active_workspace(); 90 return swayc_active_workspace();
91 } 91 }
92 // get focused container
93 while (!parent->is_focused && parent->focused) { 92 while (!parent->is_focused && parent->focused) {
94 parent = parent->focused; 93 parent = parent->focused;
95 } 94 }
@@ -133,24 +132,24 @@ bool set_focused_container(swayc_t *c) {
133 p->is_focused = false; 132 p->is_focused = false;
134 } 133 }
135 134
136 // get new focused view and set focus to it.
137 if (!(wlc_view_get_type(p->handle) & WLC_BIT_POPUP)) { 135 if (!(wlc_view_get_type(p->handle) & WLC_BIT_POPUP)) {
138 // unactivate previous focus
139 if (focused->type == C_VIEW) { 136 if (focused->type == C_VIEW) {
140 wlc_view_set_state(focused->handle, WLC_BIT_ACTIVATED, false); 137 wlc_view_set_state(focused->handle, WLC_BIT_ACTIVATED, false);
141 } 138 }
142 update_container_border(focused); 139 update_container_border(focused);
143 // activate current focus
144 if (c->type == C_VIEW) { 140 if (c->type == C_VIEW) {
145 wlc_view_set_state(c->handle, WLC_BIT_ACTIVATED, true); 141 wlc_view_set_state(c->handle, WLC_BIT_ACTIVATED, true);
146 } 142 }
147 // set focus 143 if (!desktop_shell.is_locked) {
148 wlc_view_focus(c->handle); 144 // If the system is locked, we do everything _but_ actually setting
145 // focus. This includes making our internals think that this view is
146 // focused.
147 wlc_view_focus(c->handle);
148 }
149 if (c->parent->layout != L_TABBED && c->parent->layout != L_STACKED) { 149 if (c->parent->layout != L_TABBED && c->parent->layout != L_STACKED) {
150 update_container_border(c); 150 update_container_border(c);
151 } 151 }
152 152
153 // rearrange if parent container is tabbed/stacked
154 swayc_t *parent = swayc_tabbed_stacked_ancestor(c); 153 swayc_t *parent = swayc_tabbed_stacked_ancestor(c);
155 if (parent != NULL) { 154 if (parent != NULL) {
156 arrange_backgrounds(); 155 arrange_backgrounds();
@@ -175,7 +174,6 @@ bool set_focused_container_for(swayc_t *a, swayc_t *c) {
175 return false; 174 return false;
176 } 175 }
177 swayc_t *find = c; 176 swayc_t *find = c;
178 // Ensure that a is an ancestor of c
179 while (find != a && (find = find->parent)) { 177 while (find != a && (find = find->parent)) {
180 if (find == &root_container) { 178 if (find == &root_container) {
181 return false; 179 return false;
diff --git a/sway/handlers.c b/sway/handlers.c
index 846d0005..47af7bd5 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -7,25 +7,24 @@
7#include <wlc/wlc-render.h> 7#include <wlc/wlc-render.h>
8#include <wlc/wlc-wayland.h> 8#include <wlc/wlc-wayland.h>
9#include <ctype.h> 9#include <ctype.h>
10 10#include "sway/handlers.h"
11#include "handlers.h" 11#include "sway/border.h"
12#include "border.h" 12#include "sway/layout.h"
13#include "log.h" 13#include "sway/config.h"
14#include "layout.h" 14#include "sway/commands.h"
15#include "config.h" 15#include "sway/workspace.h"
16#include "commands.h" 16#include "sway/container.h"
17#include "stringop.h" 17#include "sway/output.h"
18#include "workspace.h" 18#include "sway/focus.h"
19#include "container.h" 19#include "sway/input_state.h"
20#include "output.h" 20#include "sway/resize.h"
21#include "focus.h" 21#include "sway/extensions.h"
22#include "input_state.h" 22#include "sway/criteria.h"
23#include "resize.h" 23#include "sway/ipc-server.h"
24#include "extensions.h" 24#include "sway/input.h"
25#include "criteria.h"
26#include "ipc-server.h"
27#include "list.h" 25#include "list.h"
28#include "input.h" 26#include "stringop.h"
27#include "log.h"
29 28
30// Event should be sent to client 29// Event should be sent to client
31#define EVENT_PASSTHROUGH false 30#define EVENT_PASSTHROUGH false
diff --git a/sway/input.c b/sway/input.c
index 1f3e99e7..ae24cb49 100644
--- a/sway/input.c
+++ b/sway/input.c
@@ -4,8 +4,8 @@
4#include <stdio.h> 4#include <stdio.h>
5#include <string.h> 5#include <string.h>
6#include <libinput.h> 6#include <libinput.h>
7#include "config.h" 7#include "sway/config.h"
8#include "input.h" 8#include "sway/input.h"
9#include "list.h" 9#include "list.h"
10#include "log.h" 10#include "log.h"
11 11
diff --git a/sway/input_state.c b/sway/input_state.c
index 7e31d3d9..68df17de 100644
--- a/sway/input_state.c
+++ b/sway/input_state.c
@@ -1,10 +1,9 @@
1#include <string.h> 1#include <string.h>
2#include <stdbool.h> 2#include <stdbool.h>
3#include <ctype.h> 3#include <ctype.h>
4#include "sway/input_state.h"
5#include "sway/config.h"
4#include "log.h" 6#include "log.h"
5#include "config.h"
6
7#include "input_state.h"
8 7
9#define KEY_STATE_MAX_LENGTH 64 8#define KEY_STATE_MAX_LENGTH 64
10 9
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 1debca7b..3f03b9f1 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -2,9 +2,9 @@
2#include <ctype.h> 2#include <ctype.h>
3#include <string.h> 3#include <string.h>
4#include <stdint.h> 4#include <stdint.h>
5#include "container.h" 5#include "sway/container.h"
6#include "sway/ipc-json.h"
6#include "util.h" 7#include "util.h"
7#include "ipc-json.h"
8 8
9static json_object *ipc_json_create_rect(swayc_t *c) { 9static json_object *ipc_json_create_rect(swayc_t *c) {
10 json_object *rect = json_object_new_object(); 10 json_object *rect = json_object_new_object();
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index 7039e348..70007f57 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -13,15 +13,15 @@
13#include <json-c/json.h> 13#include <json-c/json.h>
14#include <list.h> 14#include <list.h>
15#include <libinput.h> 15#include <libinput.h>
16#include "ipc-json.h" 16#include "sway/ipc-json.h"
17#include "ipc-server.h" 17#include "sway/ipc-server.h"
18#include "sway/config.h"
19#include "sway/commands.h"
20#include "sway/input.h"
21#include "stringop.h"
18#include "log.h" 22#include "log.h"
19#include "config.h"
20#include "commands.h"
21#include "list.h" 23#include "list.h"
22#include "stringop.h"
23#include "util.h" 24#include "util.h"
24#include "input.h"
25 25
26static int ipc_socket = -1; 26static int ipc_socket = -1;
27static struct wlc_event_source *ipc_event_source = NULL; 27static struct wlc_event_source *ipc_event_source = NULL;
diff --git a/sway/layout.c b/sway/layout.c
index 01c8e4e3..7f053d9b 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -2,17 +2,17 @@
2#include <stdbool.h> 2#include <stdbool.h>
3#include <math.h> 3#include <math.h>
4#include <wlc/wlc.h> 4#include <wlc/wlc.h>
5#include "extensions.h" 5#include "sway/extensions.h"
6#include "log.h" 6#include "sway/config.h"
7#include "sway/container.h"
8#include "sway/workspace.h"
9#include "sway/focus.h"
10#include "sway/output.h"
11#include "sway/ipc-server.h"
12#include "sway/border.h"
13#include "sway/layout.h"
7#include "list.h" 14#include "list.h"
8#include "config.h" 15#include "log.h"
9#include "container.h"
10#include "workspace.h"
11#include "focus.h"
12#include "output.h"
13#include "ipc-server.h"
14#include "border.h"
15#include "layout.h"
16 16
17swayc_t root_container; 17swayc_t root_container;
18list_t *scratchpad; 18list_t *scratchpad;
@@ -575,7 +575,7 @@ void update_geometry(swayc_t *container) {
575 575
576 // handle hide_edge_borders 576 // handle hide_edge_borders
577 if (config->hide_edge_borders != E_NONE && (gap <= 0 || (config->smart_gaps && workspace->children->length == 1))) { 577 if (config->hide_edge_borders != E_NONE && (gap <= 0 || (config->smart_gaps && workspace->children->length == 1))) {
578 if (config->hide_edge_borders == E_HORIZONTAL || config->hide_edge_borders == E_BOTH) { 578 if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) {
579 if (geometry.origin.x == workspace->x) { 579 if (geometry.origin.x == workspace->x) {
580 border_left = 0; 580 border_left = 0;
581 } 581 }
@@ -585,7 +585,7 @@ void update_geometry(swayc_t *container) {
585 } 585 }
586 } 586 }
587 587
588 if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) { 588 if (config->hide_edge_borders == E_HORIZONTAL || config->hide_edge_borders == E_BOTH) {
589 if (geometry.origin.y == workspace->y || should_hide_top_border(container, geometry.origin.y)) { 589 if (geometry.origin.y == workspace->y || should_hide_top_border(container, geometry.origin.y)) {
590 border_top = 0; 590 border_top = 0;
591 } 591 }
diff --git a/sway/main.c b/sway/main.c
index 51b12d20..972b260b 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -8,17 +8,17 @@
8#include <signal.h> 8#include <signal.h>
9#include <unistd.h> 9#include <unistd.h>
10#include <getopt.h> 10#include <getopt.h>
11#include "extensions.h" 11#include "sway/extensions.h"
12#include "layout.h" 12#include "sway/layout.h"
13#include "stringop.h" 13#include "sway/config.h"
14#include "config.h" 14#include "sway/handlers.h"
15#include "log.h" 15#include "sway/input.h"
16#include "readline.h" 16#include "sway/ipc-server.h"
17#include "handlers.h"
18#include "ipc-client.h" 17#include "ipc-client.h"
19#include "ipc-server.h" 18#include "readline.h"
20#include "input.h" 19#include "stringop.h"
21#include "sway.h" 20#include "sway.h"
21#include "log.h"
22 22
23static bool terminate_request = false; 23static bool terminate_request = false;
24static int exit_value = 0; 24static int exit_value = 0;
diff --git a/sway/output.c b/sway/output.c
index 97b8a4a6..b337b143 100644
--- a/sway/output.c
+++ b/sway/output.c
@@ -1,7 +1,7 @@
1#include <strings.h> 1#include <strings.h>
2#include <ctype.h> 2#include <ctype.h>
3#include <stdlib.h> 3#include <stdlib.h>
4#include "output.h" 4#include "sway/output.h"
5#include "log.h" 5#include "log.h"
6#include "list.h" 6#include "list.h"
7 7
diff --git a/sway/resize.c b/sway/resize.c
index 18bb86bb..b32d2431 100644
--- a/sway/resize.c
+++ b/sway/resize.c
@@ -1,11 +1,11 @@
1#include <wlc/wlc.h> 1#include <wlc/wlc.h>
2#include <math.h> 2#include <math.h>
3#include "layout.h" 3#include "sway/layout.h"
4#include "focus.h" 4#include "sway/focus.h"
5#include "sway/input_state.h"
6#include "sway/handlers.h"
7#include "sway/resize.h"
5#include "log.h" 8#include "log.h"
6#include "input_state.h"
7#include "handlers.h"
8#include "resize.h"
9 9
10static bool set_size_floating(int new_dimension, bool use_width) { 10static bool set_size_floating(int new_dimension, bool use_width) {
11 swayc_t *view = get_focused_float(swayc_active_workspace()); 11 swayc_t *view = get_focused_float(swayc_active_workspace());
diff --git a/sway/sway.5.txt b/sway/sway.5.txt
index 7de02a82..84e5e7c5 100644
--- a/sway/sway.5.txt
+++ b/sway/sway.5.txt
@@ -39,6 +39,9 @@ The following commands may only be used in the configuration file.
39**set** <name> <value>:: 39**set** <name> <value>::
40 Sets variable $name to _value_. You can use the new variable in the arguments 40 Sets variable $name to _value_. You can use the new variable in the arguments
41 of future commands. 41 of future commands.
42
43**orientation** <horizontal|vertical|auto>::
44 Sets the default container layout for tiled containers.
42 45
43The following commands cannot be used directly in the configuration file. 46The following commands cannot be used directly in the configuration file.
44They are expected to be used with **bindsym** or at runtime through **swaymsg**(1). 47They are expected to be used with **bindsym** or at runtime through **swaymsg**(1).
diff --git a/sway/workspace.c b/sway/workspace.c
index 9c3e69a9..7b24d7d9 100644
--- a/sway/workspace.c
+++ b/sway/workspace.c
@@ -6,18 +6,18 @@
6#include <string.h> 6#include <string.h>
7#include <strings.h> 7#include <strings.h>
8#include <sys/types.h> 8#include <sys/types.h>
9#include "ipc-server.h" 9#include "sway/ipc-server.h"
10#include "extensions.h" 10#include "sway/extensions.h"
11#include "workspace.h" 11#include "sway/workspace.h"
12#include "layout.h" 12#include "sway/layout.h"
13#include "list.h" 13#include "sway/container.h"
14#include "log.h" 14#include "sway/handlers.h"
15#include "container.h" 15#include "sway/config.h"
16#include "handlers.h" 16#include "sway/focus.h"
17#include "config.h"
18#include "stringop.h" 17#include "stringop.h"
19#include "focus.h"
20#include "util.h" 18#include "util.h"
19#include "list.h"
20#include "log.h"
21#include "ipc.h" 21#include "ipc.h"
22 22
23char *prev_workspace_name = NULL; 23char *prev_workspace_name = NULL;
diff --git a/swaybar/bar.c b/swaybar/bar.c
index e3e53622..c6596864 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -5,15 +5,14 @@
5#include <errno.h> 5#include <errno.h>
6#include <sys/wait.h> 6#include <sys/wait.h>
7#include <poll.h> 7#include <poll.h>
8 8#include "swaybar/ipc.h"
9#include "swaybar/render.h"
10#include "swaybar/config.h"
11#include "swaybar/status_line.h"
12#include "swaybar/bar.h"
9#include "ipc-client.h" 13#include "ipc-client.h"
10#include "list.h" 14#include "list.h"
11#include "log.h" 15#include "log.h"
12#include "bar/ipc.h"
13#include "bar/render.h"
14#include "bar/config.h"
15#include "bar/status_line.h"
16#include "bar/bar.h"
17 16
18static void bar_init(struct bar *bar) { 17static void bar_init(struct bar *bar) {
19 bar->config = init_config(); 18 bar->config = init_config();
diff --git a/swaybar/config.c b/swaybar/config.c
index b5dca668..c5437ee7 100644
--- a/swaybar/config.c
+++ b/swaybar/config.c
@@ -3,7 +3,7 @@
3 3
4#include "wayland-desktop-shell-client-protocol.h" 4#include "wayland-desktop-shell-client-protocol.h"
5#include "log.h" 5#include "log.h"
6#include "bar/config.h" 6#include "swaybar/config.h"
7 7
8uint32_t parse_position(const char *position) { 8uint32_t parse_position(const char *position) {
9 if (strcmp("top", position) == 0) { 9 if (strcmp("top", position) == 0) {
diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index ad4f9ef8..8d62d223 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -1,11 +1,10 @@
1#include <string.h> 1#include <string.h>
2#include <json-c/json.h> 2#include <json-c/json.h>
3 3#include "swaybar/config.h"
4#include "swaybar/ipc.h"
4#include "ipc-client.h" 5#include "ipc-client.h"
5#include "list.h" 6#include "list.h"
6#include "log.h" 7#include "log.h"
7#include "bar/config.h"
8#include "bar/ipc.h"
9 8
10void ipc_send_workspace_command(const char *workspace_name) { 9void ipc_send_workspace_command(const char *workspace_name) {
11 uint32_t size = strlen("workspace ") + strlen(workspace_name) + 1; 10 uint32_t size = strlen("workspace ") + strlen(workspace_name) + 1;
diff --git a/swaybar/main.c b/swaybar/main.c
index d7534f5d..c9a554a3 100644
--- a/swaybar/main.c
+++ b/swaybar/main.c
@@ -3,9 +3,9 @@
3#include <string.h> 3#include <string.h>
4#include <stdbool.h> 4#include <stdbool.h>
5#include <getopt.h> 5#include <getopt.h>
6#include "swaybar/bar.h"
6#include "ipc-client.h" 7#include "ipc-client.h"
7#include "log.h" 8#include "log.h"
8#include "bar/bar.h"
9 9
10/* global bar state */ 10/* global bar state */
11struct bar swaybar; 11struct bar swaybar;
diff --git a/swaybar/render.c b/swaybar/render.c
index cea36f52..83b4cec7 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -5,9 +5,9 @@
5#include "client/cairo.h" 5#include "client/cairo.h"
6#include "client/pango.h" 6#include "client/pango.h"
7#include "client/window.h" 7#include "client/window.h"
8#include "bar/config.h" 8#include "swaybar/config.h"
9#include "bar/status_line.h" 9#include "swaybar/status_line.h"
10#include "bar/render.h" 10#include "swaybar/render.h"
11 11
12 12
13/* internal spacing */ 13/* internal spacing */
diff --git a/swaybar/status_line.c b/swaybar/status_line.c
index 33a8908f..c7055d4c 100644
--- a/swaybar/status_line.c
+++ b/swaybar/status_line.c
@@ -3,9 +3,9 @@
3#include <unistd.h> 3#include <unistd.h>
4#include <json-c/json.h> 4#include <json-c/json.h>
5 5
6#include "swaybar/config.h"
7#include "swaybar/status_line.h"
6#include "log.h" 8#include "log.h"
7#include "bar/config.h"
8#include "bar/status_line.h"
9#include "util.h" 9#include "util.h"
10 10
11#define I3JSON_MAXDEPTH 4 11#define I3JSON_MAXDEPTH 4
diff --git a/swaylock/main.c b/swaylock/main.c
index 3049934e..0637453c 100644
--- a/swaylock/main.c
+++ b/swaylock/main.c
@@ -12,13 +12,12 @@
12#include <signal.h> 12#include <signal.h>
13#include <stdbool.h> 13#include <stdbool.h>
14#include <unistd.h> 14#include <unistd.h>
15
16#include "client/window.h" 15#include "client/window.h"
17#include "client/registry.h" 16#include "client/registry.h"
18#include "client/cairo.h" 17#include "client/cairo.h"
18#include "swaylock/swaylock.h"
19#include "ipc-client.h" 19#include "ipc-client.h"
20#include "log.h" 20#include "log.h"
21#include "lock/lock.h"
22 21
23struct registry *registry; 22struct registry *registry;
24struct render_data render_data; 23struct render_data render_data;