Spaces to Tabs

master
Luminarys 9 years ago
parent 68beabda03
commit 7c02a1967b

@ -79,10 +79,10 @@ int cmd_exec(struct sway_config *config, int argc, char **argv) {
return 1; return 1;
} }
if (config->reloading) { if (config->reloading) {
sway_log(L_DEBUG, "Ignoring exec %s due to reload", join_args(argv, argc)); sway_log(L_DEBUG, "Ignoring exec %s due to reload", join_args(argv, argc));
return 0; return 0;
} }
if (fork() == 0) { if (fork() == 0) {
char *args = join_args(argv, argc); char *args = join_args(argv, argc);
@ -190,7 +190,7 @@ int cmd_reload(struct sway_config *config, int argc, char **argv) {
if (!f) { if (!f) {
sway_log(L_ERROR, "Sway config file not found, aborting reload!"); sway_log(L_ERROR, "Sway config file not found, aborting reload!");
free(temp); free(temp);
return 1; return 1;
} }
free(temp); free(temp);
config = read_config(f, true); config = read_config(f, true);

@ -4,8 +4,8 @@
#include "config.h" #include "config.h"
struct cmd_handler { struct cmd_handler {
char *command; char *command;
int (*handle)(struct sway_config *config, int argc, char **argv); int (*handle)(struct sway_config *config, int argc, char **argv);
}; };
int handle_command(struct sway_config *config, char *command); int handle_command(struct sway_config *config, char *command);

@ -18,16 +18,16 @@ void config_defaults(struct sway_config *config) {
// Flags // Flags
config->focus_follows_mouse = true; config->focus_follows_mouse = true;
config->mouse_warping = true; config->mouse_warping = true;
config->reloading = false; config->reloading = false;
} }
struct sway_config *read_config(FILE *file, bool is_active) { struct sway_config *read_config(FILE *file, bool is_active) {
struct sway_config *config = malloc(sizeof(struct sway_config)); struct sway_config *config = malloc(sizeof(struct sway_config));
config_defaults(config); config_defaults(config);
if (is_active) { if (is_active) {
config->reloading = true; config->reloading = true;
} }
bool success = true; bool success = true;
@ -61,9 +61,9 @@ _continue:
exit(1); exit(1);
} }
if (is_active) { if (is_active) {
config->reloading = true; config->reloading = true;
} }
return config; return config;
} }

@ -6,31 +6,31 @@
#include "list.h" #include "list.h"
struct sway_variable { struct sway_variable {
char *name; char *name;
char *value; char *value;
}; };
struct sway_binding { struct sway_binding {
list_t *keys; list_t *keys;
uint32_t modifiers; uint32_t modifiers;
char *command; char *command;
}; };
struct sway_mode { struct sway_mode {
char *name; char *name;
list_t *bindings; list_t *bindings;
}; };
struct sway_config { struct sway_config {
list_t *symbols; list_t *symbols;
list_t *modes; list_t *modes;
struct sway_mode *current_mode; struct sway_mode *current_mode;
// Flags // Flags
bool focus_follows_mouse; bool focus_follows_mouse;
bool mouse_warping; bool mouse_warping;
bool reloading; bool reloading;
}; };
struct sway_config *read_config(FILE *file, bool is_active); struct sway_config *read_config(FILE *file, bool is_active);

@ -5,38 +5,38 @@
#include "list.h" #include "list.h"
struct sway_container { struct sway_container {
wlc_handle handle; wlc_handle handle;
enum { enum {
C_ROOT, C_ROOT,
C_OUTPUT, C_OUTPUT,
C_WORKSPACE, C_WORKSPACE,
C_CONTAINER, C_CONTAINER,
C_VIEW C_VIEW
} type; } type;
enum { enum {
L_NONE, L_NONE,
L_HORIZ, L_HORIZ,
L_VERT, L_VERT,
L_STACKED, L_STACKED,
L_TABBED, L_TABBED,
L_FLOATING L_FLOATING
} layout; } layout;
// Not including borders or margins // Not including borders or margins
int width, height; int width, height;
int x, y; int x, y;
int weight; int weight;
char *name; char *name;
list_t *children; list_t *children;
struct sway_container *parent; struct sway_container *parent;
struct sway_container *focused; struct sway_container *focused;
}; };
typedef struct sway_container swayc_t; typedef struct sway_container swayc_t;

@ -2,9 +2,9 @@
#define _SWAY_LIST_H #define _SWAY_LIST_H
typedef struct { typedef struct {
int capacity; int capacity;
int length; int length;
void **items; void **items;
} list_t; } list_t;
list_t *create_list(); list_t *create_list();

@ -18,7 +18,7 @@ void init_log(int verbosity) {
} }
void sway_log_colors(int mode) { void sway_log_colors(int mode) {
colored = (mode == 1) ? 1 : 0; colored = (mode == 1) ? 1 : 0;
} }
void sway_abort(char *format, ...) { void sway_abort(char *format, ...) {

@ -2,10 +2,10 @@
#define _SWAY_LOG_H #define _SWAY_LOG_H
typedef enum { typedef enum {
L_SILENT = 0, L_SILENT = 0,
L_ERROR = 1, L_ERROR = 1,
L_INFO = 2, L_INFO = 2,
L_DEBUG = 3, L_DEBUG = 3,
} log_importance_t; } log_importance_t;
void init_log(int verbosity); void init_log(int verbosity);

Loading…
Cancel
Save