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.htmlhttps://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
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
- 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
Fixes#4039
Crash with docking clients where the floating field is set even though
floating_enable refuses to make them floating.
See issue for example with logs.
This is similar to #3820 but does not use qsort but an insertion sort in
con_attach.
Since each bar block automatically gets its own incremental bar id,
bards end up being sorted according to their definition order in the
config file.
For i3bar, the WM_CLASS is modified to include an instance name which
depends on the bar_id. This could be useful for other reason, e.g. users
targeting a specific bar instance.
Fixes#3491
The default `tiling` and `floating` behavior is preserved and matches
both cases.
Adds a new handler to `remanage_window` on A_I3_FLOATING_WINDOW change.
Mainly in order to `run_assignments`, this makes `for_window [floating]`
directives to work for windows which where initially opened as tiling.
Now, when floating is enabled, `for_window` will trigger correctly. Same
applies to `for_window [tiling]`.
The obvious solution of `run_assignments` after
`floating_{enable,disable}` doesn't work because `run_assignments`
modifies the parser state in src/assignments.c:51.
Fixes#3588
Co-Authored-By: Michael Stapelberg <michael@stapelberg.de>
Before this commit, large workspace numbers treated oddly:
$ i3-msg 'rename workspace to 1234567890'
# displayed in i3bar as `0`
$ i3-msg 'rename workspace to 4294967200'
$ i3-msg -t get_workspaces | jq '.[]|select(.focused).num'
-96 # int32_t overflow
$ i3-msg 'rename workspace to 99999999999999999999'
$ i3-msg -t get_workspaces | jq '.[]|select(.focused).num'
-1 # treated as unnumbered
This commit puts a consistent limit on workspace numbers. Now
workspaces with numbers beyond INT32_MAX are treated as unnumbered.
* clang-format: bring back ForeachMacros
ForeachMacros was disabled in 4211274fcd
due to the breakage of include/queue.h. The currently used version,
clang-format-6.0 doesn't break it.
* Add curly braces
Co-authored-by: Orestis Floros <orestisflo@gmail.com>
I had a dilemma about the behaviour here:
1. Prohibit focus leaving the workspace in any case unless if
get_tree_next's initial argument is a workspace. This is what this
commit does (also i3-cycle).
2. Leave the workspace if no warp is possible (eg workspace with single
container or `focus right` with `V[a b c*]`).
Fixes#2180
- Makes `tree_next` not recursive.
- Adds `focus next|prev [sibling]` command. See (1.) and (2.) in
https://github.com/i3/i3/issues/2587#issuecomment-378505551 (Issue also
requests move command, not implemented here).
- Directional focus command now supports command criteria.
Wrapping is not implemented inside a floating container. This was also
true before the refactor so I am not changing it here.
This has changed after #3787.
The packed attribute was added in
75aac5bc02 for _NET_WORKAREA. However,
eec80838ab removed _NET_WORKAREA support.
I did some quick greping for `memcpy.+Rect` and didn't find any similar
code that could theoretically lead to problems.
Move drag_pointer() and related definitions from floating.c to new file
drag_pointer.c since it's applicable not only to floating windows but
also to resizing of tiled windows.
Fixes#3785 -- the issue where the Travis build failed because of gcc's
-Werror=address-of-packed-member.
Adds an equality function to avoid relying on memcmp().
This is achieved by retaining the IPC connection which is sending the restart
command across the restart.
This is the cleaner fix for https://github.com/i3/go-i3/issues/3fixes#3565
The testcase is changed because it was actually incorrect. Easy to
verify because:
> _NET_CURRENT_DESKTOP
> …
> The index of the current desktop. This is always an integer between 0
> and _NET_NUMBER_OF_DESKTOPS - 1.
Fixes#3696.
Also updates the viewports.
Finally, fixes an issue with _NET_CURRENT_DESKTOP not being updated
after a workspace rename. Example:
- workspaces 1, 2, 3
- rename workspace 1 to 5
- All workspaces changed their index but _NET_CURRENT_DESKTOP was not
updated
- Having both parse_configuration and parse_file is excessive now
- We detect if we are parsing only by checking if conn is NULL, not with
use_nagbar
- font.pattern needs to be set to NULL because it is freed in
free_font()
Fixes#3660
- The result from con_get_output was always not NULL because
con_get_output asserts so
- get_output_by_name should always be able to get an output from the
corresponding container
- workspace_move_to_output doesn't return bool anymore since it can't
fail
I was able to reproduce #3579 in Linux by running:
`sudo sysctl net.core.wmem_default=10000`
If a subscription message was too big to be sent at once, it was
possible to break a client by sending a reply to an other message sent
by the client. Eg:
- Write 8192 out of 11612 bytes of a workspace event.
- Blockingly write the reply to a workspace change message.
- Write the rest 3420 bytes of the workspace event.
This commit fixes this by utilizing the ipc queue for all types of
writes.
ipc_receive_message can only be called from a callback started in
ipc_new_client. This callback uses the same file descriptor with the
client also created in ipc_new_client. When the client is deleted, the
read callback is now also stopped. Thus, we can assume that whenever
ipc_receive_message is called, the corresponding client should still
exist.
- ipc_client now contains pointers to both write and read watchers. When
freed, a client will stop both of them.
- IPC_HANDLERs now work with ipc_clients instead of fds.
Fixes#3579.