Commit Graph

7484 Commits

Author SHA1 Message Date
zhrvn
5ce8e3241b
Fix crash in parse_file() when parsing nested variables (#5003)
Count extra_bytes correctly

If there is a variable with the same name as the rest of another
variable after removing $, then it will be counted twice. Therefore,
we need to completely replace it with spaces (variable names cannot
contain spaces) in order to correctly calculate the length of a new
string.

fixes https://github.com/i3/i3/pull/5002

Co-authored-by: Ivan Zharov <zhiv.email@gmail.com>
Co-authored-by: Michael Stapelberg <stapelberg@users.noreply.github.com>
2022-09-12 09:03:50 +02:00
zhrvn
e48b9aa284
Fix segfault with mode "default" key bindings (#5007)
ignore bindings when not in a valid mode

Co-authored-by: Ivan Zharov <zhiv.email@gmail.com>
Co-authored-by: Michael Stapelberg <stapelberg@users.noreply.github.com>
2022-09-11 15:22:01 +02:00
Michael Stapelberg
f795c2c8da
testsuite: catch i3 SIGSEGV by installing SIGCHLD handler (#5123)
The testsuite already contains quite a number of SIGCHLD handler
installation/un-installations. Here is my attempt at an inventary.

1. complete-run.pl installs a SIGCHLD handler in the `start_xserver()` function
   call, which prints an error and exits when all x server processes have exited.

2. In the TestWorker child process, a SIGCHLD handler is installed to reap dead
   test child processes.

3. The TestWorker child process forks another child process for running the test
   file, where the previously installed SIGCHLD handler (point 2) is unset.

   This is where this commit comes in: it installs a SIGCHLD handler in the test
   file child process, which will trigger when the i3 subprocess dies.

4. (For completeness: i3test.pm defines an END block where it unsets the
    previous SIGCHLD handler before it kills the subprocesses.)

With this commit, when i3 segfaults, the output will look like this:

    Writing logfile to 'testsuite-2022-09-10-21-14-46-4.20-103-gb242bceb/complete-run.log'...
    [:100] /home/michael/i3/testcases/t/167-workspace_layout.t: BAILOUT
    completed 0 of 1 tests
    test /home/michael/i3/testcases/t/167-workspace_layout.t bailed out:
    could not kill i3: No such process

fixes https://github.com/i3/i3/issues/4437
2022-09-10 21:29:04 +02:00
Michael Stapelberg
4b5ead023e
open_logbuffer: avoid overflow by comparing (long long) (#5113)
I tested this on a machine with 256 GB of RAM.

fixes #4906
2022-09-09 10:26:17 +02:00
Michael Stapelberg
ac368e7916
config_parser: prevent trailing whitespace in output (string → word) (#5117)
fixes https://github.com/i3/i3/issues/5064
2022-09-09 10:23:55 +02:00
Michael Stapelberg
6fb58eb841
config: set bar block font to i3-wide font *after* parsing (#5118)
Otherwise, the font directive needs to come before bar blocks,
which is surprising to users.

fixes https://github.com/i3/i3/issues/5031
2022-09-09 10:21:33 +02:00
paperluigis
4db383e430
man/i3-input: fix a typo: chose → choose (#5087) 2022-09-06 20:30:23 +02:00
mariano
e9c63d3001
Add wezterm to i3-sensible-terminal (#5107) 2022-09-06 20:23:56 +02:00
bodea
b242bcebcf
i3-sensible-pager: sanitize LESS environment variable (#5111)
When an error is encountered such as "The configured command for this shortcut
could not be run successfully", the "show errors" button on i3-nagbar doesn't
work if $PAGER is less, and $LESS contains either the -E or -F flag (the
window pops up, but immediately disappears).

Strip these flags from the LESS environment variable before invoking $pager.
2022-09-06 08:42:02 +02:00
Orestis Floros
ebcd1d43ea
Allow dragging tiled windows with the mouse. (#3085)
Fixes #2643

Inner drop region behaves like move to mark.
The outer region is close to the edge (currently 30px from the edge).
This will place the container as a sibling in the given direction within
the parent container. If the move direction goes against the orientation
of the parent container, tree_move() is called.

Contributors:
Co-authored-by: Orestis Floros <orestisflo@gmail.com>
See #3085
- Inner drop region behaves like move to mark
- Handle workspaces
- Fix crash when target closes
- Initiate tiling drag from titlebar
- Hide indicator until container is dragged outside of original position
- Calculate outer_threshold using percentages instead of fixed pixel
values
- Emit 'move' event properly
- Don't focus previously unfocused containers
- Use tree_split() on different orientation
- Fix redundant split containers
- DT_PARENT
- Readability & optimizations
- Limit parent threshold by render_deco_height()
- Tests
- Fullscreen container handling
- Initiate drag from title bar
- Fix issue of EnterNotify events still triggering after drag_callback
  is called
- Include decorations for drop target calculation

Co-authored-by: Michael Forster <email@michael-forster.de>
See #2178
- Original implementation of tiling drag + indicator window
> A container can be dragged by the title bar to one of the four sides
> of another container. That container will then be split either
> horizontally or vertically.

Co-authored-by: Tony Crisci <tony@dubstepdish.com>
See #2653
- Original implementation of outer/inner drop region indicator:
> There are two drop regions per direction.
>
> The inner region is closer to the center of the window. Dropping on
> this region will split the target container and put the container
> within the split at the given direction beside the target container.
>
> The outer region is close to the edge (currently 30px from the edge).
> This will place the container as a sibling in the given direction within
> the parent container.
>
> Dropping into the outer region moves the con beside the target. If the
> move direction goes against the orientation of the parent container, the
> con moves out of the row.
- Fix crash: Ignore containers without a managed window (eg i3bar)
2022-07-28 12:03:16 +02:00
Orestis Floros
807e972330 Fix Wbitwise-instead-of-logical warnings
> error: use of bitwise '|' with boolean operands
2022-07-28 09:25:55 +02:00
Michael Stapelberg
103dc7b55d fix travis/check-spelling.pl for recent Lintian changes 2022-07-28 09:25:55 +02:00
Jay Ta'ala
ddc587933d
Split container parents should be redrawn when swapping child containers (within parent) (#4765)
Redraw split container parents when swapping child containers

Split container parents should be redrawn when swapping child containers  so they show the correct window ordering (note without this higher level split parent container titles will only update when changing layout or moving child cons in/out.
2022-06-30 20:21:14 +02:00
Josh Soref
458c148934
cleanup-bintray: remove remaining bintray references (#5038)
* The `cleanup-bintray.pl` script is just unused
* The `dh_builddeb` override is no longer necessary as bintray is no longer used
2022-06-30 08:21:54 +02:00
Kjetil Torgrim Homme
3597cc636e highlight the difference between "workspace N" and "workspace number N" commands 2022-06-28 00:25:06 +02:00
zhiv-git
ce2665ca96
Fix segfault when bindsym command is empty (#5001)
Remove end token from BINDCOMMAND

fixes i3/i3#5000: bindsym command cannot be empty, because NULL string
causes i3 to segfault when copied in configure_binding()
2022-06-08 22:38:21 +02:00
George Rodrigues
6ab64aa5b7
Fix typos (#4989) 2022-06-01 09:49:05 +02:00
Michael Stapelberg
612a9317b0
GitHub Actions: declare /usr/src/i3 as safe directory (#4992) 2022-05-31 18:29:36 +02:00
André Silva
dba30fc987
clear surface on x_push_node (#4577) 2022-03-28 10:18:55 +02:00
takelley1
41cd852f2f
Fix typo in comment (#4936)
* Fix typo in comment

* Fix other typo in comment
2022-03-28 10:14:52 +02:00
Ingo Bürk
c822eff1bf
Remove Xlib references (#4845)
* remove Xlib import from i3bar

* remove unused Xlib declarations
2022-02-10 10:25:20 +01:00
Gergely Risko
bd5cbbb010
Use proper WM_Sx registration for i3 (#4843)
i3's WM ownership is registered with the X Atom WM_S_S0 (for screen0),
instead of the correct WM_S0.  The relevant xcb-util API didn't
change, this is simply a bug in i3 that has always been there:
https://gitlab.freedesktop.org/xorg/lib/libxcb-util/-/blob/0.4.0/src/atoms.c#L65
2022-02-07 17:43:55 +01:00
Orestis Floros
70288d7b68
Merge pull request #4710 from pstray/title_window_icon-toggle
Implement title_window_icon toggle
2021-12-11 14:33:23 +01:00
Peder Stray
813336e068
Implement title_window_icon toggle
A feature described in i3/i3#4709
2021-12-11 14:20:07 +01:00
Orestis Floros
b17117190d
Merge pull request #4717 from orestisfl/janitorial
Remove outdated //-style commented-out code
2021-12-06 22:55:38 +01:00
Orestis Floros
a4ac843cca
Remove outdated //-style commented-out code
This makes the whole code-base have zero changes with clang-format
(v13).
2021-12-06 22:14:41 +01:00
sergio
70f23caa9a
fix #4697, adds backslashes quotation for exec (#4699)
Signed-off-by: Sergio E. Nemirowski <sergio@outerface.net>
2021-12-06 09:53:50 +01:00
Chris Templin
729452448b
docs: change IPC window_type value (#4668) 2021-12-01 20:38:00 +01:00
Michael Stapelberg
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
Uli Schlachter
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
Ingo Bürk
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
Orestis Floros
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
Ingo Bürk
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
Ingo Bürk
46bdd537a8
Merge pull request #4622 from orestisfl/focus-output-next
Focus output next
2021-11-18 22:33:13 +01:00
Ingo Bürk
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
Ingo Bürk
b7056a82f4
Merge pull request #4667 from orestisfl/transient_for-loop
Fix transient_for endless loop
2021-11-18 22:31:19 +01:00
Orestis Floros
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
Orestis Floros
43e805a00d
Merge pull request #4656 from stapelberg/flaky
Fix flaky tests: sync after kill
2021-11-07 13:51:55 +01:00
Michael Stapelberg
673185a63b t/219-ipc-window-focus.t: sync after kill 2021-11-07 11:56:06 +01:00
Michael Stapelberg
c4fdcc5dbc fix flaky testcases/t/185-scratchpad.t: sync after kill command 2021-11-07 11:47:42 +01:00
Orestis Floros
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
Orestis Floros
7f3316269d
Release notes script fixes (#4652)
* release-notes: Sort filenames

* release-notes: Fix print-urls
2021-11-06 14:13:18 +01:00
Orestis Floros
93b2b44893
cmd_focus_output: Multiple outputs 2021-11-05 18:34:54 +01:00
Orestis Floros
34ef7f8c33
tests: Extract focused_output in library 2021-11-05 18:33:14 +01:00
Orestis Floros
bc4f35a6bb
Extract common functions out of cmd_move_con_to_output 2021-11-05 18:33:14 +01:00
Orestis Floros
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
Ingo Bürk
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
Orestis Floros
117fb13177
Merge pull request #4650 from orestisfl/focused_tab_title
Add title tab color
2021-11-05 15:24:25 +01:00
Anton Älgmyr
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
Orestis Floros
f36050b303
Add title tab color
Fixes #4575
2021-11-05 15:19:18 +01:00