sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 01617131f110a3a80987706ff6e86c46f2269255
parent 1661edee2808f5d293ce89bf46bd87faff25d654
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sat, 28 Nov 2015 14:39:46 -0500

Merge pull request #271 from sce/move_wlc_init

sway/main: Move wlc init to after args are handled.
Diffstat:
Msway/main.c | 26++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/sway/main.c b/sway/main.c @@ -64,21 +64,7 @@ int main(int argc, char **argv) { {0, 0, 0, 0} }; - setenv("WLC_DIM", "0", 0); - - wlc_log_set_handler(wlc_log_handler); - - detect_nvidia(); - - /* Changing code earlier than this point requires detailed review */ - if (!wlc_init(&interface, argc, argv)) { - return 1; - } - - register_extensions(); - char *config_path = NULL; - int c; while (1) { int option_index = 0; @@ -121,6 +107,18 @@ int main(int argc, char **argv) { } } + setenv("WLC_DIM", "0", 0); + wlc_log_set_handler(wlc_log_handler); + detect_nvidia(); + + /* Changing code earlier than this point requires detailed review */ + /* (That code runs as root on systems without logind, and wlc_init drops to + * another user.) */ + if (!wlc_init(&interface, argc, argv)) { + return 1; + } + register_extensions(); + if (debug) { init_log(L_DEBUG); } else if (verbose || validate) {