Commit Graph

7009 Commits

Author SHA1 Message Date
Orestis Floros
c9f8183841
Merge pull request #4114 from orestisfl/i3bar-regression
Fix swapped cmd_bar_{mode,hidden_state}
2020-05-31 12:15:20 +02:00
Ingo Bürk
51d6ddf323
Merge pull request #4115 from ammgws/pwoerdocs
i3bar: improve docs for battery saving feature
2020-05-31 11:07:58 +02:00
Jason Nader
cf94ce6c2b
i3bar: improve docs for battery saving feature 2020-05-31 17:06:07 +09:00
Orestis Floros
ae9613576f
Fix swapped cmd_bar_{mode,hidden_state}
Mentioned in
fb2677f5f4 (r39550195)
2020-05-30 16:46:14 +02:00
Orestis Floros
dd13398e04
Merge pull request #4106 from orestisfl/nagbar
Improve handling of nagbar processes
2020-05-24 15:16:08 +02:00
Orestis Floros
00ffa68a6c
Move nagbar cleanup to i3_exit
Otherwise, each time we start a nagbar, a cleanup handler is created.
However, each of these handlers tries to kill the same process (->data
is a pointer to config_error_nagbar_pid / command_error_nagbar_pid).

With this commit, both potential nagbar processes are killed once.
2020-05-24 13:04:33 +02:00
Orestis Floros
78595f1f68
Improve handling of nagbar processes
Other changes in nagbar_exited:
- Remove ERROR from ELOG as it shows up as "ERROR: ERROR:"
- Make sure to reset the PID even when the process did not exit
normally.
- Use ELOG when exitcode != 0
- Remove the not found error: if nagbar is not in $PATH, exec_i3_utility
prints an error as well.

For the record, I also implemented a more complicated approach with a
new watcher data structure:
bd3aaf3a33
While writing the commit message, it occurred to me to compare
watcher->pid with *watcher->data, which fixes the problems mentioned in
that patch.

Fixes #4104
2020-05-24 13:04:33 +02:00
Orestis Floros
6e087d4a20
kill_nagbar: No need for pointer to pid_t 2020-05-24 13:04:33 +02:00
Orestis Floros
9aa28f357f
Merge pull request #4100 from stapelberg/meson-fixes
meson: only install docs/man pages when they exist (release tarball)
2020-05-19 22:44:47 +02:00
Michael Stapelberg
bec3887fc8 meson: only install docs/man pages when they exist (release tarball)
related to #4086
2020-05-19 22:28:21 +02:00
Michael Stapelberg
d09ed08668
Merge pull request #4098 from stapelberg/meson-fixes
More CI fixes
2020-05-19 22:12:06 +02:00
Michael Stapelberg
abf9b18f12 docs.sh: no longer rely on now-deleted debian/i3-wm.{manpages,docs}
related to #4086
2020-05-19 20:27:50 +02:00
Michael Stapelberg
be1065f62d debian-build: s/build/distbuild/
related to #4086
2020-05-19 20:27:50 +02:00
Michael Stapelberg
4544a6d595 travis: build dist tarball after running tests
This way, users get more detailed feedback about new test failures.

related to #4086
2020-05-19 20:27:50 +02:00
Michael Stapelberg
0c0aef84fa
Merge pull request #4096 from stapelberg/meson-fixes
meson fixes for unbreaking the Debian/Ubuntu package builds on Travis
2020-05-19 19:59:42 +02:00
Michael Stapelberg
571eec861e debian: remove i3-wm.{docs,manpages}, meson installs them
related to #4086
2020-05-19 19:36:56 +02:00
Michael Stapelberg
315f646876 meson: install docs from release tarball
related to #4086
2020-05-19 19:36:56 +02:00
Michael Stapelberg
2e23412f5d debian-build: use release tarball from build step
…instead of building a release tarball over and over again.

This has become an issue as meson insists on running tests before creating a
release tarball (which is a good policy).

related to #4086
2020-05-19 19:36:56 +02:00
Michael Stapelberg
0bea175b51 disable dh_autoreconf
We still have autotools in the tree, so this is not a no-op yet.

related to #4086
2020-05-19 19:07:53 +02:00
Michael Stapelberg
ff6c2d2214 debian: set buildsystem to meson, not meson+ninja
The latter fails on Ubuntu, presumably due to an older debhelper version.

related to #4086
2020-05-19 19:07:51 +02:00
Michael Stapelberg
97e477777e meson: install static documentation files
related to #4086
2020-05-19 19:07:48 +02:00
Michael Stapelberg
693eee0c03 meson: make docdir configurable
The debian package wants to install docs to $datadir/doc/i3-wm.

