The implementation uses wordexp(3) just like sway:
https://github.com/i3/i3/issues/1197#issuecomment-226844106
Thanks to jajm for their implementation at
bb55709d0a
This required refactoring the config parser to be re-entrant
(no more global state) and to return an error instead of dying.
In case a file cannot be opened, i3 reports an error but proceeds with the
remaining configuration.
Key bindings can be overwritten or removed using the new --remove flag of the
bindsym/bindcode directive.
All files that were successfully included are displayed in i3 --moreversion.
One caveat is i3 config file variable expansion, see the note in the userguide.
fixes#4192
"Set" the wallpaper during startup only sometimes
Since commit 4f5e0e7, i3 would take a screenshot and set that as the
background pixmap of the root window during startup. This is the easy
part of setting a proper X11 wallpaper.
The code in question was added because something either set the
background pixmap of the root window to NONE or the X11 server was
started with "-background none". This is apparently done by default by
e.g. gdm to avoid some flickering while the X11 server starts up.
This commit makes this code conditional: Only when no wallpaper is
detected is a screenshot taken.
Since I could not find any way to query the background of a window, a
more direct approach is taken to detect this situation: First, we find
some part of the root window that is not currently covered. Then we open
a white window there, close it again and grab a screenshot. If a
wallpaper is set, the X11 server will draw this wallpaper after the
window is closed and something else will be visible in the screenshot.
However, the wallpaper could have a white pixel at the tested position.
Thus, this procedure is repeated with a black window.
Only when this procedure produces two different pixel values is a
screenshot taken and set as the wallpaper.
Fixes: https://github.com/i3/i3/issues/4371
Fixes: https://github.com/i3/i3/issues/2869
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit makes it so that when clicking on a tab for the first time,
its inactive-focused child is focused. This matches i3 behavior when
scrolling on tabs.
A second click on the tab titlebar focuses the tab container itself.
Subsequent clicks cycle between these two states.
Closes#4225.
Fix#4261
The previous method was modifying the same list it was iterating upon
causing an erronous iteration and thus not every workspace got assigned
back to were they should (only the first one).
When going through the `binding_workspace_names` to prioritize
user-specified names, we only check if the workspace exists, not the
workspace number. If the user specified a `bindsym … workspace number X`
directive, then it is appended in `binding_workspace_names` and a
workspace is created using that number even though from the POV of a
user that uses numbers to change workspaces, that workspace already
exists.
In similar code here:
1d9160f2d2/src/workspace.c (L997)
we do the check.
Fixes#4238
Currently i3bar click events provide x and y coordinates relative to all monitors.
I've added coordinates relative to the current output.
+-----------+-----------+
| | i3bar |
| +-----------+
| HDMI-0 | DP-0 |
| 1920x1080 | 2560x1080 |
+-----------+-----------+
When you click in the top right corner of the DP-0,
i3bar will provide something like this:
{
"x": 4480,
"y": 10,
"output_x": 2560,
"output_y": 10,
}
This is useful for creating a rofi menu or something else.
rofi -show run -location 1 -xoffset ${I3_OUTPUT_X} -yoffset ${I3_OUTPUT_Y}
The bug here is that workspace assignments with numbers are triggered
even if a named argument matches later on.
With this commit, get_assigned_output is called to correctly iterate the
workspace assignments.
Fixes#4021
I find the new loop more straightforward and easy to understand.
Old loop used to be:
foreach assignment:
foreach assignment2:
// find if this is the first valid output in this assignment
foreach workspace:
// find matching by assignment name
if workspace:
move workspace to output
New loop is:
foreach workspace:
foreach assignment:
if workspace is assigned to this output:
move workspace to output
With this, workspace assignments triggered by numbers during output
changes should be handled correctly.
Fixes#3685
The `*_free_*` calls in this branch:
51b0583578/i3bar/src/xcb.c (L1854)
are never called when we remove the output from the tailq during a
refresh.
Fixes#4123
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
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
- 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
The previous fix when using _DEPENDENCIES was wrong because that
dependency is only created for the final executable. However, the build
fails when building the object file. The manual explicitly mentions that
using _DEPENDENCIES is wrong for source files:
> In rare cases you may need to add other kinds of files such as linker
> scripts, but listing a source file in _DEPENDENCIES is wrong. If some
> source file needs to be built before all the components of a program
> are built, consider using the BUILT_SOURCES variable instead (see
> Sources).
https://www.gnu.org/software/automake/manual/automake.html#Linking
Instead, using BUILT_SOURCES works, as mentioned in the manual.
https://www.gnu.org/software/automake/manual/automake.html#Sources
I have also removed the dependencies from i3_SOURCES since AFAIK
dependencies to header files don't do anything. I have verified that
modifying the header correctly re-triggers the build for i3 &
i3-config-wizard.
> Header files listed in a _SOURCES definition will be included in the
> distribution but otherwise ignored. In case it isn’t obvious, you
> should not include the header file generated by configure in a
> _SOURCES variable; this file should not be distributed. Lex (.l) and
> Yacc (.y) files can also be listed; see Yacc and Lex.
https://www.gnu.org/software/automake/manual/automake.html#Program-Sources
An alternative instead of BUILT_SOURCES that should also work in our
case is found in this section:
https://www.gnu.org/software/automake/manual/automake.html#Built-Sources-Example
see "Recording Dependencies manually". The syntax would be:
foo.$(OBJEXT): $(config_parser_SOURCES) $(command_parser_SOURCES)
The benefit of this over BUILT_SOURCES is that it will work for targets
other than 'all', 'check' and 'install'. However, since we don't really
have such targets we don't need to do this right now.
Tested extensively using this script:
#!/bin/bash
set -x
autoreconf -fi
while mkdir build && cd build && ../configure && make -j; do
cd ..
rm -rf build
done
Fixes#3670
* Add RELEASE-NOTES template for next
The placeholder items are useful instead of having to find the •
character for every new release.
Closes#4040
* Remove leftover bugfix release notes from tree