aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/commands.c10
-rw-r--r--sway/commands.h4
-rw-r--r--sway/config.c14
-rw-r--r--sway/config.h32
-rw-r--r--sway/layout.h48
-rw-r--r--sway/list.h6
-rw-r--r--sway/log.c2
-rw-r--r--sway/log.h8
8 files changed, 62 insertions, 62 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 5ed5e070..af24cc95 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -79,10 +79,10 @@ int cmd_exec(struct sway_config *config, int argc, char **argv) {
79 return 1; 79 return 1;
80 } 80 }
81 81
82 if (config->reloading) { 82 if (config->reloading) {
83 sway_log(L_DEBUG, "Ignoring exec %s due to reload", join_args(argv, argc)); 83 sway_log(L_DEBUG, "Ignoring exec %s due to reload", join_args(argv, argc));
84 return 0; 84 return 0;
85 } 85 }
86 86
87 if (fork() == 0) { 87 if (fork() == 0) {
88 char *args = join_args(argv, argc); 88 char *args = join_args(argv, argc);
@@ -190,7 +190,7 @@ int cmd_reload(struct sway_config *config, int argc, char **argv) {
190 if (!f) { 190 if (!f) {
191 sway_log(L_ERROR, "Sway config file not found, aborting reload!"); 191 sway_log(L_ERROR, "Sway config file not found, aborting reload!");
192 free(temp); 192 free(temp);
193 return 1; 193 return 1;
194 } 194 }
195 free(temp); 195 free(temp);
196 config = read_config(f, true); 196 config = read_config(f, true);
diff --git a/sway/commands.h b/sway/commands.h
index f99a5201..42b39f27 100644
--- a/sway/commands.h
+++ b/sway/commands.h
@@ -4,8 +4,8 @@
4#include "config.h" 4#include "config.h"
5 5
6struct cmd_handler { 6struct cmd_handler {
7 char *command; 7 char *command;
8 int (*handle)(struct sway_config *config, int argc, char **argv); 8 int (*handle)(struct sway_config *config, int argc, char **argv);
9}; 9};
10 10
11int handle_command(struct sway_config *config, char *command); 11int handle_command(struct sway_config *config, char *command);
diff --git a/sway/config.c b/sway/config.c
index da4fac84..280900ca 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -18,16 +18,16 @@ void config_defaults(struct sway_config *config) {
18 // Flags 18 // Flags
19 config->focus_follows_mouse = true; 19 config->focus_follows_mouse = true;
20 config->mouse_warping = true; 20 config->mouse_warping = true;
21 config->reloading = false; 21 config->reloading = false;
22} 22}
23 23
24struct sway_config *read_config(FILE *file, bool is_active) { 24struct sway_config *read_config(FILE *file, bool is_active) {
25 struct sway_config *config = malloc(sizeof(struct sway_config)); 25 struct sway_config *config = malloc(sizeof(struct sway_config));
26 config_defaults(config); 26 config_defaults(config);
27 27
28 if (is_active) { 28 if (is_active) {
29 config->reloading = true; 29 config->reloading = true;
30 } 30 }
31 31
32 bool success = true; 32 bool success = true;
33 33
@@ -61,9 +61,9 @@ _continue:
61 exit(1); 61 exit(1);
62 } 62 }
63 63
64 if (is_active) { 64 if (is_active) {
65 config->reloading = true; 65 config->reloading = true;
66 } 66 }
67 67
68 return config; 68 return config;
69} 69}
diff --git a/sway/config.h b/sway/config.h
index 6a50c445..733aaaae 100644
--- a/sway/config.h
+++ b/sway/config.h
@@ -6,31 +6,31 @@
6#include "list.h" 6#include "list.h"
7 7
8struct sway_variable { 8struct sway_variable {
9 char *name; 9 char *name;
10 char *value; 10 char *value;
11}; 11};
12 12
13struct sway_binding { 13struct sway_binding {
14 list_t *keys; 14 list_t *keys;
15 uint32_t modifiers; 15 uint32_t modifiers;
16 char *command; 16 char *command;
17}; 17};
18 18
19struct sway_mode { 19struct sway_mode {
20 char *name; 20 char *name;
21 list_t *bindings; 21 list_t *bindings;
22}; 22};
23 23
24struct sway_config { 24struct sway_config {
25 list_t *symbols; 25 list_t *symbols;
26 list_t *modes; 26 list_t *modes;
27 struct sway_mode *current_mode; 27 struct sway_mode *current_mode;
28 28
29 // Flags 29 // Flags
30 bool focus_follows_mouse; 30 bool focus_follows_mouse;
31 bool mouse_warping; 31 bool mouse_warping;
32 32
33 bool reloading; 33 bool reloading;
34}; 34};
35 35
36struct sway_config *read_config(FILE *file, bool is_active); 36struct sway_config *read_config(FILE *file, bool is_active);
diff --git a/sway/layout.h b/sway/layout.h
index b0aec42f..3a8f8902 100644
--- a/sway/layout.h
+++ b/sway/layout.h
@@ -5,38 +5,38 @@
5#include "list.h" 5#include "list.h"
6 6
7struct sway_container { 7struct sway_container {
8 wlc_handle handle; 8 wlc_handle handle;
9 9
10 enum { 10 enum {
11 C_ROOT, 11 C_ROOT,
12 C_OUTPUT, 12 C_OUTPUT,
13 C_WORKSPACE, 13 C_WORKSPACE,
14 C_CONTAINER, 14 C_CONTAINER,
15 C_VIEW 15 C_VIEW
16 } type; 16 } type;
17 17
18 enum { 18 enum {
19 L_NONE, 19 L_NONE,
20 L_HORIZ, 20 L_HORIZ,
21 L_VERT, 21 L_VERT,
22 L_STACKED, 22 L_STACKED,
23 L_TABBED, 23 L_TABBED,
24 L_FLOATING 24 L_FLOATING
25 } layout; 25 } layout;
26 26
27 // Not including borders or margins 27 // Not including borders or margins
28 int width, height; 28 int width, height;
29 29
30 int x, y; 30 int x, y;
31 31
32 int weight; 32 int weight;
33 33
34 char *name; 34 char *name;
35 35
36 list_t *children; 36 list_t *children;
37 37
38 struct sway_container *parent; 38 struct sway_container *parent;
39 struct sway_container *focused; 39 struct sway_container *focused;
40}; 40};
41 41
42typedef struct sway_container swayc_t; 42typedef struct sway_container swayc_t;
diff --git a/sway/list.h b/sway/list.h
index 93649fd5..e035ec4c 100644
--- a/sway/list.h
+++ b/sway/list.h
@@ -2,9 +2,9 @@
2#define _SWAY_LIST_H 2#define _SWAY_LIST_H
3 3
4typedef struct { 4typedef struct {
5 int capacity; 5 int capacity;
6 int length; 6 int length;
7 void **items; 7 void **items;
8} list_t; 8} list_t;
9 9
10list_t *create_list(); 10list_t *create_list();
diff --git a/sway/log.c b/sway/log.c
index f439e3b2..188461eb 100644
--- a/sway/log.c
+++ b/sway/log.c
@@ -18,7 +18,7 @@ void init_log(int verbosity) {
18} 18}
19 19
20void sway_log_colors(int mode) { 20void sway_log_colors(int mode) {
21 colored = (mode == 1) ? 1 : 0; 21 colored = (mode == 1) ? 1 : 0;
22} 22}
23 23
24void sway_abort(char *format, ...) { 24void sway_abort(char *format, ...) {
diff --git a/sway/log.h b/sway/log.h
index 03836513..e5075a39 100644
--- a/sway/log.h
+++ b/sway/log.h
@@ -2,10 +2,10 @@
2#define _SWAY_LOG_H 2#define _SWAY_LOG_H
3 3
4typedef enum { 4typedef enum {
5 L_SILENT = 0, 5 L_SILENT = 0,
6 L_ERROR = 1, 6 L_ERROR = 1,
7 L_INFO = 2, 7 L_INFO = 2,
8 L_DEBUG = 3, 8 L_DEBUG = 3,
9} log_importance_t; 9} log_importance_t;
10 10
11void init_log(int verbosity); 11void init_log(int verbosity);