related to #4086
2020-05-19 19:07:45 +02:00
Michael Stapelberg
aba6ec3e52
add meson build files (#4094)
Motivation:

• faster builds (on an Intel Core i9-9900K):
  ( ../configure --disable-sanitizers && make -j8; )
  19,47s user 2,78s system 395% cpu 5,632 total

  ( meson .. -Dmans=true -Ddocs=true -Dprefix=/usr && ninja; )
  38,67s user 3,73s system 1095% cpu 3,871 total

• more approachable build system configuration in the
  python-esque meson domain specific language instead of
  the autotools m4 macro language

• built-in language server support thanks to ninja:
  the required compile_commands.json is built automatically
  and only needs to be linked from the source dir, e.g.:
  ln -s build/compile_commands.json .

Changes:

• the embedded vcs version info format changed from e.g.
  4.18-282-gabe46f69 (2020-05-16, branch "next")
  to:
  4.18-282-gabe46f69
  I think it’s better to lose a little bit of detail for
  the gained cleanliness of using meson’s vcs_tag()

• Drop unused xcb-event dependency.

• We can no longer enable sanitizers and debug options
  based on whether we are in a release or non-release build,
  because our new version logic runs at ninja build time,
  not at meson configure time.

  The new behavior is probably for the better in terms of
  what people expect, and we can make the CI use address sanitizer
  explicitly to ensure it is still exercised.

• We lose the AX_EXTEND_SRCDIR behavior, i.e. including the
  path component of the parent of the source dir in all paths.
  This was a trick we used for easier debugging, so that stack
  traces would contain e.g. ../i3-4.18.1/src/main.c, instead of
  just src/main.c.

  The other mechanism (_i3_version symbol) that we have for including
  the version number in the “backtrace full” (but not merely
  “backtrace”) output of gdb still works.

• Release tarballs now use tar.xz. Why not.

Migration plan

This commit adds the meson build files to the tree, but does not remove
autotools yet. For the development phase, we will keep both build systems
functional (and built on travis).

Then, just before the i3 v4.19 release, we will remove autotools from the tree
and the release tarball will require meson to compile.

This way, we incentivize maintainers to change, while also offering them an easy
way out (if desired) by reverting the most recent commit. In practice, switching
a distribution package from autotools to meson should only be a few line change,
easier than applying the provided patch :). Take a look at the debian/ changes
in this commit for an example.

meson is broadly available everywhere that i3 is available: Both xorg-server and
systemd gained meson build files in 2017, so we can follow suit:
https://anholt.livejournal.com/52574.html
https://in.waw.pl/~zbyszek/blog/systemd-meson.html

How do I?

For producing a coverage report, enable the b_coverage meson base option
and run ninja coverage-html:
% cd build
% meson .. -Db_coverage=true
% ninja
% ninja test
% ninja coverage-html
See also https://mesonbuild.com/howtox.html#producing-a-coverage-report

For using the address sanitizer, memory sanitizer or undefined behavior
sanitizer, use the b_sanitize meson base option:
% cd build
% meson .. -Db_sanitize=address
% ninja
See also https://mesonbuild.com/Builtin-options.html#base-options

