Codebase list i3-gaps / 08ef435
Merge remote-tracking branch 'vanilla/next' into gaps-next Ingo Bürk 3 years ago
9 changed file(s) with 87 addition(s) and 83 deletion(s). Raw diff Collapse all Expand all
3333 # # TODO(autotools-removal): autoconf build has to keep working until i3 4.19
3434 # is released, so we keep building it in travis.
3535 - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Werror -fno-common"'
36 - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'rm -rf build; mkdir -p build && cd build && CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Werror -fno-common" meson .. -Ddocs=true -Dmans=true -Db_sanitize=address && ninja -v && mkdir ../distbuild && cd ../distbuild && meson .. -Ddocs=true -Dmans=true && ninja -v dist'
36 - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'rm -rf build; mkdir -p build && cd build && CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Werror -fno-common" meson .. -Ddocs=true -Dmans=true -Db_sanitize=address && ninja -v'
3737 - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-spelling.pl
3838 - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} ./travis/run-tests.sh
39 - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'rm -rf distbuild; mkdir distbuild && cd distbuild && meson .. -Ddocs=true -Dmans=true && ninja -v dist'
3940 - ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/debian-build.sh deb/debian-amd64/DIST
4041 - ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME_UBUNTU} ./travis/debian-build.sh deb/ubuntu-amd64/DIST
4142 - ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME_386} linux32 ./travis/debian-build.sh deb/debian-i386/DIST
4141 • build: correctly provide auxiliary functions when needed
4242 • build: fix issues with parallel build
4343 • set _NET_DESKTOP_VIEWPORT after randr changes
44 • fix a bug with i3-nagbar not starting after it has already started once
142142 void start_nagbar(pid_t *nagbar_pid, char *argv[]);
143143
144144 /**
145 * Kills the i3-nagbar process, if *nagbar_pid != -1.
145 * Kills the i3-nagbar process, if nagbar_pid != -1.
146146 *
147147 * If wait_for_it is set (restarting i3), this function will waitpid(),
148148 * otherwise, ev is assumed to handle it (reloading).
149149 *
150150 */
151 void kill_nagbar(pid_t *nagbar_pid, bool wait_for_it);
151 void kill_nagbar(pid_t nagbar_pid, bool wait_for_it);
152152
153153 /**
154154 * Converts a string into a long using strtol().
124124 endforeach
125125
126126 else
127 install_data(
128 [
129 'docs/hacking-howto.html',
130 'docs/userguide.html',
131 'docs/ipc.html',
132 'docs/multi-monitor.html',
133 'docs/wsbar.html',
134 'docs/testsuite.html',
135 'docs/i3bar-protocol.html',
136 'docs/layout-saving.html',
137 'docs/debugging.html',
138 ],
139 install_dir: docdir,
140 )
127 if run_command('[', '-f', 'docs/hacking-howto.html', ']').returncode() == 0
128 install_data(
129 [
130 'docs/hacking-howto.html',
131 'docs/userguide.html',
132 'docs/ipc.html',
133 'docs/multi-monitor.html',
134 'docs/wsbar.html',
135 'docs/testsuite.html',
136 'docs/i3bar-protocol.html',
137 'docs/layout-saving.html',
138 'docs/debugging.html',
139 ],
140 install_dir: docdir,
141 )
142 endif
141143 endif
142144
143145 install_data(
263265 endforeach
264266
265267 else
266 install_data(
267 [
268 'man/i3.1',
269 'man/i3bar.1',
270 'man/i3-msg.1',
271 'man/i3-input.1',
272 'man/i3-nagbar.1',
273 'man/i3-config-wizard.1',
274 'man/i3-migrate-config-to-v4.1',
275 'man/i3-sensible-editor.1',
276 'man/i3-sensible-pager.1',
277 'man/i3-sensible-terminal.1',
278 'man/i3-dump-log.1',
279 'man/i3-dmenu-desktop.1',
280 'man/i3-save-tree.1',
281 ],
282 install_dir: man1,
283 )
268 if run_command('[', '-f', 'man/i3.1', ']').returncode() == 0
269 install_data(
270 [
271 'man/i3.1',
272 'man/i3bar.1',
273 'man/i3-msg.1',
274 'man/i3-input.1',
275 'man/i3-nagbar.1',
276 'man/i3-config-wizard.1',
277 'man/i3-migrate-config-to-v4.1',
278 'man/i3-sensible-editor.1',
279 'man/i3-sensible-pager.1',
280 'man/i3-sensible-terminal.1',
281 'man/i3-dump-log.1',
282 'man/i3-dmenu-desktop.1',
283 'man/i3-save-tree.1',
284 ],
285 install_dir: man1,
286 )
287 endif
284288 endif
285289
286290 if meson.version().version_compare('>=0.53')
16141614 */
16151615 void cmd_reload(I3_CMD) {
16161616 LOG("reloading\n");
1617 kill_nagbar(&config_error_nagbar_pid, false);
1618 kill_nagbar(&command_error_nagbar_pid, false);
1617
1618 kill_nagbar(config_error_nagbar_pid, false);
1619 kill_nagbar(command_error_nagbar_pid, false);
1620 /* start_nagbar() will refuse to start a new process if the passed pid is
1621 * set. This will happen when our child watcher is triggered by libev when
1622 * the loop re-starts. However, config errors might be detected before
1623 * that since we will read the config right now with load_configuration.
1624 * See #4104. */
1625 config_error_nagbar_pid = command_error_nagbar_pid = -1;
1626
16191627 load_configuration(NULL, C_RELOAD);
16201628 x_set_i3_atoms();
16211629 /* Send an IPC event just in case the ws names have changed */
180180 ipc_shutdown(SHUTDOWN_REASON_EXIT, -1);
181181 unlink(config.ipc_socket_path);
182182 xcb_disconnect(conn);
183
184 /* If a nagbar is active, kill it */
185 kill_nagbar(config_error_nagbar_pid, false);
186 kill_nagbar(command_error_nagbar_pid, false);
183187
184188 /* We need ev >= 4 for the following code. Since it is not *that* important (it
185189 * only makes sure that there are no i3-nagbar instances left behind) we still
286286 void i3_restart(bool forget_layout) {
287287 char *restart_filename = forget_layout ? NULL : store_restart_layout();
288288
289 kill_nagbar(&config_error_nagbar_pid, true);
290 kill_nagbar(&command_error_nagbar_pid, true);
289 kill_nagbar(config_error_nagbar_pid, true);
290 kill_nagbar(command_error_nagbar_pid, true);
291291
292292 restore_geometry();
293293
335335 static void nagbar_exited(EV_P_ ev_child *watcher, int revents) {
336336 ev_child_stop(EV_A_ watcher);
337337
338 int exitcode = WEXITSTATUS(watcher->rstatus);
338339 if (!WIFEXITED(watcher->rstatus)) {
339 ELOG("ERROR: i3-nagbar did not exit normally.\n");
340 return;
341 }
342
343 int exitcode = WEXITSTATUS(watcher->rstatus);
344 DLOG("i3-nagbar process exited with status %d\n", exitcode);
345 if (exitcode == 2) {
346 ELOG("ERROR: i3-nagbar could not be found. Is it correctly installed on your system?\n");
347 }
348
349 *((pid_t *)watcher->data) = -1;
350 }
351
352 /*
353 * Cleanup handler. Will be called when i3 exits. Kills i3-nagbar with signal
354 * SIGKILL (9) to make sure there are no left-over i3-nagbar processes.
355 *
356 */
357 static void nagbar_cleanup(EV_P_ ev_cleanup *watcher, int revent) {
358 pid_t *nagbar_pid = (pid_t *)watcher->data;
359 if (*nagbar_pid != -1) {
360 LOG("Sending SIGKILL (%d) to i3-nagbar with PID %d\n", SIGKILL, *nagbar_pid);
361 kill(*nagbar_pid, SIGKILL);
340 ELOG("i3-nagbar (%d) did not exit normally. This is not an error if the config was reloaded while a nagbar was active.\n", watcher->pid);
341 } else if (exitcode != 0) {
342 ELOG("i3-nagbar (%d) process exited with status %d\n", watcher->pid, exitcode);
343 } else {
344 DLOG("i3-nagbar (%d) process exited with status %d\n", watcher->pid, exitcode);
345 }
346
347 pid_t *nagbar_pid = watcher->data;
348 if (*nagbar_pid == watcher->pid) {
349 /* Only reset if the watched nagbar is the active nagbar */
350 *nagbar_pid = -1;
362351 }
363352 }
364353
394383 ev_child_init(child, &nagbar_exited, *nagbar_pid, 0);
395384 child->data = nagbar_pid;
396385 ev_child_start(main_loop, child);
397
398 /* install a cleanup watcher (will be called when i3 exits and i3-nagbar is
399 * still running) */
400 ev_cleanup *cleanup = smalloc(sizeof(ev_cleanup));
401 ev_cleanup_init(cleanup, nagbar_cleanup);
402 cleanup->data = nagbar_pid;
403 ev_cleanup_start(main_loop, cleanup);
404 }
405
406 /*
407 * Kills the i3-nagbar process, if *nagbar_pid != -1.
386 }
387
388 /*
389 * Kills the i3-nagbar process, if nagbar_pid != -1.
408390 *
409391 * If wait_for_it is set (restarting i3), this function will waitpid(),
410392 * otherwise, ev is assumed to handle it (reloading).
411393 *
412394 */
413 void kill_nagbar(pid_t *nagbar_pid, bool wait_for_it) {
414 if (*nagbar_pid == -1)
395 void kill_nagbar(pid_t nagbar_pid, bool wait_for_it) {
396 if (nagbar_pid == -1)
415397 return;
416398
417 if (kill(*nagbar_pid, SIGTERM) == -1)
399 if (kill(nagbar_pid, SIGTERM) == -1)
418400 warn("kill(configerror_nagbar) failed");
419401
420402 if (!wait_for_it)
424406 * exec(), our old pid is no longer watched. So, ev won’t handle SIGCHLD
425407 * for us and we would end up with a <defunct> process. Therefore we
426408 * waitpid() here. */
427 waitpid(*nagbar_pid, NULL, 0);
409 waitpid(nagbar_pid, NULL, 0);
428410 }
429411
430412 /*
44
55 DEST=$1
66
7 cd build
7 cd distbuild
88 # unpack dist tarball
99 mkdir -p "${DEST}"
1010 tar xf meson-dist/*.tar.xz -C "${DEST}" --strip-components=1
22 set -e
33 set -x
44
5 for f in $(grep '\.html$' debian/i3-wm.docs | grep -v 'docs/refcard.html' | grep -v 'docs/lib-i3test')
5 # TODO: install the docs via meson, inject styles with an option
6
7 for f in $(sed -n "s/^\s*'\(docs\/.*\)',$/\1/gp" meson.build | grep -vF .)
68 do
79 asciidoc -a linkcss -a stylesdir=https://i3wm.org/css -a scriptsdir=https://i3wm.org/js --backend=xhtml11 -f docs/asciidoc-git.conf $(dirname $f)/$(basename $f .html)
810 done
11
912 ./docs/i3-pod2html --stylesurl=https://i3wm.org/css i3-dmenu-desktop man/i3-dmenu-desktop.html
1013 ./docs/i3-pod2html --stylesurl=https://i3wm.org/css i3-save-tree man/i3-save-tree.html
11 ./docs/i3-pod2html --stylesurl=https://i3wm.org/css build/testcases/lib/i3test.pm docs/lib-i3test.html
14 ./docs/i3-pod2html --stylesurl=https://i3wm.org/css build/i3test.pm docs/lib-i3test.html
1215 ./docs/i3-pod2html --stylesurl=https://i3wm.org/css testcases/lib/i3test/Test.pm docs/lib-i3test-test.html
13 for file in $(sed 's/\.1$/.man/g' debian/i3-wm.manpages)
16
17 for file in $(sed -n "s/^\s*'\(man\/.*\).man',$/\1.man/gp" meson.build)
1418 do
1519 [ -f "$file" ] && asciidoc -a linkcss -a stylesdir=https://i3wm.org/css -a scriptsdir=https://i3wm.org/js --backend=xhtml11 -f docs/asciidoc-git.conf "$file"
1620 done
1721
1822 mkdir -p deb/COPY-DOCS
1923
20 cp $(tr "\n" ' ' < debian/i3-wm.docs) deb/COPY-DOCS/
21 cp $(sed 's/\.1$/.html/g' debian/i3-wm.manpages | tr "\n" ' ') deb/COPY-DOCS/
24 cp $(sed -n "s/^\s*'\(docs\/.*\)',$/\1/gp" meson.build | grep -F .) deb/COPY-DOCS/
25 cp $(sed -n "s/^\s*'\(man\/.*\).man',$/\1.html/gp" meson.build) deb/COPY-DOCS/