Skip to content

Commit

Permalink
Move config parsing into the main loop.
Browse files Browse the repository at this point in the history
Some platforms (e.g wayland) require keymap initialization before the input
parsing routines (and hence config validation) work.
  • Loading branch information
rvaiya committed Sep 5, 2022
1 parent 1780157 commit a312bd3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v1.3.3
- Fix wayland initialization issue

# v1.3.2
- Improve config handling (allow for shadowed values to gracefully handle conflicts)
- Make undo keys in hint based modes configurable
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
COMMIT=$(shell git rev-parse --short HEAD)
VERSION=1.3.2
VERSION=1.3.3
DESTDIR=
PREFIX=/usr

Expand Down
10 changes: 7 additions & 3 deletions src/warpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ static int movearg_y = -1;
static int record_flag = 0;
static int drag_flag = 0;

static const char *config_path;

static int oneshot_mode = 0;

static int activation_loop(int mode)
Expand Down Expand Up @@ -148,11 +150,15 @@ static int activation_loop(int mode)

static void mode_loop()
{
parse_config(config_path);

exit(activation_loop(mode_flag));
}

static void daemon_loop()
{
parse_config(config_path);

init_mouse();
init_hints();

Expand Down Expand Up @@ -328,7 +334,7 @@ int main(int argc, char *argv[])
{
int c;
int foreground = 0;
const char *config_path = get_config_path("config");
config_path = get_config_path("config");

struct option opts[] = {
{"version", no_argument, NULL, 'v'},
Expand Down Expand Up @@ -416,8 +422,6 @@ int main(int argc, char *argv[])
}
}

parse_config(config_path);

if (mode_flag || oneshot_mode) {
platform_run(mode_loop);
} else {
Expand Down

0 comments on commit a312bd3

Please sign in to comment.