related to #4086
2020-05-19 14:45:06 +02:00
Michael Stapelberg
ef8935b1db
autotools: place binaries in top level of build dir, not in subdirs (#4093)
meson only supports the top level (no subdirs), so this makes the transition
easier.

For this to work with autotools, we need to *disable* the subdir-objects option,
that autotools wants us to enable for forward-compatibility.

This results in a bunch of warnings at autoreconf-time, but we don’t care, given
that we intend to switch away from autotools. Both build systems working next to
each other (as best as they can) is more important.

related to #4086
2020-05-18 22:18:00 +02:00
Orestis Floros
75963cd088
Merge pull request #4092 from stapelberg/fixup
update forgotten srcdir AnyEvent-I3 reference, remove xmacro files
2020-05-18 21:23:43 +02:00
Michael Stapelberg
ddebce8a7f update forgotten srcdir AnyEvent-I3 reference, remove xmacro files
Both oversights in the previous commits.
2020-05-18 20:40:07 +02:00
Orestis Floros
7a4354f42a
Merge pull request #4088 from stapelberg/san
free(socket_path) to suppress leak sanitizer false-positive with -O2
2020-05-18 18:25:19 +02:00
Michael Stapelberg
ed0d6acebd free(socket_path) to suppress leak sanitizer false-positive with -O2
related to #4086 (triggered by our meson config)
related to #4087 (sanitizer cleanup tracking bug)
2020-05-18 17:08:53 +02:00
Orestis Floros
f233245a6c
Merge pull request #4089 from stapelberg/xmacro
xmacro: declare in header files, instantiate instead of include
2020-05-18 09:54:51 +02:00
Orestis Floros
c06fd161f8
Merge pull request #4090 from stapelberg/any
build AnyEvent::I3 in build dir, not source dir
2020-05-18 00:30:15 +02:00
Michael Stapelberg
84397ceb54 build AnyEvent::I3 in build dir, not source dir
related to #4086
2020-05-17 17:27:03 +02:00
Michael Stapelberg
1b8ddd5fd1 xmacro: declare in header files, instantiate instead of include
This works better with meson, where .h files can be declared as being part of an
executable easily, but I couldn’t find a way to declare
e.g. include/atoms.xmacro as a dependency.

related to #4086
2020-05-17 16:38:43 +02:00
Ingo Bürk
08052ddeb9
Merge pull request #4084 from orestisfl/get_output_by_name_primary_active
get_output_by_name: guard output->primary with require_active
2020-05-15 10:02:58 +02:00
Orestis Floros
0fb56a92d0
get_output_by_name: guard output->primary with require_active
This is related to #4048 but might not fix it completely. Either way,
this should be the correct behaviour of the function.
2020-05-14 21:53:21 +02:00
Ingo Bürk
4d929003ea
Merge pull request #4081 from orestisfl/i3bar-regression
i3bar mode: Fix regression: bar_id can be NULL
2020-05-14 08:34:48 +02:00
Orestis Floros
fb2677f5f4
cmd_bar: Fix regression with invalid modes
This is another regression from #4014: multiple arrows in a row mean
optional values. Re-introduce new states to force matching & proper
parser errors.
2020-05-14 00:40:09 +02:00
Orestis Floros
9eb2458b55
cmd_bar: Fix regression: bar_id can be NULL
Regression introduced by #4014
Fixes #4080
2020-05-14 00:39:25 +02:00
Orestis Floros
f63a4bef54
cmd_bar improvements (#4014)
- Split cmd_bar into 2 functions, improving errors and reducing strcmps
- Only update barconfig when something has changed
- Only update barconfig for the specific bar that has changed

Fixes #3958
2020-05-07 09:22:03 +02:00
Orestis Floros
142b3fa945
Merge pull request #4054 from orestisfl/randr-ewmh
randr_query_outputs: call ewmh_update_desktop_properties
2020-05-06 17:32:45 +02:00
Orestis Floros
0877e35439
Merge pull request #4055 from orestisfl/rofi
Mention rofi in default config file
2020-05-06 17:31:09 +02:00
Orestis Floros
e4629d678e
Merge pull request #4057 from orestisfl/hacking-howto
Update first 1/3 of hacking-howto document
2020-05-06 17:30:58 +02:00
Orestis Floros
94b619e118
randr_query_outputs: call ewmh_update_desktop_properties
Fixes #4053
2020-05-06 17:26:49 +02:00
Orestis Floros
9a1c272900
Mention rofi in default config file
Fixes #2482
2020-05-06 17:25:52 +02:00
Orestis Floros
4b97027034
hacking-howto: Add warning 2020-05-06 17:25:28 +02:00
Orestis Floros
cdf5ccbed8
hacking-howto: Update 'data structures' section
- Includes updated bigpicture.png from dump-asy.pl script
- The X11 root window is not a container
- Adds some extra information

bigpicture.png is created by converting the .asy to an .eps with `asy
bigpicture .eps` and then using the following gs command:
gs -dSAFER -dBATCH -dNOPAUSE -dEPSCrop -r600 -sDEVICE=pngalpha -sOutputFile=bigpicture.png bigpicture.eps
2020-05-06 17:25:28 +02:00
Orestis Floros
c7b6edf810
hacking-howto: Update 'files' section
Instead of sorting alphanumerically, use a more opinionated order,
listing more "important" files towards the beginning.

Info in this section was a bit outdated. First of all, i3 contains many
more files that were not mentioned. Instead of trying to include
everything, I deleted some files with very obvious descriptions. We can
always re-add something if we want to add more details to it.
2020-05-06 17:25:28 +02:00
Orestis Floros
516363a86b
hacking-howto: Mention "stacking" window managers 2020-05-06 17:25:28 +02:00
Orestis Floros
a0ca5ffe70
hacking-howto: Update git section
This still had some leftovers from the patch era. Since git and
specifically GitHub-like developing is much more mainstream now we don't
need to link introductions or even mention the idea of "patching".

The deleted "them" was referencing an old sentence referring to patches,
generated by the git cli. As emailing patches is not common at all for
GitHub repos, I removed the sentence altogether.

Also simplifies the 'branches' subsection a bit. Asking people to verify
their patch on master seems too much preliminary work and I doubt that
anyone does it anyway.
2020-05-06 17:25:28 +02:00
Orestis Floros
4f0a93c3d9
hacking-howto: Update 'build system' section
Mention new --disable flags
2020-05-06 17:25:27 +02:00
Orestis Floros
0963159368
hacking-howto: Normalize code highlighting 2020-05-06 17:25:14 +02:00