Commit Graph

7407 Commits

Author SHA1 Message Date
729452448b docs: change IPC window_type value (#4668) 2021-12-01 20:38:00 +01:00
07ea5019c9 debian: bump to libpcre2-dev for autobuilds (#4705)
related to https://github.com/i3/i3/issues/4682
2021-11-29 23:41:07 +01:00
6c7efc4de8 Switch from pcre to pcre2 (#4684)
The issue at [0] was opened and I just took a stab at it. I have no
prior experience with pcre and pcre2, but using [1,2] I hacked together
something that seems to work. Next, Michael told me to turn that
patch/hack into a PR, so here we are.

The dependency in meson.build now uses version:'>=10', but this is more
a random guess than actual knowledge.

There was a while loop in regex_new() that dealt with an error when pcre
was not compiled with UTF-8 support. This loop uses a magic constant of
32 for the error code. I just dropped this loop, because I was just
writing a hack and did not intend to turn this into a PR. Also, a quick "grep
32 /usr/include/pcre.h" does not find anything useful, so... *shrug*

pcre_study() was removed without replacement, so the corresponding code
is also simply removed.

Testing done: The test suite passes for me. YMMV.

[0]: https://github.com/i3/i3/issues/4682
[1]: https://www.pcre.org/current/doc/html/pcre2api.html
[2]: https://www.pcre.org/current/doc/html/pcre2demo.html

Signed-off-by: Uli Schlachter <psychon@znc.in>
Fixes: https://github.com/i3/i3/issues/4682
2021-11-29 18:20:54 +01:00
298c3aede9 Merge pull request #4698 from orestisfl/user_output_names_find_next
user_output_names_find_next: Always initialize target_output
2021-11-27 23:38:13 +01:00
854616ed2e user_output_names_find_next: Always initialize target_output
This way, if the user has provided a valid, existing output in the list
of outputs, the focus & move workspace to output commands will not
report a misleading failure.

Side-effect is that the command code will try to execute a no-op e.g. by
moving the workspace to the output it already is on. But that's what the
user is actually requesting in this case and it shouldn't be a problem.

Fixes #4691
2021-11-27 22:52:48 +01:00
d44e1442c2 Merge pull request #4485 from ToxicGLaDOS/long_commands_crash
Fix bug where long commands crash i3
2021-11-18 22:35:23 +01:00
46bdd537a8 Merge pull request #4622 from orestisfl/focus-output-next
Focus output next
2021-11-18 22:33:13 +01:00
52c831ca22 Merge pull request #4651 from orestisfl/docs-ipc-socket
docs: Make more clear that an IPC socket is always created
2021-11-18 22:31:35 +01:00
b7056a82f4 Merge pull request #4667 from orestisfl/transient_for-loop
Fix transient_for endless loop
2021-11-18 22:31:19 +01:00
e1d3e6b2f6 Fix transient_for endless loop
Other approaches would be:
- Slow/fast pointer technique.
- Using a set/associative map to save 'seen' nodes. i3 does not have
  such data structure.

Counting the total amount of windows is the simpler to implement.

I've also extracted the logic in a function and re-used it in render.c.

Fixes #4404
2021-11-11 20:29:02 +01:00
43e805a00d Merge pull request #4656 from stapelberg/flaky
Fix flaky tests: sync after kill
2021-11-07 13:51:55 +01:00
673185a63b t/219-ipc-window-focus.t: sync after kill 2021-11-07 11:56:06 +01:00
c4fdcc5dbc fix flaky testcases/t/185-scratchpad.t: sync after kill command 2021-11-07 11:47:42 +01:00
8e9da491f4 Merge pull request #4648 from orestisfl/formatting-new-action
Move clang-format and safe-wrappers check in new job
2021-11-06 14:16:09 +01:00
7f3316269d Release notes script fixes (#4652)
* release-notes: Sort filenames

* release-notes: Fix print-urls
2021-11-06 14:13:18 +01:00
93b2b44893 cmd_focus_output: Multiple outputs 2021-11-05 18:34:54 +01:00
34ef7f8c33 tests: Extract focused_output in library 2021-11-05 18:33:14 +01:00
bc4f35a6bb Extract common functions out of cmd_move_con_to_output 2021-11-05 18:33:14 +01:00
680ddc7e10 Move clang-format, safe-wrappers, release notes check in new job
Benefits:
- Faster feedback in case of error
- More checks run in parallel
- Removes stuff from Dockerfiles
- Uses newest available clang-format (in ubuntu repos)
2021-11-05 18:29:42 +01:00
20d0591e77 Merge pull request #4604 from orestisfl/fix-focus-warp
Fix focus issue when moving windows across outputs
2021-11-05 15:32:07 +01:00
117fb13177 Merge pull request #4650 from orestisfl/focused_tab_title
Add title tab color
2021-11-05 15:24:25 +01:00
863a9eada4 Fix focus issue when moving windows across outputs
Fixes #3518

This fix avoids the issue of consuming our own warp events by never
calling warp on the wrong container.

Tried to add a test but it also succeeds with version before patch,
see #4604 for discussion

Co-Authored-By: Orestis <orestisflo@gmail.com>
2021-11-05 15:21:59 +01:00
f36050b303 Add title tab color
Fixes #4575
2021-11-05 15:19:18 +01:00
3c81e8ddaa Merge pull request #4610 from orestisfl/release-notes-next
Keep each release note in a single file
2021-11-05 10:36:24 +01:00
38cf8a21ef Update release notes
https://github.com/i3/i3/pull/4638
https://github.com/i3/i3/pull/4647
2021-11-05 10:13:30 +01:00
c083e023b6 Keep each release note in a single file
To avoid annoying merge conflicts.

Perl script is provided for convenience and simple format checking in
PRs.
2021-11-05 10:13:22 +01:00
220144361a userguide: Make more clear that an IPC socket is always created
Follow-up from #4647
2021-11-04 21:47:55 +01:00
3e0fc25b6b Merge pull request #4649 from orestisfl/fix-errno
Fix compilation error on debian
2021-11-04 19:31:44 +01:00
ce0d08cc6d Fix compilation error on debian 2021-11-04 19:27:40 +01:00
445cea8e3a Do not replace existing IPC socket (#4638)
Imagine you are a happy i3 user and want to also write patches for i3.
You use "Xephyr :1" to get another X11 server and then start your newly
build i3 in it with "DISPLAY=:1 ./i3". You test your changes and
everything seems fine. You are happy. Later that day, you try to log
out, but the $mod+Shift+e key binding from the default config no longer
works. i3-msg cannot connect to the IPC socket because "No such file or
directory". What is going on?

The problem boils down to $I3SOCK having something like two meanings.
When i3 starts, it sets the environment variable $I3SOCK to the path of
its IPC socket. That way, any process started from i3 inherits this and
i3-msg knows how to talk to i3. However, when this variable is already
set when i3 starts, then i3 will replace the existing socket. Thus, in
the earlier experiments, the "separate i3" that was used for
experimenting stole the "main i3"'s socket and replaced it with its own.
When it exited, it deleted that socket.

This commit adds half a work around to this problem: When creating the
IPC socket, i3 will now first try to connect() to the socket. If this
succeeds, it will complain and refuse to use this socket. If the
connect() call fails, it will proceed as usual and create the socket.

Note that trying to connect() to a socket that no process listens on
will fail. Thus, this new code only really "triggers" when some process
is actively listening on this socket and accepting connections.

Example output for when the socket is already in use:

$ I3SOCK=/tmp/sdfdsf DISPLAY=:2 ./i3
31.10.2021 17:03:55 - [libi3] ERROR: Refusing to create UNIX socket at /tmp/sdfdsf: Socket is already in use
31.10.2021 17:03:55 - ERROR: Could not create the IPC socket, IPC disabled

This commit sadly only provides part of the solution. i3 will still
delete the socket when shutting down, even if it failed to create the
IPC socket. Thus, the ipc socket will still break, but now only later.
This will be fixed separately.

First-step-towards-fixing: https://github.com/i3/i3/issues/4381
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-11-04 17:22:22 +01:00
d83940a8fc Merge branch 'release-4.20.1' 2021-11-03 09:23:23 +01:00
53f52beb09 Update debian/changelog 2021-11-03 09:23:23 +01:00
63aec362c9 Restore non-git version suffix 2021-11-03 09:23:23 +01:00
f97268dbd8 Merge branch 'stable' into next 2021-11-03 09:23:23 +01:00
b952e74145 release i3 4.20.1 2021-11-03 09:23:07 +01:00
6fe33394e1 post-release release.sh changes 2021-11-03 09:14:58 +01:00
c6ea9bbace portability: use getcwd() instead of get_current_dir_name() (#4645) 2021-11-03 09:03:33 +01:00
058ebb0d42 portability: add missing headers
libi3.h defins a macors with the default modes to create a directory.
Those modes are defined in sys/stat.h, so include the necessary header
2021-11-03 09:03:28 +01:00
884717489f Correct short form of raw option in i3-msg manpage 2021-11-03 09:03:14 +01:00
b895d9d3cc Extend title length for xmlto
man.th.title.max.length defaults to 20 which leads to a broken .TH line
for i3-migrate-config-to-v4.1:

.TH "I3\-MIGRATE\-CONFIG\" "1" "02/01/2021" "i3 4\&.19\&.1" "i3 Manual"
2021-11-03 09:03:09 +01:00
39ff5699d6 check for both arguments NULL on strings_differ 2021-11-03 09:03:03 +01:00
ecc4f91fb4 Merge pull request #4647 from psychon/refuse-start-without-ipc-socket
Refuse to start without IPC socket
2021-11-02 23:13:52 +01:00
03a0375e7f Refuse to start without IPC socket
This change was (basically) suggested by @orestisfl in
https://github.com/i3/i3/pull/4638#issuecomment-958093518

Testing done:

$ I3SOCK=/dev/null DISPLAY=:2 LC_ALL=C build/i3
bind(): Address already in use
i3: Could not create the IPC socket: /dev/null

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-11-02 21:08:42 +01:00
aceb36ae60 portability: use getcwd() instead of get_current_dir_name() (#4645) 2021-11-02 20:14:24 +01:00
e4d3ec9217 Merge pull request #4644 from bapt/portability-nits
portability: add missing headers
2021-11-02 19:50:58 +01:00
e4a3f6e4cd portability: add missing headers
libi3.h defins a macors with the default modes to create a directory.
Those modes are defined in sys/stat.h, so include the necessary header
2021-11-02 10:43:27 +01:00
40b0c8e5b8 Merge pull request #4618 from Jonta/patch-3
Docs: Testsuite: Grammar
2021-11-01 21:42:49 +01:00
b0632bddfc Merge pull request #4637 from lycurgus/patch-1
Correct short form of raw option in i3-msg manpage
2021-10-31 09:36:30 +01:00
8e46943985 Correct short form of raw option in i3-msg manpage 2021-10-31 19:01:32 +11:00
36f9f86714 Merge pull request #4629 from sur5r/xmlto-titlelength
Extend title length for xmlto
2021-10-28 08:40:08 +02:00