A tiling window manager for X11 https://i3wm.org/
  • C 58.1%
  • Perl 36.5%
  • Raku 2.5%
  • Ruby 1.2%
  • Meson 0.7%
  • Other 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
javgh 9be3249ac5
Enforce tracking of ignored events by 32-bit full sequence (#6642)
This PR is a follow-up to the discussion in #6372 .

I'm not too familiar with the internals of X11, but it seems that sequence numbers are sometimes of type `uint16_t` and sometimes of type `unsigned int` or `uint32_t`. In some places XCB provides the field `full_sequence` (for example as part of `xcb_generic_event_t`), but other structs only have the 16-bit sequence. Then there is also `xcb_void_cookie_t` which has `unsigned int` for `sequence`.

The current code for tracking ignored events mixes these different data types. This works fine, as long as the sequence number doesn't overflow a `uint16_t`. Afterwards, the tracking of ignored events will fail. This appears to be the reason for #6372 and probably also #6364 . There is also the open PR https://github.com/i3/i3/pull/6559 which notes: "[...] add the sequence to the ignore list, but under some (unknown) circumstances, that does not seem to work reliably."

This problem already existed in 4.23 (and before), but only became visible in 4.24, because it seems that is was masked by using `XCB_GRAB_MODE_SYNC` when executing key bindings. This seems to mask the bug, but sending a command via `i3-msg` also triggers it in 4.23 . Commit b42dc21068 changed `XCB_GRAB_MODE_SYNC` to `XCB_GRAB_MODE_ASYNC` and surfaced the bug. Additionally, the commit cfa4cf16 increased the number of messages being sent and sequence numbers being used, which triggers this bug more quickly than before.

The first commit in this PR introduces a test for #6372 . I found a more performant way of overflowing the uint16_t sequence number (using sync_with_i3 to create fairly cheap messages). The test runs in 1.3 seconds on my system.

The second commit fixes the problem. It defines a new data type `ignore_event_sequence_t` and a macro `ENSURE_FULL_SEQUENCE` which is then used at every call site for `add_ignore_event` and `event_is_ignored`. This way the compiler checks that a full sequence number is used everywhere. Perhaps this is over-engineered? Please let me know - I don't work much in C.

This change makes the test pass and also fixes #6372 for me in my manual testing.

Looking forward to feedback!

Disclosure of AI assistance: I used Claude Fable 5 and GPT-5.6 Sol as sparring partners, but everything here is hand-written.
2026-07-28 06:22:26 +00:00
.github CONTRIBUTING: discourage Conventional Commits in favor of scope (#6630) 2026-06-24 08:26:18 +02:00
AnyEvent-I3 Use I3SOCK environment variable for path in AnyEvent::I3 (#5987) 2024-04-19 19:12:11 +02:00
contrib Fix: remove "dynamic" TWM (#6193) 2024-08-05 18:23:55 +02:00
debian debian: update changelog 2025-12-19 08:28:21 +01:00
docs ipc: list q3ipc library for C++ 2026-01-26 20:33:03 +01:00
etc make tiling drag configurable 2022-10-16 18:21:08 +02:00
i3-config-wizard Fix ctype(3) function arguments. 2025-12-29 11:12:04 +01:00
i3-dump-log Update to clang-format-20 (#6521) 2025-11-05 22:46:34 +01:00
i3-input Chore: Code cleanup and style improvements (#6516) 2025-11-07 09:49:03 +00:00
i3-msg Fix: remove "dynamic" TWM (#6193) 2024-08-05 18:23:55 +02:00
i3-nagbar Chore: Code cleanup and style improvements (#6516) 2025-11-07 09:49:03 +00:00
i3bar Fix ctype(3) function arguments. 2025-12-29 11:12:04 +01:00
include Enforce tracking of ignored events by 32-bit full sequence (#6642) 2026-07-28 06:22:26 +00:00
libi3 Chore: Code cleanup and style improvements (#6516) 2025-11-07 09:49:03 +00:00
man i3-sensible-terminal: add ghostty 2026-01-14 18:20:21 +01:00
meson meson: strip release-notes/ directory from dist tarballs 2025-12-19 07:49:07 +01:00
parser-specs Fix: remove "dynamic" TWM (#6193) 2024-08-05 18:23:55 +02:00
release-notes Enforce tracking of ignored events by 32-bit full sequence (#6642) 2026-07-28 06:22:26 +00:00
share Revert "include i3.service systemd user unit (#6547)" (#6554) 2025-12-18 18:43:56 +01:00
src Enforce tracking of ignored events by 32-bit full sequence (#6642) 2026-07-28 06:22:26 +00:00
testcases Enforce tracking of ignored events by 32-bit full sequence (#6642) 2026-07-28 06:22:26 +00:00
travis GitHub Actions: install libcrypt-dev in travis-base.Dockerfile 2026-01-07 08:47:26 +01:00
.clang-format clang-format: enable InsertBraces (#5882) 2024-01-27 11:37:05 +01:00
.dockerignore add meson build files (#4094) 2020-05-19 14:45:06 +02:00
.editorconfig Add .editorconfig (see editorconfig.org) (#2943) 2017-09-13 18:38:27 +02:00
.gitignore Fix crash with focus output and scratchpad (#6079) 2024-06-03 17:00:47 +02:00
DEPENDS Fix DEPENDS table 2018-05-01 13:49:55 +03:00
flake.lock declare a development shell in flake.nix 2025-12-23 18:01:22 +01:00
flake.nix flake.nix: disable fortify hardening (results in compiler warnings) 2025-12-29 11:06:18 +01:00
generate-command-parser.pl Refactor: Extract parser stack implementation to parser_util (#6514) 2025-11-05 22:56:49 +01:00
i3-dmenu-desktop i3-dmenu-desktop: Allow more than one --entry-type (#5294) 2022-12-06 17:23:10 +01:00
i3-migrate-config-to-v4 Remove dead documentation for non-existing feature "stack-limit". 2015-06-09 23:13:15 +02:00
i3-save-tree i3-save-tree: Exclude unsupported "transient_for" property 2018-09-12 14:13:56 +03:00
i3-sensible-editor Added gVim to i3-sensible-editor 2018-02-19 15:39:46 +01:00
i3-sensible-pager i3-sensible-pager: sanitize LESS environment variable (#5111) 2022-09-06 08:42:02 +02:00
i3-sensible-terminal i3-sensible-terminal: add ghostty 2026-01-14 18:20:21 +01:00
I3_VERSION Set non-git version to 4.19.1-non-git. 2021-02-01 09:04:01 +01:00
LICENSE Reformat LICENSE so github sees it as BSD-3-Clause. (#4181) 2020-09-02 11:42:05 +02:00
logo.svg Fix: remove "dynamic" TWM (#6193) 2024-08-05 18:23:55 +02:00
meson.build Restore non-git version suffix 2025-12-19 08:20:07 +01:00
meson_options.txt meson: make docdir configurable 2020-05-19 19:07:45 +02:00
PACKAGE-MAINTAINER Update meson setup command to remove warning (#6338) 2024-12-29 19:50:09 +01:00
README.md README: update build status badge for GitHub Actions 2021-05-23 16:06:13 +02:00
RELEASE-NOTES-4.25 release i3 4.25 2025-12-19 08:19:53 +01:00
release.sh release.sh: update version numbers post 4.25 release 2025-12-19 08:28:21 +01:00

Logo i3: A tiling window manager

Build Status Issue Stats Pull Request Stats

Packages Packages

i3 is a tiling window manager for X11.

For more information about i3, please see the project's website and online documentation.

For information about contributing to i3, please see CONTRIBUTING.md.