aboutsummaryrefslogtreecommitdiffstats
path: root/sway/main.c
diff options
context:
space:
mode:
authorLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-11-28 19:52:28 +0100
committerLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-11-28 20:35:57 +0100
commit20cb390323b19dc0c767ba63925def7f51c31044 (patch)
tree38969a7241aabcd2750117929ace19d2f3d5b1c0 /sway/main.c
parentAllow output config for output named * (diff)
downloadsway-20cb390323b19dc0c767ba63925def7f51c31044.tar.gz
sway-20cb390323b19dc0c767ba63925def7f51c31044.tar.zst
sway-20cb390323b19dc0c767ba63925def7f51c31044.zip
sway/main: Move wlc init to after args are handled.
First of all because it's not needed that early, and second of all because there's a bug where calling `sway --get-socketpath` via `popen` causes the child sway process to spin/hang instead of returning EOF. (Specifically `(unset SWAYSOCK; swaymsg)` hangs.) This patch fixes that. (Also note that this patch moves the "detailed review" comment, so I guess this patch requires extra detailed review?)
Diffstat (limited to 'sway/main.c')
-rw-r--r--sway/main.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/sway/main.c b/sway/main.c
index 19648782..dd609214 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -64,21 +64,7 @@ int main(int argc, char **argv) {
64 {0, 0, 0, 0} 64 {0, 0, 0, 0}
65 }; 65 };
66 66
67 setenv("WLC_DIM", "0", 0);
68
69 wlc_log_set_handler(wlc_log_handler);
70
71 detect_nvidia();
72
73 /* Changing code earlier than this point requires detailed review */
74 if (!wlc_init(&interface, argc, argv)) {
75 return 1;
76 }
77
78 register_extensions();
79
80 char *config_path = NULL; 67 char *config_path = NULL;
81
82 int c; 68 int c;
83 while (1) { 69 while (1) {
84 int option_index = 0; 70 int option_index = 0;
@@ -121,6 +107,18 @@ int main(int argc, char **argv) {
121 } 107 }
122 } 108 }
123 109
110 setenv("WLC_DIM", "0", 0);
111 wlc_log_set_handler(wlc_log_handler);
112 detect_nvidia();
113
114 /* Changing code earlier than this point requires detailed review */
115 /* (That code runs as root on systems without logind, and wlc_init drops to
116 * another user.) */
117 if (!wlc_init(&interface, argc, argv)) {
118 return 1;
119 }
120 register_extensions();
121
124 if (debug) { 122 if (debug) {
125 init_log(L_DEBUG); 123 init_log(L_DEBUG);
126 } else if (verbose || validate) { 124 } else if (verbose || validate) {