From d19c32d7a4ce9e884dc0b82c698f6abfeddfc18e Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 26 Jan 2024 10:53:03 +0000 Subject: [PATCH] Release 2.3.0 Functionality: * Add configuration to anchor position of messages (#60, 71 in Bugs.md). * Add output priorisation (#38, 68 in Bugs.md). * Print whether output is active in dump. Bug Fixes: * Fix gamma control (72 in Bugs.md). * Add missing commands to example config. * Add message_config to dump output. Example Scripts: * Add screenshot script. * Make example scripts standalone. Documentation: * Escape html tags in config man page. (#68, 69 in Bugs.md) * Improve README.md (#62, 70 in Bugs.md). * Improve SECURITY.md. * Add CONTRIBUTING.md (#62, 70 in Bugs.md). * FAQ: Add Firefox screenshare instructions for wayland. * FAQ: Add wlroots downgrading instructions for workaround in case of temporary wlroots incompatibility. * Update copyright notices to 2024. Development Tooling: * Add new gpg keys (signed by the old ones). * Add PR template. * Add dev-FAQ. * Remove now-unnecessary fanalyzer pragmas. --- Bugs.md | 52 ++ CONTRIBUTING.md | 464 ++++++++++++ Changelog.md | 184 +++-- FAQ.md | 37 +- Hashes.md | 20 + LICENSE | 2 +- README.md | 700 +++--------------- SECURITY.md | 63 +- cagebreak.c | 23 +- docs/dev-FAQ.md | 67 ++ docs/pull_request_template.md | 26 + example_scripts/screenshot_script | 44 ++ ...orkspace_views.sh => show_workspace_views} | 20 +- examples/config | 62 +- fuzz/execl_override.c | 2 +- fuzz/fuzz-lib.c | 4 +- fuzz/fuzz-lib.h | 2 +- fuzz/fuzz-parse.c | 2 +- idle_inhibit_v1.c | 9 +- idle_inhibit_v1.h | 2 +- img/archwiki.svg | 1 + img/aur.svg | 1 + img/contributing.svg | 1 + img/faq.svg | 1 + img/mail.svg | 1 + img/manuals.svg | 1 + img/web-artefacts.svg | 1 + img/web-open-issue.svg | 1 + input.h | 2 +- input_manager.c | 2 +- input_manager.h | 2 +- ipc_server.c | 2 +- ipc_server.h | 2 +- keybinding.c | 150 ++-- keybinding.h | 2 +- keys/cagebreak@project-repo.co.pub | 157 ++-- keys/cagebreak@project-repo.co.pub-legacy-4 | 87 +++ ...gebreak_signing_key_13@project-repo.co.pub | 76 ++ ...gebreak_signing_key_14@project-repo.co.pub | 76 ++ libinput.c | 4 +- man/cagebreak-config.5.md | 154 ++-- man/cagebreak-socket.7.md | 176 ++++- man/cagebreak.1.md | 10 +- manuals.md | 5 + meson.build | 24 +- meson_options.txt | 4 +- message.c | 103 ++- message.h | 10 +- output.c | 329 +++++--- output.h | 21 +- pango.c | 2 +- pango.h | 2 +- parse.c | 41 +- parse.h | 2 +- release-non-auto-checks/Bugs.md | 4 +- release-non-auto-checks/FAQ.md | 4 +- release-non-auto-checks/SECURITY.md | 4 +- release-non-auto-checks/WLR_XDG_VERSION | 4 +- .../acknowledge-contributors | 4 +- release-non-auto-checks/archwiki | 2 + release-non-auto-checks/changelog-major-minor | 4 +- release-non-auto-checks/internal-wiki | 4 +- release-non-auto-checks/release-note | 4 +- .../reproducibility-checked | 4 +- .../security-to-man-page-info-transfer | 4 +- release-non-auto-checks/version-restrictions | 4 +- scripts/adjust-epoch | 2 +- scripts/create-release-artefacts | 2 +- scripts/create-signatures | 2 +- scripts/fuzz | 2 +- scripts/git-tag | 2 +- scripts/install-development-environment | 2 +- scripts/output-hashes | 2 +- scripts/set-version | 4 +- seat.c | 75 +- seat.h | 2 +- server.c | 5 +- server.h | 5 +- signatures/2.2.3-cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/2.2.3-cagebreak-socket.7.sig | Bin 0 -> 566 bytes signatures/2.2.3-cagebreak.1.sig | Bin 0 -> 566 bytes signatures/2.2.3-cagebreak.sig | Bin 0 -> 566 bytes signatures/cagebreak-config.5.sig | Bin 566 -> 566 bytes signatures/cagebreak-socket.7.sig | Bin 566 -> 566 bytes signatures/cagebreak.1.sig | Bin 566 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes test/arguments | 2 +- test/build-w-o-warnings | 2 +- test/build-w-o-xwayland | 2 +- test/check-artefacts | 2 +- test/clang-format | 2 +- test/copyright-license | 4 +- test/environment-variables | 2 +- test/git-tag | 2 +- test/gpg-signatures | 2 +- test/gpg-validity | 24 +- test/hashes-md | 2 +- test/illegal-strings | 14 +- test/man-pages | 37 + test/non-auto-tests | 2 +- test/scan-build | 2 +- test/script-executability | 19 + test/script-header | 17 + test/shellcheck | 2 +- test/testing-configurations/-c-config | 2 +- .../cb_script_header.sh | 4 +- test/testing-configurations/config | 2 +- test/testing-configurations/env-var-config | 2 +- test/testing-configurations/my-scan-build | 2 +- test/versions | 2 +- util.c | 2 +- util.h | 2 +- view.c | 26 +- view.h | 2 +- workspace.c | 31 +- workspace.h | 3 +- xdg_shell.c | 24 +- xdg_shell.h | 2 +- xwayland.c | 24 +- xwayland.h | 2 +- 120 files changed, 2311 insertions(+), 1349 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 docs/dev-FAQ.md create mode 100644 docs/pull_request_template.md create mode 100755 example_scripts/screenshot_script rename example_scripts/{show_workspace_views.sh => show_workspace_views} (54%) mode change 100644 => 100755 create mode 100644 img/archwiki.svg create mode 100644 img/aur.svg create mode 100644 img/contributing.svg create mode 100644 img/faq.svg create mode 100644 img/mail.svg create mode 100644 img/manuals.svg create mode 100644 img/web-artefacts.svg create mode 100644 img/web-open-issue.svg create mode 100644 keys/cagebreak@project-repo.co.pub-legacy-4 create mode 100644 keys/cagebreak_signing_key_13@project-repo.co.pub create mode 100644 keys/cagebreak_signing_key_14@project-repo.co.pub create mode 100644 manuals.md create mode 100644 release-non-auto-checks/archwiki mode change 100644 => 100755 scripts/install-development-environment create mode 100644 signatures/2.2.3-cagebreak-config.5.sig create mode 100644 signatures/2.2.3-cagebreak-socket.7.sig create mode 100644 signatures/2.2.3-cagebreak.1.sig create mode 100644 signatures/2.2.3-cagebreak.sig create mode 100644 test/man-pages create mode 100644 test/script-executability create mode 100644 test/script-header rename {example_scripts => test/testing-configurations}/cb_script_header.sh (89%) diff --git a/Bugs.md b/Bugs.md index be04464..4ecef6c 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1252,3 +1252,55 @@ To stop this from reoccurring, we have added a check to our release checks. In Cagebreak 2.2.2 dual monitors were mirrored instead of extended, changing established behaviour. +## Issue 68 + + * github issue numner: #38 + * Fixed: 2.3.0 + +After extensive discussion of how to deal with turning off outputs, the +output command was ammended by two settings (permanent & peripheral). +See man pages for details. + +Thanks to sodface for the great cooperation. + +## Issue 69 + + * github issue numner: #68 + * Fixed: 2.3.0 + +The config man page (5) was badly formatted up to version 2.3.0. + +Particularly unescaped html tags caused not all information to be +shown in the web browser view of our repo. + +## Issue 70 + + * github issue numner: #62 + * Fixed: 2.3.0 + +The README contained a few non-intuitive phrases up to version 2.3.0. + +To alleviate this, the following changes were made: + +- Rephrase README.md (for more clarity) +- Add CONTRIBUTING.md (to remove dev detail from README) +- Add PR template (to present relevant info during a PR) + +## Issue 71 + + * github issue numner: #60 + * Fixed: 2.3.0 + +Cagebreak up to 2.3.0 did not have configuration for the message location. + +This has been added through the initiative of unsigned-enby to improve +accessibility. + +## Issue 72 + + * github issue numner: N/A + * Fixed: 2.3.0 + +A Cagebreak version before 2.3.0 broke the gamma toolkit used to tune the +monitor colors. + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4da2ae2 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,464 @@ +# Contributing + + * [Open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your feature request. + We will get back to you. + * Read this document, [README.md](README.md) and [docs/dev-FAQ.md](docs/dev-FAQ.md). + * Ask before opening a pull request. We might not accept your + code and it would be sad to waste the effort. + * Respect the [Code of Conduct](CODE_OF_CONDUCT.md) (To date, we never + had to intervene - Please keep it that way!) + +## Good First Contributions + + * Reviews are always welcome. + * Read the code. + * Read the documentation. + * Test whether the documentation matches the code. + * Test Cagebreak in more esoteric setups (many monitors, for instance). + * Compile the code. + * Ideas on improving the testing and quality assurance are particularly + welcome. + * You can share your cagebreak scripts and we might include them with Cagebreak + provided you agree to release them under MIT and we agree with the + use case and coding style. + * If you are happy with Cagebreak under Arch Linux, you may vote for + [Cagebreak in the AUR](https://aur.archlinux.org/packages/cagebreak). + * The points from the Contributing section above still apply. + +## Philosophy + +Cagebreak is currently developed to fit the needs of its creators. + +The feature set is intentionally limited - we removed +support for a desktop background image for example. + +Nonetheless, don't be intimidated by any other part of this file. +Do your best and we will collaborate toward a solution. + +# Development + +## Compatibility & Development Distribution + +Cagebreak supports [Arch Linux](https://archlinux.org/) and uses the libraries +versions as they are obtained from extra and core +at the time of release. + +However, Cagebreak may also work on other distributions given the +proper library versions (Some package maintainers have done this and it +seems to work (To date, we dealt with a few Issues and never felt the +need to ask for the distribution the user was having the issue on.)). + +[![Packaging status](https://repology.org/badge/vertical-allrepos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) + +You should use Arch Linux if you want to modify Cagebreak +for yourself. + +## Review Requirements + +Project-repo will review your proposal before your implementation for feasibility +and desirability. After your pull request, the code will be reviewed in conjunction +with all other changes before the release as per the release procedure. + +All reviews performed by project-repo are verified by at least two people internally. + +## Developer Certificate of Origin (DCO) + +On any pull requests please include a + +``` +signed-off-by: YOUR IDENTIFIER OR NAME +``` + +DCO statement. + +By doing this you claim that you are legally allowed to contribute the +code and agree to let project-repo publish it under the MIT License. + +### Development Environment + +CAVEAT: This script works exclusively on Arch Linux, which, as outlined above, +is the development distribution of Cagebreak. + +Cloning the Cagebreak repository and building it is sufficient as a starting point. + +All other dependencies can be installed by invoking + +``` +meson compile devel-install -C build +``` + +if meson is already available or + +``` +./scripts/install-development-environment +``` + +otherwise. + +### Scripts + +Cagebreak provides a few convenience tools to facilitate development. + +#### Fuzzing + +If your fuzzing corpus is located in the directory `fuzz_corpus` you can +just call: + +``` +meson compile fuzz -C build +``` + +If you want to use a different directory, configure cagebreak with +`-Dcorpus=OTHERDIRECTORY` or call `./scripts/fuzz OTHERDIRECTORY`. + +#### Adjusting Epoch + +To facilitate the creation of reproducible man pages an arbitrary release +time has to be set in `meson.build`: + +``` +meson compile adjust-epoch -C build +``` + +or + +``` +./scripts/adjust-epoch +``` + +#### Git tag + +If you are on the master branch, everything is ready and you want to create +a release tag you can call: + +``` +meson compile git-tag -C build +``` + +If you want to use another signing key than the prespecified one, configure +Cagebreak with `-Dgpg_id=GPGID`. + +``` +./scripts/git-tag GPGID CBVERSION +``` + +can be used alternatively. + +#### Output Hashes + +Hashes of release versions of all binaries can be output to `local-hashes.txt` +via: + +``` +meson compile output-hashes -C build +``` + +Or + +``` +./scripts/output-hashes VERSION +``` + +if meson is unavailable. + +#### Create Signatures + +Creation of signatures for releases can be achieved through: + +``` +meson compile create-sigs -C build +``` + +Configure Cagebreak with `-Dgpg_id=GPGID` for a different gpg signing +key. + +Without meson use: + +``` +./scripts/create-signatures GPGID +``` + +#### Set Version Number + +Once the version number is set within meson.build, you can use + +``` +meson compile set-ver -C build +``` + +to set the version number in the man pages and README repology minversion. + +Use of the script without meson is discouraged because meson.build is +not touched by the script. + +#### Create Release Artefacts + +The following command generates the release artefacts which must be created +once a release is completely ready to be published (the commit is tagged with +the version of the master branch, etc.): + +``` +meson compile create-artefacts -C build +``` + +Use of the script version is discouraged. + +## GCC and -fanalyzer + +Cagebreak should compile with any reasonably new gcc or clang. Consider +a gcc version of at least [10.1](https://gcc.gnu.org/gcc-10/changes.html) if +you want to get the benefit of the +[-fanalyzer](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) +flag. However, this new flag sometimes produces false-postives and we +selectively disable warnings for affected code segments as described below. + +Meson is configured to set `CG_HAS_FANALYZE` if `-fanalyzer` is available. +Therefore, to maintain portability, false-positive fanalyzer warnings are to be +disabled using the following syntax: + +``` +#if CG_HAS_FANALYZE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "WARNING OPTION" +#endif +``` +and after + +``` +#if CG_HAS_FANALYZE +#pragma GCC diagnostic pop +#endif +``` + +## Test Suite + +``` +meson test -C build +``` + +invokes all tests. This is required for a release to occur. + +There are four test suites: + + * basic: tests actual outward-facing functionality + * Note optional dependencies for efficient socket interaction + * nc (openbsd-netcat) + * jq + * devel: tests internal properties of the repository + * Note potentially heavier dependencies such as + * shellcheck + * clang-format + * devel-long: applies more costly testing + * Note potentially heavier dependencies such as + * scan-build (static analysis (including security-relevant issues)) + * release: tests release specific considerations + * Note that this is only expected to pass just before + a release. This checks mostly administrative things + to check that a release is ready. + * Note that non-auto tests are files in `release-non-auto-checks` + and have to contain the release version and current date in + YYYY-mm-dd format on seperate lines. This is our imperfect attempt + to guarantee some hard-to-automate checks are carried out before + a release is undertaken. + +Every commit should pass at least the basic and devel suites. + +It is expected that cagebreak passes at least the +basic, devel and devel-long suites when commits are pushed: + +``` +meson test -C build --suite basic --suite devel +``` + +The basic suite can be used to test a binary. This is +useful for PKGBUILDs and their equivalents in other +systems. + +``` +meson test -C build --suite basic +``` + +## Fuzzing + +Along with the project source code, a fuzzing framework based on `libfuzzer` is +supplied. This allows for the testing of the parsing code responsible for reading +the `cagebreak` configuration file. When `libfuzzer` is available (please +use the `clang` compiler to enable it), building the fuzz-testing software can +be enabled by passing `-Dfuzz=true` to meson. This generates a `build/fuzz/fuzz-parse` +binary according to the `libfuzzer` specifications. Further documentation on +how to run this binary can be found [here](https://llvm.org/docs/LibFuzzer.html). + +Here is an example workflow: + +``` +rm -rf build +CC=clang meson setup build -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef=false +ninja -C build/ +mkdir build/fuzz_corpus +cp examples/config build/fuzz_corpus/ +WLR_BACKENDS=headless ./build/fuzz-parse -jobs=12 -max_len=50000 -close_fd_mask=3 build/fuzz_corpus/ +``` + +You may want to tweak `-jobs` or add other options depending on your own setup. +We have found code path discovery to increase rapidly when the fuzzer is supplied +with an initial config file. We are working on improving our fuzzing coverage to +find bugs in other areas of the code. + +### Caveat + +Currently, there are memory leaks which do not seem to stem from our code but rather +the code of wlroots or some other library we depend on. We are working on the problem. +In the meantime, add `-Db_detect-leaks=0` to the meson command to exclude memory leaks. + +## Reproducible Builds + +Cagebreak offers reproducible builds given the exact library versions specified +in `meson.build`. Should a version mismatch occur, a warning will be emitted. We have +decided on this compromise to allow flexibility and security. In general we will +adapt the versions to the packages available under Arch Linux at the time of +release. + +There are reproducibility issues up to and including release `1.2.0`. See +`Issue 5` in [Bugs.md](Bugs.md). + +### Reproducible Build Instructions + +All hashes and signatures are provided for the following build instructions. + +``` +meson setup build -Dxwayland=true -Dman-pages=true --buildtype=release +ninja -C build +``` + +### Hashes for Builds + +For every release after 1.0.5, hashes will be provided. + +For every release after 1.7.0, hashes will be provided for man pages too. + +See [Hashes.md](Hashes.md) + +### GPG Signatures + +For every release after 1.0.5, a GPG signature will be provided in `signatures`. + +The current signature is called `cagebreak.sig`, whereas all older signatures +will be named after their release version. + +Due to errors in the release process, the releases 1.7.1 and 1.7.2 did not include the release +signatures in the appropriate folder of the git repository. However, signatures were provided +as release-artefacts at the time of release. The signatures were introduced into the +repository with 1.7.3. The integrity of cagebreak is still the same because the signatures were +provided as release-artefacts (which were themselves signed) and the hashes in Hashes.md +are part of a signed release tag. + +### Signing Keys + +All releases are signed by at least one of the following collection of +keys. + + * E79F6D9E113529F4B1FFE4D5C4F974D70CEC2C5B (expired) + * 4739D329C9187A1C2795C20A02ABFDEC3A40545F (expired) + * 7535AB89220A5C15A728B75F74104CC7DCA5D7A8 (expired) + * 827BC2320D535AEAD0540E6E2E66F65D99761A6F (expired) + * A88D7431E5BAAD0B6EAE550AC8D61D8BD4FA3C46 (expired) + * 8F872885968EB8C589A32E9539ACC012896D450F (expired) + * 896B92AF738C974E0065BF42F2576BD366156BB9 (expired) + * AA927AFD50AF7C6810E69FE8274F2C605359E31B (expired) + * BE2DED372287BC4EB2213E13A0C743848A638955 (expired) + * 0F3476E4B2404F95EC41600683D5810F7911B020 (expired) + * [4E82C72C6B3E58A7BC4FF8554909F84CA83BB867](keys/cagebreak_signing_key_11@project-repo.co.pub) + * [5AEB1A2EB0D13F67E306AC59DC0CC81BE006FD85](keys/cagebreak_signing_key_12@project-repo.co.pub) + * [438C27DDB5D174673DF4D67B451205B3528C7C63](keys/cagebreak_signing_key_13@project-repo.co.pub) + * [81372DDB8124349F0303B77448D7E2EE3343E3AA](keys/cagebreak_signing_key_14@project-repo.co.pub) + +Should we at any point retire a key, we will only replace it with keys signed +by at least one of the above collection. + +We registered project-repo.co and added mail addresses after release `1.3.0`. + +We now have a mail address and its key is signed by signing keys. See [SECURITY.md](SECURITY.md) +for details. + +The full public keys can be found in `keys/` along with any revocation certificates. + +## Versioning & Branching Strategy + +Cagebreak uses [semantic versioning](https://semver.org). + +There are three permanent branches in cagebreak: + + * `master` (for releases) + * `development` (for polishing code between releases) + * `hotfix` (for small emergent releases, usually up-to-date with master) + +Releases are merged to master as per the release procedure, with +reasonable exceptions as the situation requires. + +The release commit is tagged with the release version. + +In the past, our git history did not perfectly reflect this scheme. + +## Release Procedure + +The release procedure outlines the process for a release to occur. + + * [ ] `git checkout development` + * [ ] `git pull origin development` + * [ ] `git push origin development` + * [ ] Arch Build System is up to date + * [ ] `meson test -C build/` just to get an overview + * [ ] Update internal wiki + * [ ] Adjust version number in meson.build + * [ ] `meson compile set-ver -C build` + * [ ] Add new files to meson.build or hardcoded testing variable + * [ ] Commit changes + * [ ] `git push origin development` + * [ ] Complete relevant documentation + * [ ] New features + * [ ] tests added and old test scripts adjusted + * [ ] man pages + * [ ] cagebreak + * [ ] cagebreak-config + * [ ] cagebreak-socket + * [ ] example config + * [ ] FAQ.md + * [ ] Changelog.md for major and minor releases but not patches + * [ ] Check changes for SECURITY.md relevance (changes to socket scope for example) + * [ ] Synchronize any socket changes to cagebreak-socket man page + * [ ] Document fixed bugs in Bugs.md + * [ ] Include issue discussion from github, where applicable + * [ ] `meson compile adjust-epoch -C build` + * [ ] Commit changes + * [ ] `git push origin development` + * [ ] Testing + * [ ] Manual testing + * [ ] `meson compile fuzz -C build` for at least one hour + * [ ] Adjust Hashes.md - Use `meson compile output-hashes -C build` to add Hashes or aid in repro check + * [ ] Commit changes + * [ ] `git push origin development` + * [ ] Complete release-non-auto-checks + * [ ] `meson compile create-sigs -C build` + * [ ] Commit and push signatures, hashes and non-auto-check files + * [ ] `meson test -C build` passes everything except some release tests + * [ ] `git add` relevant files + * [ ] `git commit` + * [ ] `git push origin development` + * [ ] `git checkout master` + * [ ] `git pull --tags origin master` + * [ ] `git merge --squash development` + * [ ] `git commit` and insert message + * [ ] `meson compile git-tag -C build` + * [ ] `meson compile create-artefacts -C build` + * [ ] `meson test -C build` THIS MUST PASS WITHOUT ANY FAILURES WHATSOEVER + * [ ] `git push --tags origin master` + * [ ] `git checkout development` (merge to development depends on whether release was a hotfix) + * [ ] `git merge master` + * [ ] `git push --tags origin development` + * [ ] `git checkout hotfix` (hotfix is to be kept current with master after releases) + * [ ] `git merge master` + * [ ] `git push --tags origin hotfix` + * [ ] Upload archives and signatures as release assets + * [ ] Delete feature branches if appropriate + * [ ] Manage package release + diff --git a/Changelog.md b/Changelog.md index b9f7461..a3223e5 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,74 +1,62 @@ # Changelog -## Release 1.0.0 - -Adds basic tiling window manager functionality to cage. - -## Release 1.1.0 - -Unifies commands and actions. See Issue 4 in Bugs.md. - -## Release 1.2.0 - -Adds output configuration as described in the man pages. - -## Release 1.3.0 - -Adds IPC as described in the man pages. +## Release 2.3.0 + +Functionality: + * Add configuration to anchor position of messages (#60, 71 in Bugs.md). + * Add output priorisation (#38, 68 in Bugs.md). + * Print whether output is active in dump. + +Bug Fixes: + * Fix gamma control (72 in Bugs.md). + * Add missing commands to example config. + * Add message_config to dump output. + +Example Scripts: + * Add screenshot script. + * Make example scripts standalone. + +Documentation: + * Escape html tags in config man page. (#68, 69 in Bugs.md) + * Improve README.md (#62, 70 in Bugs.md). + * Improve SECURITY.md. + * Add CONTRIBUTING.md (#62, 70 in Bugs.md). + * FAQ: Add Firefox screenshare instructions for wayland. + * FAQ: Add wlroots downgrading instructions for workaround in case of temporary wlroots incompatibility. + * Update copyright notices to 2024. + +Development Tooling: + * Add new gpg keys (signed by the old ones). + * Add PR template. + * Add dev-FAQ. + * Remove now-unnecessary fanalyzer pragmas. -## Release 1.4.0 - -Adds close command for windows as described in the man pages. - -## Release 1.5.0 - -Adds options to disable or enable outputs. See Issue 22 in Bugs.md and Issue #2 on github. - -## Release 1.6.0 - -Adds support for non-build dependencies and an option for builds without pandoc. - -## Release 1.7.0 - -Improves window ordering. - -## Release 1.8.0 +## Release 2.2.0 -Adds libinput configuration and virtual keyboard and pointer support. + * Add custom events + * Fix Issue 62 (#46 Github) + * Fix Issue 63 (environment variables test) + * Fix Issue 64 (pointer focus bug) -## Release 1.9.0 +## Release 2.1.0 -- Add message functionality (as per Issue 29 in Bugs.md) - - message - - configure_message -- Add (as per Issue 30 in Bugs.md) - - movetoprevscreen - - movetoscreen - - screen - - additional output functionality for monitor numbering -- Improve configuration documentation - - Fix Issue 31 in Bugs.md (word omission) -- Improve README.md and split off some files - - Add SECURITY.md - - Add Hashes.md (hashes of cagebreak binaries and man pages if built reproducably) - - Add Changelog.md (changelog for major and minor releases but not patches) - - Add FAQ.md (updated information from the former wiki) -- Depreciate wiki -- Fix Issue 32 in Bugs.md - - Improve release checklist to partially prevent the above issue - in the future -- Fix Issue 33 in Bugs.md -- Fix Issue 34 in Bugs.md -- Manage gpg keys - - Add new cagebreak gpg signing keys - - Add new cagebreak email contact gpg key - - Add new project-repo AUR gpg key (relevant for cagebreak-pkgbuild) + * Add -bs (bad security) option + * Fix Issue 57 (SPDX spelling error #39) + * Fix Issue 59 (meson install settings) + * Fix Issue 55 (npd) + * Fix Issue 56 (npd) + * Fix Issue 58 (#40 config) + * Improve release procedure + * Add miniscule test suite + * Adjust Cagebreak to wlroots 0.16.2 + * New GPG Keys ## Release 2.0.0 This is a major release and includes BREAKING changes! Breaking Changes: + * More intuitive switch of focus, next, prev and exchange (#20, 40 in Bugs.md) Cagebreak will probably still feel broadly the same though. * Remove -r flag - This is replaced by output configuration. @@ -79,6 +67,7 @@ Breaking Changes: * Rename "Current frame" indicator to "Current tile" Changelog: + * Move to wlr_scene * Add events displaying change over the socket * this enables scripting tools @@ -107,22 +96,67 @@ Changelog: * Add Code of Conduct * Print version number on startup -## Release 2.1.0 +## Release 1.9.0 - * Add -bs (bad security) option - * Fix Issue 57 (SPDX spelling error #39) - * Fix Issue 59 (meson install settings) - * Fix Issue 55 (npd) - * Fix Issue 56 (npd) - * Fix Issue 58 (#40 config) - * Improve release procedure - * Add miniscule test suite - * Adjust Cagebreak to wlroots 0.16.2 - * New GPG Keys +- Add message functionality (as per Issue 29 in Bugs.md) + - message + - configure_message +- Add (as per Issue 30 in Bugs.md) + - movetoprevscreen + - movetoscreen + - screen + - additional output functionality for monitor numbering +- Improve configuration documentation + - Fix Issue 31 in Bugs.md (word omission) +- Improve README.md and split off some files + - Add SECURITY.md + - Add Hashes.md (hashes of cagebreak binaries and man pages if built reproducably) + - Add Changelog.md (changelog for major and minor releases but not patches) + - Add FAQ.md (updated information from the former wiki) +- Depreciate wiki +- Fix Issue 32 in Bugs.md + - Improve release checklist to partially prevent the above issue + in the future +- Fix Issue 33 in Bugs.md +- Fix Issue 34 in Bugs.md +- Manage gpg keys + - Add new cagebreak gpg signing keys + - Add new cagebreak email contact gpg key + - Add new project-repo AUR gpg key (relevant for cagebreak-pkgbuild) -## Release 2.2.0 +## Release 1.8.0 + +Adds libinput configuration and virtual keyboard and pointer support. + +## Release 1.7.0 + +Improves window ordering. + +## Release 1.6.0 + +Adds support for non-build dependencies and an option for builds without pandoc. + +## Release 1.5.0 + +Adds options to disable or enable outputs. See Issue 22 in Bugs.md and Issue #2 on github. + +## Release 1.4.0 + +Adds close command for windows as described in the man pages. + +## Release 1.3.0 + +Adds IPC as described in the man pages. + +## Release 1.2.0 + +Adds output configuration as described in the man pages. + +## Release 1.1.0 + +Unifies commands and actions. See Issue 4 in Bugs.md. + +## Release 1.0.0 + +Adds basic tiling window manager functionality to cage. - * Add custom events - * Fix Issue 62 (#46 Github) - * Fix Issue 63 (environment variables test) - * Fix Issue 64 (pointer focus bug) diff --git a/FAQ.md b/FAQ.md index d8918a0..83fd29b 100644 --- a/FAQ.md +++ b/FAQ.md @@ -2,14 +2,9 @@ ## How do I do a particular thing with cagebreak? - * Check the man pages - * [cagebreak config](man/cagebreak-config.5.md) (probably where you find the answer) - * [cagebreak](man/cagebreak.1.md) (command line options etc.) - * [cagebreak-socket](man/cagebreak-socket.7.md) (socket information, mostly useful for scritping) - * Check the rest of this FAQ - * [Open an issue](https://github.com/project-repo/cagebreak/issues/new) or otherwise get in touch with the development team (See section Email Contact in [SECURITY.md](SECURITY.md)). - -Note that the feature set of cagebreak is intentionally limited. + * Check the [man pages](manuals.md). + * Check the rest of this file. + * [Open an issue](https://github.com/project-repo/cagebreak/issues/new) or get in touch (See section Email Contact in [SECURITY.md](SECURITY.md)). ## How do I remap Caps Lock? @@ -17,6 +12,21 @@ Remapping Caps Lock globally seems to be the best option. Follow instructions [here](https://wiki.archlinux.org/title/Linux_console/Keyboard_configuration) to achieve this (should be roughly distribution-agnostic). +## What do I do if Cagebreak does not work with the current wlroots version? + +You can probably downgrade wlroots with + +``` +$ pacman -U /var/cache/pacman/pkg/old-version +``` + +If you have cleared your package cache, see instructions in the [ArchWiki](https://wiki.archlinux.org/title/downgrading_packages#Return_to_an_earlier_package_version). + +Cagebreak should start working again after the downgrade. + +After a new release, the downgrading will no longer be necessary (in fact, +downgrading will probably break your setup). + ## How do I get firefox to run under wayland? Set the following environment variables @@ -26,6 +36,17 @@ Set the following environment variables to activate wayland support for firefox. +## How do I get firefox to screenshare properly? + +Execute the following commands with the appropriate env vars: + +``` +export XDG_SESSION_TYPE=wayland +export XDG_CURRENT_DESKTIP=sway +/usr/lib/xdg-desktop-portal -r +/usr/lib/xdg-desktop-portal-wlr +``` + ## How do I map characters which are not on the Keyboard? Suppose you want to use a command like `bind` for a character diff --git a/Hashes.md b/Hashes.md index 867692b..2930148 100644 --- a/Hashes.md +++ b/Hashes.md @@ -1,5 +1,25 @@ # Hashes +2.3.0 cagebreak + + * sha 256: 549e82f6bb1af87c9272fb92d39c6f235b0f780885b066c32db5a5c7588da378 + * sha 512: d05e5ac9e4295bed93b8872a815b1f8aaf8ddc2448c01f84d5d29b4d5610bb5c0c50f87b15653bb663a9f772a899dc7b8215042db3ac86aa1ba3000ccb9757d2 + +2.3.0 cagebreak.1 + + * sha 256: 11cbe6ea82fa19064ee5b9d8346dbaa8ca8251948c5f5eee7387516edcfbeab0 + * sha 512: 76f15788aeebb2cab5a0a477f1427646964c6011c20d64f43f6c445bf08e5371971607a7565017fd05f4f2d75c66da5d79948643618eeb4d3619bc7e6128cffe + +2.3.0 cagebreak-config.5 + + * sha 256: dc8755bbed108cd0cf76f05eee0c6d08550373eab5f75895755abddb7b86e84c + * sha 512: b93caa7cd4ec9085409472982ce72a8e55a369cb830a7d3132801b24db0660e4259a3e9b229dbaf960bc28c4d8a384a19f7bbb11e74f7c4e3f90b04d2b5280ee + +2.3.0 cagebreak-socket.7 + + * sha 256: f33abe5f18cb087ab421c3b647437c31a01e5c731638cac859a9b9ea1f88099e + * sha 512: f973bd2a67d9ca8b4bf2d150c4f1151163f379c7048e1e4be098d8032a424c77bd4dfaa98635bb8cdefa0b2da147b9b6a87bcbcaa87c378b5040e708f8ca5a97 + 2.2.3 cagebreak * sha 256: 265a9d09622272ca6ea79ddcdbdc6003704106814eb05a2b7547a77a982263de diff --git a/LICENSE b/LICENSE index e0aba93..462eccf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020-2023 The Cagebreak authors +Copyright (c) 2020-2024 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes Copyright (c) 2019 The Sway authors diff --git a/README.md b/README.md index 1ca4ce5..79397ea 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,55 @@ -# Cagebreak: A Wayland Tiling Compositor - -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.2.3)](https://repology.org/project/cagebreak/versions) - -## Quick Introduction - -Cagebreak is a [Wayland](https://wayland.freedesktop.org/) tiling compositor -based on [Cage](https://github.com/Hjdskes/cage) and inspired by [ratpoison](https://www.nongnu.org/ratpoison/). - -### Purpose - -This project provides a successor to ratpoison for Wayland. -However, this is no reimplementation of ratpoison. - -#### New Features, Bugs and Contact Information - -You can [open an issue](https://github.com/project-repo/cagebreak/issues/new) -or write an e-mail (See [SECURITY.md](SECURITY.md) for details.). - -The Roadmap section outlines our plans. - -#### Compatibility & Development Distribution - -Cagebreak supports [Arch Linux](https://archlinux.org/) and uses the libraries -and versions from extra and core at the time of release. -Most other setups work with a bit of luck. - -### Quick Installation - -This assumes Arch Linux: - -1. Use the [cagebreak PKGBUILD](https://aur.archlinux.org/packages/cagebreak). -2. Add an example config such as [config](examples/config) to `$USER/.config/cagebreak/config` -3. Execute cagebreak like any other binary. - -See the [ArchWiki](https://wiki.archlinux.org/title/Cagebreak#Getting_started) for -details on getting started and the documentation for everything else. - -### Documentation - - * the man pages: [cagebreak](man/cagebreak.1.md), [configuration](man/cagebreak-config.5.md) & [socket](man/cagebreak-socket.7.md) - * the [README](README.md), [FAQ](FAQ.md) & [SECURITY.md](SECURITY.md) - -#### What's new? - -Check the [Changelog](Changelog.md). - -### Uninstallation - -`pacman -R cagebreak` should be sufficient. - -### Contributing - - * [Open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your idea. - We will get back to you. - * Ask before you open a pull request. We might not accept your code and - it would be sad to waste the effort. - * Respect the [Code of Conduct](CODE_OF_CONDUCT.md) (To date, we never - had to intervene - Keep it that way!) - -### Name - -Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk -compositor. Since it breaks the kiosk into tiles the name -Cagebreak seemed appropriate. +# Cagebreak: A Tiling Wayland Compositor + +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.3.0)](https://repology.org/project/cagebreak/versions) + +[![Contact](img/mail.svg)](SECURITY.md) [![Manuals](img/manuals.svg)](manuals.md) [![FAQ](img/faq.svg)](FAQ.md) [![CONTRIBUTING](img/contributing.svg)](CONTRIBUTING.md) [![ArchWiki](img/archwiki.svg)](https://wiki.archlinux.org/title/Cagebreak) [![AUR](img/aur.svg)](https://aur.archlinux.org/packages?O=0&K=cagebreak) + +## Introduction + +Cagebreak provides a [ratpoison](https://www.nongnu.org/ratpoison/)-inspired, [cage](https://github.com/Hjdskes/cage)-based, tiling [Wayland](https://wayland.freedesktop.org/) compositor. + + * Bugs, Contact Information and New Features: + * [Open an issue](https://github.com/project-repo/cagebreak/issues/new). + * Write an e-mail (See [SECURITY.md](SECURITY.md)). + * The Roadmap below outlines our plans. + * Compatibility & Development Distribution: + * Cagebreak supports [Arch Linux](https://archlinux.org/) and uses the library + versions from extra and core at the time of release. + Most other setups work with a [bit of luck](https://repology.org/project/cagebreak/versions). + * Quick Installation (on ArchLinux, more [here (ArchWiki)](https://wiki.archlinux.org/title/Cagebreak)): + 1. Use the [cagebreak PKGBUILD](https://aur.archlinux.org/packages/cagebreak). + 2. Add an example config such as [config](examples/config) to `$USER/.config/cagebreak/config` + 3. Execute cagebreak like any other binary. + * Documentation: + * [man pages](manuals.md) + * [README](README.md), [FAQ](FAQ.md) & [SECURITY.md](SECURITY.md) + * What's new?: [Changelog](Changelog.md) + * Uninstallation: `pacman -R cagebreak` + * Contributing: + * [Open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your idea. + We will get back to you. + * Ask before you open a pull request. We might not accept your code and + it would be sad to waste the effort. + * Respect the [Code of Conduct](CODE_OF_CONDUCT.md) (To date, we've never + had to intervene. - Keep it that way!) + * Name: Cagebreak breaks the kiosk of [Cage](https://github.com/Hjdskes/cage) into tiles, hence the name. ## Installation -On Arch Linux, just use the PKGBUILDs from the [AUR](https://aur.archlinux.org/): +On [Arch Linux](https://archlinux.org/), use the [AUR](https://aur.archlinux.org/) [PKGBUILDs](https://wiki.archlinux.org/title/PKGBUILD): * Using [cagebreak](https://aur.archlinux.org/packages/cagebreak), Cagebreak is - compiled on the target system (since release 1.3.0) + built on the target system (since release 1.3.0) * Using [cagebreak-bin](https://aur.archlinux.org/packages/cagebreak-bin), - the pre-built binaries are extracted to - appropriate paths on the target system (since release 1.3.2) + pre-built binaries are extracted + to the target system (since release 1.3.2) See [cagebreak-pkgbuild](https://github.com/project-repo/cagebreak-pkgbuild) for details. +You may check out other distros here: + +[![Packaging status](https://repology.org/badge/vertical-allrepos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) + ### Obtaining Source Code There are different ways to obtain cagebreak source: @@ -85,61 +59,69 @@ There are different ways to obtain cagebreak source: #### Verifying Source Code -There are corresponding methods of verifying that you obtained the correct code: +There are ways to verify that you obtained the correct source (See `keys/` +and [CONTRIBUTING](CONTRIBUTING.md)): - * our git history includes signed tags for releases - * release assets starting at release 1.2.1 contain a signature for the tarball + * signature for the tarball of release assets starting at release 1.2.1 + * signed tags for releases in the git history ## Building Cagebreak -You can build Cagebreak with the [meson](https://mesonbuild.com/) build system. It -requires wayland, wlroots and xkbcommon to be installed. Note that Cagebreak is -developed against the latest tag of wlroots, in order not to constantly chase -breaking changes as soon as they occur. +Cagebreak uses the [meson](https://mesonbuild.com/) build system. + +Cagebreak is developed against the latest tag of wlroots, so as not to constantly +chase breaking changes. -Simply execute the following steps to build Cagebreak: +Execute the following commands to build Cagebreak: ``` -$ meson setup build +$ meson setup build -Dxwayland=true -Dman-pages=true --buildtype=release $ ninja -C build ``` -#### Release Build +### Man Pages + +Remove `-Dman-pages=true` to disable man page generation. + +To generate man pages, make sure that you have [scdoc](https://archlinux.org/packages/extra/x86_64/scdoc/) installed. + +### Release Build -By default, this builds a debug build. To build a release build, use `meson -setup build --buildtype=release`. +To obtain a debug build, remove `--buildtype=release`. -##### Xwayland Support +The release build is reproducible under conditions outlined in [CONTRIBUTING](CONTRIBUTING.md). -Cagebreak comes with compile-time support for XWayland. To enable this, -first make sure that your version of wlroots is compiled with this -option. Then, add `-Dxwayland=true` to the `meson` command above. Note -that you'll need to have the XWayland binary installed on your system -for this to work. +### Xwayland Support -##### Man Pages +To build Cagebreak without XWayland support, remove `-Dxwayland=true`. + +To use XWayland make sure that your version of wlroots is compiled with +XWayland support. + +You'll need to have [XWayland](https://archlinux.org/packages/extra/x86_64/xorg-xwayland/) installed for XWayland support to work. + +## Running Cagebreak + +``` +$ ./build/cagebreak +``` -Cagebreak has man pages. To use them, make sure that you have `scdoc` -installed. Then, add `-Dman-pages=true` to the `meson` command. +If you run Cagebreak within an existing X11 or Wayland session, it will +open in a virtual output as a window in your existing session. -### Running Cagebreak +If you run it in a TTY, it'll run with the KMS+DRM backend. -You can start Cagebreak by running `./build/cagebreak`. If you run it from -within an existing X11 or Wayland session, it will open in a virtual output as -a window in your existing session. If you run it in a TTY, it'll run with the -KMS+DRM backend. Note that a configuration file is required. For more -configuration options, see the man pages. +Note that a configuration file is required. For more configuration options, see the [man pages](manuals.md). -Please see `example_scripts/` for example scripts and a basis to customize -from. +Please see `example_scripts/` for a basis to customize from. -#### Usage Philosophy +### Usage Philosophy -Cagebreak was originally built to suit the needs of its creators. This section outlines +Cagebreak was built to suit the needs of its creators. This outlines how we intended some parts of cagebreak and might ease learning how to use cagebreak a -little bit. Please note that this does not replace the man pages or the FAQ. -Also, this is in no way intended as a guide on how cagebreak must be used but rather -as a source of inspiration and explanations for certain particularities. +little bit. Please note that this does not replace the [man pages](manuals.md) or the [FAQ](FAQ.md). +Also, this is not intended as a guide on how cagebreak must be used but +as a source of inspiration and explanation for certain particularities. 1. Cagebreak is keyboard-based. Everything regarding cagebreak can be done through the keyboard and it is our view that it should be. This does not mean @@ -196,467 +178,6 @@ as a source of inspiration and explanations for certain particularities. > Example scripts can be found in the repository under `example_scripts/`. -## Contributing - - * Read this document. - * [Open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your feature request. - We will get back to you. - * Ask before opening a pull request. We might not accept your - code and it would be sad to waste the effort. - * Respect the [Code of Conduct](CODE_OF_CONDUCT.md) (To date, we never - had to intervene - Please keep it that way!) - -### Good First Contributions - - * Reviews are always welcome. - * Read the code. - * Read the documentation. - * Test whether the documentation matches the code. - * Test Cagebreak in more esoteric setups (many monitors, for instance). - * Compile the code. - * Ideas on improving the testing and quality assurance are particularly - welcome. - * You can share your cagebreak scripts and we might include them with Cagebreak - provided you agree to release them under MIT and we agree with the - use case and coding style. - * If you are happy with Cagebreak under Arch Linux, you may vote for - [Cagebreak in the AUR](https://aur.archlinux.org/packages/cagebreak). - * The points from the Contributing section above still apply. - -### Philosophy - -Cagebreak is currently developed to fit the needs of its creators. - -The feature set is intentionally limited - we removed -support for a desktop background image for example. - -Nonetheless, don't be intimidated by any other part of this file. -Do your best and we will collaborate toward a solution. - -## Development - -### Compatibility & Development Distribution - -Cagebreak supports [Arch Linux](https://archlinux.org/) and uses the libraries -(and software versions) as they are obtained through [pacman](https://wiki.archlinux.org/title/Pacman) -at the time of release. Any other use is out of scope. - -However, Cagebreak may also work on other distributions given the -proper library versions (Some package maintainers have done this and it -seems to work (To date, we dealt with a few Issues and never felt the -need to ask for the distribution the user was having the issue on.)). - -[![Packaging status](https://repology.org/badge/vertical-allrepos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) - -You should use Arch Linux if you want to modify Cagebreak -for yourself. - -### Review Requirements - -Project-repo will review your proposal before your implementation for feasibility -and desirability. After your pull request, the code will be reviewed in conjunction -with all other changes before the release as per the release procedure. - -All reviews performed by project-repo are verified by at least two people internally. - -### Developer Certificate of Origin (DCO) - -On any pull requests please include a - -``` -signed-off-by: YOUR IDENTIFIER OR NAME -``` - -DCO statement. - -By doing this you claim that you are legally allowed to contribute the -code and agree to let project-repo publish it under the MIT License. - -#### Development Environment - -CAVEAT: This script works exclusively on Arch Linux, which, as outlined above, -is the development distribution of Cagebreak. - -Cloning the Cagebreak repository and building it is sufficient as a starting point. - -All other dependencies can be installed by invoking - -``` -meson compile devel-install -C build -``` - -if meson is already available or - -``` -./scripts/install-development-environment -``` - -otherwise. - -#### Scripts - -Cagebreak provides a few convenience tools to facilitate development. - -##### Fuzzing - -If your fuzzing corpus is located in the directory `fuzz_corpus` you can -just call: - -``` -meson compile fuzz -C build -``` - -If you want to use a different directory, configure cagebreak with -`-Dcorpus=OTHERDIRECTORY` or call `./scripts/fuzz OTHERDIRECTORY`. - -##### Adjusting Epoch - -To facilitate the creation of reproducible man pages an arbitrary release -time has to be set in `meson.build`: - -``` -meson compile adjust-epoch -C build -``` - -or - -``` -./scripts/adjust-epoch -``` - -##### Git tag - -If you are on the master branch, everything is ready and you want to create -a release tag you can call: - -``` -meson compile git-tag -C build -``` - -If you want to use another signing key than the prespecified one, configure -Cagebreak with `-Dgpg_id=GPGID`. - -``` -./scripts/git-tag GPGID CBVERSION -``` - -can be used alternatively. - -##### Output Hashes - -Hashes of release versions of all binaries can be output to `local-hashes.txt` -via: - -``` -meson compile output-hashes -C build -``` - -Or - -``` -./scripts/output-hashes VERSION -``` - -if meson is unavailable. - -##### Create Signatures - -Creation of signatures for releases can be achieved through: - -``` -meson compile create-sigs -C build -``` - -Configure Cagebreak with `-Dgpg_id=GPGID` for a different gpg signing -key. - -Without meson use: - -``` -./scripts/create-signatures GPGID -``` - -##### Set Version Number - -Once the version number is set within meson.build, you can use - -``` -meson compile set-ver -C build -``` - -to set the version number in the man pages and README repology minversion. - -Use of the script without meson is discouraged because meson.build is -not touched by the script. - -##### Create Release Artefacts - -The following command generates the release artefacts which must be created -once a release is completely ready to be published (the commit is tagged with -the version of the master branch, etc.): - -``` -meson compile create-artefacts -C build -``` - -Use of the script version is discouraged. - -### GCC and -fanalyzer - -Cagebreak should compile with any reasonably new gcc or clang. Consider -a gcc version of at least [10.1](https://gcc.gnu.org/gcc-10/changes.html) if -you want to get the benefit of the brand-new -[-fanalyzer](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) -flag. However, this new flag sometimes produces false-postives and we -selectively disable warnings for affected code segments as described below. - -Meson is configured to set `CG_HAS_FANALYZE` if `-fanalyzer` is available. -Therefore, to maintain portability, false-positive fanalyzer warnings are to be -disabled using the following syntax: - -``` -#if CG_HAS_FANALYZE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "WARNING OPTION" -#endif -``` -and after - -``` -#if CG_HAS_FANALYZE -#pragma GCC diagnostic pop -#endif -``` - -### Test Suite - -``` -meson test -C build -``` - -invokes all tests. This is required for a release to occur. - -There are four test suites: - - * basic: tests actual outward-facing functionality - * Note optional dependencies for efficient socket interaction - * nc (openbsd-netcat) - * jq - * devel: tests internal properties of the repository - * Note potentially heavier dependencies such as - * shellcheck - * clang-format - * devel-long: applies more costly testing - * Note potentially heavier dependencies such as - * scan-build (static analysis (including security-relevant issues)) - * release: tests release specific considerations - * Note that this is only expected to pass just before - a release. This checks mostly administrative things - to check that a release is ready. - * Note that non-auto tests are files in `release-non-auto-checks` - and have to contain the release version and current date in - YYYY-mm-dd format on seperate lines. This is our imperfect attempt - to guarantee some hard-to-automate checks are carried out before - a release is undertaken. - -Every commit should pass at least the basic and devel suites. - -It is expected that cagebreak passes at least the -basic, devel and devel-long suites when commits are pushed: - -``` -meson test -C build --suite basic --suite devel -``` - -The basic suite can be used to test a binary. This is -useful for PKGBUILDs and their equivalents in other -systems. - -``` -meson test -C build --suite basic -``` - -### Fuzzing - -Along with the project source code, a fuzzing framework based on `libfuzzer` is -supplied. This allows for the testing of the parsing code responsible for reading -the `cagebreak` configuration file. When `libfuzzer` is available (please -use the `clang` compiler to enable it), building the fuzz-testing software can -be enabled by passing `-Dfuzz=true` to meson. This generates a `build/fuzz/fuzz-parse` -binary according to the `libfuzzer` specifications. Further documentation on -how to run this binary can be found [here](https://llvm.org/docs/LibFuzzer.html). - -Here is an example workflow: - -``` -rm -rf build -CC=clang meson setup build -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef=false -ninja -C build/ -mkdir build/fuzz_corpus -cp examples/config build/fuzz_corpus/ -WLR_BACKENDS=headless ./build/fuzz-parse -jobs=12 -max_len=50000 -close_fd_mask=3 build/fuzz_corpus/ -``` - -You may want to tweak `-jobs` or add other options depending on your own setup. -We have found code path discovery to increase rapidly when the fuzzer is supplied -with an initial config file. We are working on improving our fuzzing coverage to -find bugs in other areas of the code. - -#### Caveat - -Currently, there are memory leaks which do not seem to stem from our code but rather -the code of wlroots or some other library we depend on. We are working on the problem. -In the meantime, add `-Db_detect-leaks=0` to the meson command to exclude memory leaks. - -### Reproducible Builds - -Cagebreak offers reproducible builds given the exact library versions specified -in `meson.build`. Should a version mismatch occur, a warning will be emitted. We have -decided on this compromise to allow flexibility and security. In general we will -adapt the versions to the packages available under Arch Linux at the time of -release. - -There are reproducibility issues up to and including release `1.2.0`. See -`Issue 5` in [Bugs.md](Bugs.md). - -#### Reproducible Build Instructions - -All hashes and signatures are provided for the following build instructions. - -``` -meson setup build -Dxwayland=true -Dman-pages=true --buildtype=release -ninja -C build -``` - -#### Hashes for Builds - -For every release after 1.0.5, hashes will be provided. - -For every release after 1.7.0, hashes will be provided for man pages too. - -See [Hashes.md](Hashes.md) - -#### GPG Signatures - -For every release after 1.0.5, a GPG signature will be provided in `signatures`. - -The current signature is called `cagebreak.sig`, whereas all older signatures -will be named after their release version. - -Due to errors in the release process, the releases 1.7.1 and 1.7.2 did not include the release -signatures in the appropriate folder of the git repository. However, signatures were provided -as release-artefacts at the time of release. The signatures were introduced into the -repository with 1.7.3. The integrity of cagebreak is still the same because the signatures were -provided as release-artefacts (which were themselves signed) and the hashes in Hashes.md -are part of a signed release tag. - -#### Signing Keys - -All releases are signed by at least one of the following collection of -keys. - - * E79F6D9E113529F4B1FFE4D5C4F974D70CEC2C5B - * 4739D329C9187A1C2795C20A02ABFDEC3A40545F - * 7535AB89220A5C15A728B75F74104CC7DCA5D7A8 - * 827BC2320D535AEAD0540E6E2E66F65D99761A6F - * A88D7431E5BAAD0B6EAE550AC8D61D8BD4FA3C46 - * 8F872885968EB8C589A32E9539ACC012896D450F - * 896B92AF738C974E0065BF42F2576BD366156BB9 - * AA927AFD50AF7C6810E69FE8274F2C605359E31B - * BE2DED372287BC4EB2213E13A0C743848A638955 - * 0F3476E4B2404F95EC41600683D5810F7911B020 - * 4E82C72C6B3E58A7BC4FF8554909F84CA83BB867 - * 5AEB1A2EB0D13F67E306AC59DC0CC81BE006FD85 - -Should we at any point retire a key, we will only replace it with keys signed -by at least one of the above collection. - -We registered project-repo.co and added mail addresses after release `1.3.0`. - -We now have a mail address and its key is signed by signing keys. See [SECURITY.md](SECURITY.md) -for details. - -The full public keys can be found in `keys/` along with any revocation certificates. - -### Versioning & Branching Strategy - -Cagebreak uses [semantic versioning](https://semver.org). - -There are three permanent branches in cagebreak: - - * `master` (for releases) - * `development` (for polishing code between releases) - * `hotfix` (for small emergent releases, usually up-to-date with master) - -Releases are merged to master as per the release procedure, with -reasonable exceptions as the situation requires. - -The release commit is tagged with the release version. - -In the past, our git history did not perfectly reflect this scheme. - -### Release Procedure - -The release procedure outlines the process for a release to occur. - - * [ ] `git checkout development` - * [ ] `git pull origin development` - * [ ] `git push origin development` - * [ ] Arch Build System is up to date - * [ ] `meson test -C build/` just to get an overview - * [ ] Update internal wiki - * [ ] Adjust version number in meson.build - * [ ] `meson compile set-ver -C build` - * [ ] Add new files to meson.build or hardcoded testing variable - * [ ] Commit changes - * [ ] `git push origin development` - * [ ] Complete relevant documentation - * [ ] New features - * [ ] tests added and old test scripts adjusted - * [ ] man pages - * [ ] cagebreak - * [ ] cagebreak-config - * [ ] cagebreak-socket - * [ ] example config - * [ ] FAQ.md - * [ ] Changelog.md for major and minor releases but not patches - * [ ] Check changes for SECURITY.md relevance (changes to socket scope for example) - * [ ] Synchronize any socket changes to cagebreak-socket man page - * [ ] Document fixed bugs in Bugs.md - * [ ] Include issue discussion from github, where applicable - * [ ] `meson compile adjust-epoch -C build` - * [ ] Commit changes - * [ ] `git push origin development` - * [ ] Testing - * [ ] Manual testing - * [ ] `meson compile fuzz -C build` for at least one hour - * [ ] Adjust Hashes.md - Use `meson compile output-hashes -C build` to add Hashes or aid in repro check - * [ ] Commit changes - * [ ] `git push origin development` - * [ ] Complete release-non-auto-checks - * [ ] `meson compile create-sigs -C build` - * [ ] Commit and push signatures, hashes and non-auto-check files - * [ ] `meson test -C build` passes everything except some release tests - * [ ] `git add` relevant files - * [ ] `git commit` - * [ ] `git push origin development` - * [ ] `git checkout master` - * [ ] `git merge --squash development` - * [ ] `git commit` and insert message - * [ ] `meson compile git-tag -C build` - * [ ] `meson compile create-artefacts -C build` - * [ ] `meson test -C build` THIS MUST PASS WITHOUT ANY FAILURES WHATSOEVER - * [ ] `git push --tags origin master` - * [ ] `git checkout development` (merge to development depends on whether release was a hotfix) - * [ ] `git merge master` - * [ ] `git push --tags origin development` - * [ ] `git checkout hotfix` (hotfix is to be kept current with master after releases) - * [ ] `git merge master` - * [ ] `git push --tags origin hotfix` - * [ ] Upload archives and signatures as release assets - * [ ] Delete feature branches if appropriate - * [ ] Manage package release - ## Roadmap Cagebreak plans to do or keep doing the following things @@ -664,20 +185,24 @@ in the future: * React to all issues. * Add or modify features, which the authors find convenient or important. - * Improve the [OpenSSF Best Practices Badge Program](https://bestpractices.coreinfrastructure.org/en) level + * Improve the [OpenSSF Best Practices Badge Program](https://bestpractices.coreinfrastructure.org/en) level. ## Governance Cagebreak is managed by project-repo. +Consider project-repo a single benevolent dictator for life that happens +to occupy at least two brains. + Project-repo is a pseudonym of at least two individuals acting as benevolent dictators for the project by the others mutual consent. The individuals comprising project-repo are not otherwise associated by payment from any organisation or grant. -For all intents and purposes consider project-repo as a single -benevolent dictator for life that happens to occupy at least two brains. +### Governance Issues + +Use [SECURITY.md](SECURITY.md) to contact project-repo. ### Roles @@ -687,37 +212,20 @@ There are no specific roles forced unto anyone. ### Bus Factor +The current bus factor for Cagebreak is: 1 + The Bus Factor is a measure of how many people have to be incapacitated for a project to be unable to continue. -The current bus factor for Cagebreak is: 1 - -Project-repo could still react to issues (even confidential +Project-repo could react to issues (even confidential e-mails) and fix easier issues if any one individual were incapacitated. However, not all aspects of the code or release engineering are fully resilient to the loss of any one individual. -We strive to improve the Bus Factor to at least two in all -aspects of Cagebreak. - -### Governance Issues - -Anyone can use the information in [SECURITY.md](SECURITY.md) to -contact the members of project-repo and bring governance -issues to their attention. - -## Bugs - -For any bug, please [create an issue](https://github.com/project-repo/cagebreak/issues/new) on -[GitHub](https://github.com/project-repo/cagebreak). - -Fixed bugs are to be assigned a number and summarized inside Bugs.md for future reference -independent of github, in case this service is unavailable. - -For other means of contacting the Cagebreak authors and for security issues -see [SECURITY.md](SECURITY.md). +We strive to increase the bus factor to at least 2 in all +aspects. ## Accessibility @@ -730,6 +238,14 @@ see [SECURITY.md](SECURITY.md). would work and cagebreak does not preclude the use of a screen reader for any software run with it. +## Bugs + +[Open an issue](https://github.com/project-repo/cagebreak/issues/new) is you find something. + +See [SECURITY.md](SECURITY.md) for other means of contacting the Cagebreak authors and security issues. + +Fixed bugs are assigned a number and summarized in [Bugs.md](Bugs.md) for future reference. + ## Contributors * Aisha Tammy @@ -742,10 +258,14 @@ see [SECURITY.md](SECURITY.md). released in 2.2.1 with slight modifications * Tom Greig * Fix bug in merge_output_configs in 2.1.2 + * sodface + * Add a screenshot example script in 2.3.0 + * Luca Kennedy (unsigned-enby) + * [Add option to configure the anchor position of messages](https://github.com/project-repo/cagebreak/pull/61) in 2.3.0 ## License -Copyright (c) 2020-2023 The Cagebreak authors +Copyright (c) 2020-2024 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes Copyright (c) 2019 The Sway authors diff --git a/SECURITY.md b/SECURITY.md index a55a2b4..110d48d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,35 +1,14 @@ # Security -The main possibility for security bugs in cagebreak is by privilege -escalation through the socket. Any program with access to the socket -immediately gains arbitrary code execution rights. The socket -is restricted to the user of the cagebreak process (700) and has to -be explicitely enabled using the `-e` flag on invocation. - -If you disagree with this threat model, you may contact us via email (See -section Email Contact below.) or [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). - -Should any problem with the github issue system arise or any other reason -for (potentially confidential) contact with the Cagebreak authors appear, -you may contact us via email (See section Email Contact below.). - -## Supported Versions - -The most recent release always contains the latest bug fixes and features. -There are no official backports for security vulnerabilities. -Builds are reproducible under conditions outlined in [README.md](README.md). - -## Bug Reports - -For normal bugs you may [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). - -For everything else, an email contact (with gpg encryption and signature) -is available below. +The main possibility for security bugs in cagebreak is privilege +escalation via the socket. Any program with access to the socket +immediately gains arbitrary code execution rights. The socket has to +be explicitely enabled using the `-e` flag on invocation and +is restricted to the user of the cagebreak process (700). ## Email Contact -If you want to get in touch with the developers of cagebreak to report -a security vulnerability or anything else via email, contact +If you want to get in touch with project-repo via email, contact `cagebreak @ project-repo . co`. We try to respond to everything that is not obvious spam. @@ -39,16 +18,30 @@ We try to respond to everything that is not obvious spam. If you can, please encrypt your email with the appropriate GPG key found in `keys/` and sign your message with your own key. -* B15B92642760E11FE002DE168708D42451A94AB5 -* F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C -* 3ACEA46CCECD59E4C8222F791CBEB493681E8693 -* 0A268C188D7949FEB39FD1462F2AD980247E4918 +* B15B92642760E11FE002DE168708D42451A94AB5 (expired) +* F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C (expired) +* 3ACEA46CCECD59E4C8222F791CBEB493681E8693 (expired) +* 0A268C188D7949FEB39FD1462F2AD980247E4918 (soon to expire) +* [283D10F54201B0C6CCEE2C561DE04E4B056C749D](keys/cagebreak@project-repo.co.pub) Note that our keys are signed by cagebreak signing keys. If you want us to respond via GPG-encrypted email, please include your own public key or provide the fingerprint and directions to obtain the key. +## Supported Versions + +The most recent release always contains the latest bug fixes and features. +There are no official backports for security vulnerabilities. +Builds are reproducible under conditions outlined in [README.md](README.md). + +## Bug Reports + +For normal bugs you may [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). + +For everything else, an email contact (with gpg encryption and signature) +is available above. + ## Threat Model Cagebreak is a wayland compositor run by a user and has access to @@ -57,7 +50,7 @@ Cagebreak cannot restrict other programs (consider a web browser unable to write a downloaded file for instance). There is no transmission of information by cagebreak other than to the -screens, ipc and potentially other documented local channels. +screens, ipc (if enabled with `-e`) and potentially other documented local channels. ### STRIDE Threat List @@ -76,7 +69,7 @@ Not applicable - Cagebreak allows system manipulation for user software. Not applicable - There are no prohibited operations (See Tampering above.). Cagebreak sends events over documented channels. There is no logging -activated by default - this can be changed by logging the socket (if enabled) for example. +activated by default - this can be changed by logging the socket for example. #### Information Disclosure @@ -86,12 +79,12 @@ Any user software may exfiltrate any data the user has access to. #### Denial of Service Not applicable - Cagebreak offers functionality to terminate itself. This is -available to user software over the socket (if enabled). +available to user software over the socket. #### Elevation of Privilege Software may gain arbitrary code execution if it has access to the -socket (if enabled). Privilege escalation to root is unlikely since privileges +socket. Privilege escalation to root is unlikely since privileges are dropped before any user input is accepted. ## GPG Keys of the Cagebreak Repository diff --git a/cagebreak.c b/cagebreak.c index 66afdf3..9ce99b8 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _DEFAULT_SOURCE @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -279,7 +280,6 @@ main(int argc, char *argv[]) { struct wlr_viewporter *viewporter = NULL; struct wlr_presentation *presentation = NULL; struct wlr_xdg_output_manager_v1 *output_manager = NULL; - struct wlr_gamma_control_manager_v1 *gamma_control_manager = NULL; struct wlr_xdg_shell *xdg_shell = NULL; wl_list_init(&server.input_config); wl_list_init(&server.output_config); @@ -356,6 +356,7 @@ main(int argc, char *argv[]) { server.message_config.display_time = 2; server.message_config.font = strdup("pango:Monospace 10"); + server.message_config.anchor = CG_MESSAGE_TOP_RIGHT; event_loop = wl_display_get_event_loop(server.wl_display); sigint_source = @@ -369,6 +370,7 @@ main(int argc, char *argv[]) { server.event_loop = event_loop; backend = wlr_backend_autocreate(server.wl_display, &server.session); + server.headless_backend = wlr_headless_backend_create(server.wl_display); if(!backend) { wlr_log(WLR_ERROR, "Unable to create the wlroots backend"); ret = 1; @@ -563,13 +565,17 @@ main(int argc, char *argv[]) { goto end; } - gamma_control_manager = + server.gamma_control = wlr_gamma_control_manager_v1_create(server.wl_display); - if(!gamma_control_manager) { + if(!server.gamma_control) { wlr_log(WLR_ERROR, "Unable to create the gamma control manager"); ret = 1; goto end; } + server.gamma_control_set_gamma.notify = + handle_output_gamma_control_set_gamma; + wl_signal_add(&server.gamma_control->events.set_gamma, + &server.gamma_control_set_gamma); #if CG_HAS_XWAYLAND server.xwayland = wlr_xwayland_create(server.wl_display, compositor, true); @@ -671,6 +677,8 @@ main(int argc, char *argv[]) { wl_list_init(&server.outputs); struct cg_output *output, *output_tmp; wl_list_for_each_safe(output, output_tmp, &tmp_list, link) { + wl_list_remove(&output->link); + output_insert(&server, output); output_configure(&server, output); } server.curr_output = @@ -692,10 +700,6 @@ main(int argc, char *argv[]) { end: if(server.modes != NULL) { -#if CG_HAS_FANALYZE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wanalyzer-double-free" -#endif for(unsigned int i = 0; server.modes[i] != NULL; ++i) { free(server.modes[i]); } @@ -761,6 +765,3 @@ main(int argc, char *argv[]) { return ret; } -#if CG_HAS_FANALYZE -#pragma GCC diagnostic pop -#endif diff --git a/docs/dev-FAQ.md b/docs/dev-FAQ.md new file mode 100644 index 0000000..46c7669 --- /dev/null +++ b/docs/dev-FAQ.md @@ -0,0 +1,67 @@ +# FAQ for Development + +## How is cagebreak adjusted to a new wlroots version? + +There are three steps: + +1. Try to compile Cagebreak with the new wlroots. +2. Fix the compiler errors one-by-one using the wlroots + changelog for reference (https://gitlab.freedesktop.org/wlroots/wlroots/-/releases). +3. Debug until Cagebreak works again. + +## How do I add a new test? + +1. Add a shell script to `test/` +2. Optionally add test configs to `test/testing-configurations/` +3. Make sure the files have shebang, copyright and SPDX License identifiers + (use the other files for reference) +4. Add the test to `meson.build` as in the example below. +5. Add paths and env vars as shown in the other tests +6. Make sure the test is added to the correct suite + (check out CONTRIBUTING.md for details) + +``` +test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel-long') +``` + +## How do I add a new script? + +1. Add a shell script to `scripts/` +2. Make sure the files have shebang, copyright and SPDX License identifiers + (use the other files for reference) +3. Add the script to CONTRIBUTING.md +4. Add the script to meson.build as shown below + +``` +run_target('create-sigs', + command : ['scripts/create-signatures', get_option('gpg_id')]) +``` + +## How do I add an example script? + +Extrapolate from the examples in the `example_scripts` directory. + +The script should be executable standalone. See `test/script-header` for a possible +library. + +License, contributors etc. should be appropriate. + +Shellcheck must pass on any script (use of shellcheck pragmas is allowed but +discouraged). + +## How do I add a new gpg key? + +1. Check which gpg key versions are currently valid. +2. Generate keys with incremented numbers/emails/dates/passphrase. + * Use 4096 Bit RSA Keys +3. Sign the new keys with at least one then-old signing key. +4. Genereate new cagebreak@project-repo.co key +5. Sign the new mail key with the new signing keys. +6. Generate new pkgbuild key. +7. Sign the pkgbuild key with the new signing keys. +8. Add public keys to `keys/`. +9. Update meson_options.txt +10. Update [all man pages](../manuals.md), [CONTRIBUTING](../CONTRIBUTING.md), gpg-validity test & [SECURITY.md](../SECURITY.md) +11. Update the pkgbuild repo with the new key (key and readme). +12. Update git config email. +13. Securely distribute private keys and revocation certificates as per the internal wiki. diff --git a/docs/pull_request_template.md b/docs/pull_request_template.md new file mode 100644 index 0000000..589cd0c --- /dev/null +++ b/docs/pull_request_template.md @@ -0,0 +1,26 @@ +# Description + + + + +## Type of Change + + * [ ] Fix + * [ ] Backwards-compatible Feature + * [ ] Breaking Change + +## Considerations + + + + +## Credit + + * [ ] I want to be credited as YOUR_NAME_OR_PSEUDONYM in your contributor section + * [ ] I don't want to be credited. + + + + +signed-off-by: YOUR_NAME_OR_PSEUDONYM + diff --git a/example_scripts/screenshot_script b/example_scripts/screenshot_script new file mode 100755 index 0000000..59cf524 --- /dev/null +++ b/example_scripts/screenshot_script @@ -0,0 +1,44 @@ +#!/bin/bash +# Copyright 2023 - 2024, project-repo, sodface and the cagebreak contributors +# SPDX-License-Identifier: MIT +# +# Execute this script if you want to take a screenshot. +# Please supply your chosen cropping/editing tool as a +# command-line argument. The filepath to the temporary +# file will be given as an argument to your command. +# +# Example: +# screenshot_script "gwenview" + +named_pipe_send="$(mktemp -u)" +named_pipe_recv="$(mktemp -u)" +mkfifo "${named_pipe_send}" +mkfifo "${named_pipe_recv}" +nc -U "${CAGEBREAK_SOCKET}" < "${named_pipe_send}" > "${named_pipe_recv}"& +# The file descriptor 3 is set up to send commands to cagebreak and file +# descriptor 4 can be used to read events. Notice that events will pile up in +# file descriptor 4, so it is a good idea to continuously read from it or to +# clear it before starting a new transaction. +exec 3>"${named_pipe_send}" +exec 4<"${named_pipe_recv}" +# When the script exits, the os will clean up the pipe +rm "${named_pipe_recv}" +rm "${named_pipe_send}" + +if [[ ${#} -lt 1 ]] +then + echo "Expected a single command line argument specifying the command to edit the screenshot." + exit 1 +fi + +edit_cmd="${1}" + +echo "dump" >&3 +IFS= read -r -d $'\0' event <&4 + +co="$(echo "${event:6}"|jq -r ".curr_output")" +tmpfile="$(mktemp)" +grim -t png -o "${co}" "${tmpfile}" +bash -c "${edit_cmd} \"${tmpfile}\"" +wl-copy < "${tmpfile}" +rm "${tmpfile}" diff --git a/example_scripts/show_workspace_views.sh b/example_scripts/show_workspace_views old mode 100644 new mode 100755 similarity index 54% rename from example_scripts/show_workspace_views.sh rename to example_scripts/show_workspace_views index be6f0f9..33d76bc --- a/example_scripts/show_workspace_views.sh +++ b/example_scripts/show_workspace_views @@ -1,11 +1,23 @@ #!/bin/bash -# Copyright 2020 - 2023, project-repo and the cagebreak contributors +# Copyright 2020 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT - +# # This script displays the process names of the views on the current workspace. -# Start up the ipc link -source "$(dirname "${BASH_SOURCE[0]}")/cb_script_header.sh" +named_pipe_send="$(mktemp -u)" +named_pipe_recv="$(mktemp -u)" +mkfifo "${named_pipe_send}" +mkfifo "${named_pipe_recv}" +nc -U "${CAGEBREAK_SOCKET}" < "${named_pipe_send}" > "${named_pipe_recv}"& +# The file descriptor 3 is set up to send commands to cagebreak and file +# descriptor 4 can be used to read events. Notice that events will pile up in +# file descriptor 4, so it is a good idea to continuously read from it or to +# clear it before starting a new transaction. +exec 3>"${named_pipe_send}" +exec 4<"${named_pipe_recv}" +# When the script exits, the os will clean up the pipe +rm "${named_pipe_recv}" +rm "${named_pipe_send}" echo "dump" >&3 diff --git a/examples/config b/examples/config index 6708e42..b0883cb 100644 --- a/examples/config +++ b/examples/config @@ -1,8 +1,7 @@ -# Copyright 2020 - 2023, project-repo and the cagebreak contributors +# Copyright 2020 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT -###################### -# General settings an key bindings -###################### + +# General settings and key bindings exec xterm @@ -36,19 +35,21 @@ bind k focusup bind l focusright bind t exec xterm bind C-k close -#bind m message Hello World! +# bind m message Hello World! definekey resize h resizeleft definekey resize l resizeright definekey resize j resizedown definekey resize k resizeup definekey resize Escape setmode top -#unhide cursor (default) +# unhide cursor (default) cursor enable -###################### -#Workspaces -###################### +# send a custom event over the socket +# custom_event Hello World! + +## Workspaces + bind 1 screen 1 bind 2 screen 2 bind 3 screen 3 @@ -84,28 +85,33 @@ definekey top XF86_Switch_VT_4 switchvt 4 definekey top XF86_Switch_VT_5 switchvt 5 definekey top XF86_Switch_VT_6 switchvt 6 -###################### -#Bind Function keys -###################### +## Bind Function keys + definekey top XF86AudioMute exec pactl set-sink-mute 0 toggle definekey top XF86AudioLowerVolume exec pactl set-sink-mute 0 off&&amixer set Master 1%- definekey top XF86AudioRaiseVolume exec pactl set-sink-mute 0 off&&amixer set Master 1%+ definekey top XF86MonBrightnessDown exec xbacklight -dec 1 definekey top XF86MonBrightnessUp exec xbacklight -inc 1 -###################### -#Output configuration -###################### -#output eDP-1 pos 0 0 res 1366x768 rate 60 -#output eDP-1 disable -#output eDP-1 enable -#output eDP-1 prio 1 -#output eDP-2 pos 0 0 res 1366x768 rate 60 scale 2.0 - -##################### -#Input configuration -##################### - -#input 1234:0:Device_Ident click_method clickfinger -#input type:pointer scroll_method two_finger -#input * calibration_matrix 1 2 3 4 5 6 +## Output configuration + +# output eDP-1 pos 0 0 res 1366x768 rate 60 +output eDP-1 disable +output eDP-1 enable +output eDP-1 permanent + +output eDP-1 peripheral +# output eDP-1 prio 1 +# output eDP-2 pos 0 0 res 1366x768 rate 60 scale 2.0 + + +## Input configuration + +# input 1234:0:Device_Ident click_method clickfinger +# input type:pointer scroll_method two_finger +# input * calibration_matrix 1 2 3 4 5 6 + +## Message configuration + +# configure_message display_time 1 +# configure_message anchor top_center diff --git a/fuzz/execl_override.c b/fuzz/execl_override.c index 275d4f0..0f9a19f 100644 --- a/fuzz/execl_override.c +++ b/fuzz/execl_override.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT // This file is used by the fuzzer in order to prevent executing shell commands. diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index 650d8a8..2d46e50 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200812L @@ -273,7 +273,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { server.scene_output_layout = wlr_scene_attach_output_layout(server.scene, server.output_layout); - compositor = wlr_compositor_create(server.wl_display, 5, server.renderer); + compositor = wlr_compositor_create(server.wl_display, 6, server.renderer); if(!compositor) { wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); ret = 1; diff --git a/fuzz/fuzz-lib.h b/fuzz/fuzz-lib.h index 46aefd2..2715978 100644 --- a/fuzz/fuzz-lib.h +++ b/fuzz/fuzz-lib.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_FUZZ_LIB_H diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index d0bd5ab..9c35010 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200812L diff --git a/idle_inhibit_v1.c b/idle_inhibit_v1.c index 019d47b..bc76ff7 100644 --- a/idle_inhibit_v1.c +++ b/idle_inhibit_v1.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #include @@ -15,10 +15,6 @@ struct cg_idle_inhibitor_v1 { struct wl_listener destroy; }; -#if CG_HAS_FANALYZE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" -#endif static void idle_inhibit_v1_check_active(struct cg_server *server) { /* As of right now, this does not check whether the inhibitor @@ -26,9 +22,6 @@ idle_inhibit_v1_check_active(struct cg_server *server) { bool inhibited = !wl_list_empty(&server->inhibitors); wlr_idle_notifier_v1_set_inhibited(server->idle, inhibited); } -#if CG_HAS_FANALYZE -#pragma GCC diagnostic pop -#endif static void handle_destroy(struct wl_listener *listener, void *data) { diff --git a/idle_inhibit_v1.h b/idle_inhibit_v1.h index 74ae956..dc712bf 100644 --- a/idle_inhibit_v1.h +++ b/idle_inhibit_v1.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_IDLE_INHIBIT_H #define CG_IDLE_INHIBIT_H diff --git a/img/archwiki.svg b/img/archwiki.svg new file mode 100644 index 0000000..635b400 --- /dev/null +++ b/img/archwiki.svg @@ -0,0 +1 @@ + : Wiki \ No newline at end of file diff --git a/img/aur.svg b/img/aur.svg new file mode 100644 index 0000000..c8af6f3 --- /dev/null +++ b/img/aur.svg @@ -0,0 +1 @@ + : AUR \ No newline at end of file diff --git a/img/contributing.svg b/img/contributing.svg new file mode 100644 index 0000000..6d58a85 --- /dev/null +++ b/img/contributing.svg @@ -0,0 +1 @@ + : Contrib \ No newline at end of file diff --git a/img/faq.svg b/img/faq.svg new file mode 100644 index 0000000..41bfdfe --- /dev/null +++ b/img/faq.svg @@ -0,0 +1 @@ + : FAQ \ No newline at end of file diff --git a/img/mail.svg b/img/mail.svg new file mode 100644 index 0000000..78cfd12 --- /dev/null +++ b/img/mail.svg @@ -0,0 +1 @@ + : Mail \ No newline at end of file diff --git a/img/manuals.svg b/img/manuals.svg new file mode 100644 index 0000000..8aebe59 --- /dev/null +++ b/img/manuals.svg @@ -0,0 +1 @@ + : Manuals \ No newline at end of file diff --git a/img/web-artefacts.svg b/img/web-artefacts.svg new file mode 100644 index 0000000..00072e8 --- /dev/null +++ b/img/web-artefacts.svg @@ -0,0 +1 @@ + : Mirror \ No newline at end of file diff --git a/img/web-open-issue.svg b/img/web-open-issue.svg new file mode 100644 index 0000000..8c2de01 --- /dev/null +++ b/img/web-open-issue.svg @@ -0,0 +1 @@ + : + Issue \ No newline at end of file diff --git a/input.h b/input.h index f45e735..358c385 100644 --- a/input.h +++ b/input.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef _CG_INPUT_H diff --git a/input_manager.c b/input_manager.c index fcdd684..47ce206 100644 --- a/input_manager.c +++ b/input_manager.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200812L diff --git a/input_manager.h b/input_manager.h index b3eb006..eb6f019 100644 --- a/input_manager.h +++ b/input_manager.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_INPUT_MANAGER_H diff --git a/ipc_server.c b/ipc_server.c index 05614b3..37e59ad 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _DEFAULT_SOURCE diff --git a/ipc_server.h b/ipc_server.h index 41d7b88..a8ae3ef 100644 --- a/ipc_server.h +++ b/ipc_server.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_IPC_SERVER_H diff --git a/keybinding.c b/keybinding.c index 6da0cc6..2432e59 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L @@ -90,6 +90,7 @@ keybinding_free(struct keybinding *keybinding, bool recursive) { if(keybinding->data.m_cfg->font != NULL) { free(keybinding->data.m_cfg->font); } + free(keybinding->data.m_cfg); break; case KEYBINDING_DISPLAY_MESSAGE: if(keybinding->data.c != NULL) { @@ -248,8 +249,7 @@ swap_tile(struct cg_tile *tile, "{\"event_name\":\"swap_tile\",\"tile_id\":%d,\"swap_" "tile_id\":%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", tile->id, swap_tile->id, tile->workspace->num + 1, - tile->workspace->output->wlr_output->name, - output_get_num(tile->workspace->output)); + tile->workspace->output->name, output_get_num(tile->workspace->output)); } void @@ -399,8 +399,7 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", tile->id, old_x, old_y, old_height, old_width, tile->tile.x, tile->tile.y, tile->tile.height, tile->tile.width, - tile->workspace->num + 1, - tile->workspace->output->wlr_output->name, + tile->workspace->num + 1, tile->workspace->output->name, output_get_num(tile->workspace->output)); } @@ -455,18 +454,18 @@ resize_vertical(struct cg_tile *tile, struct cg_tile *parent, int y_offset, void resize_tile(struct cg_server *server, int hpixs, int vpixs) { struct cg_output *output = server->curr_output; - struct wlr_box output_box; - wlr_output_layout_get_box(output->server->output_layout, output->wlr_output, - &output_box); struct cg_tile *focused = output->workspaces[output->curr_workspace]->focused_tile; /* First do the horizontal adjustment */ - if(hpixs != 0 && focused->tile.width < output_box.width && - is_between_strict(0, output_box.width, focused->tile.width + hpixs)) { + if(hpixs != 0 && + focused->tile.width < output_get_layout_box(output).width && + is_between_strict(0, output_get_layout_box(output).width, + focused->tile.width + hpixs)) { int x_offset = 0; /* In case we are on the total right, move the left edge of the tile */ - if(focused->tile.x + focused->tile.width == output_box.width) { + if(focused->tile.x + focused->tile.width == + output_get_layout_box(output).width) { x_offset = -hpixs; } bool resize_allowed = @@ -476,10 +475,13 @@ resize_tile(struct cg_server *server, int hpixs, int vpixs) { } } /* Repeat for vertical */ - if(vpixs != 0 && focused->tile.height < output_box.height && - is_between_strict(0, output_box.height, focused->tile.height + vpixs)) { + if(vpixs != 0 && + focused->tile.height < output_get_layout_box(output).height && + is_between_strict(0, output_get_layout_box(output).height, + focused->tile.height + vpixs)) { int y_offset = 0; - if(focused->tile.y + focused->tile.height == output_box.height) { + if(focused->tile.y + focused->tile.height == + output_get_layout_box(output).height) { y_offset = -vpixs; } bool resize_allowed = @@ -500,7 +502,7 @@ keybinding_workspace_fullscreen(struct cg_server *server) { "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", output->workspaces[output->curr_workspace]->focused_tile->id, output->workspaces[output->curr_workspace]->num + 1, - output->wlr_output->name, output_get_num(output)); + output->name, output_get_num(output)); } // Switch to a differerent virtual terminal @@ -593,8 +595,8 @@ keybinding_split_output(struct cg_output *output, bool vertical) { "{\"event_name\":\"split\",\"tile_id\":%d,\"new_tile_id\":%d," "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d,\"vertical\":%d}", curr_workspace->focused_tile->id, new_tile->id, curr_workspace->num + 1, - curr_workspace->output->wlr_output->name, - output_get_num(curr_workspace->output), vertical); + curr_workspace->output->name, output_get_num(curr_workspace->output), + vertical); } static void @@ -612,8 +614,7 @@ keybinding_close_view(struct cg_view *view) { outp->server, "{\"event_name\":\"close\",\"view_id\":%d,\"view_pid\":%d,\"tile_id\":" "%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", - view_id, view_pid, tile_id, ws + 1, outp->wlr_output->name, - output_get_num(outp)); + view_id, view_pid, tile_id, ws + 1, outp->name, output_get_num(outp)); } static void @@ -628,7 +629,7 @@ keybinding_split_horizontal(struct cg_server *server) { static void into_process(const char *command) { - execl("/bin/sh", "sh", "-c", command, (char *)NULL); + execlp("sh", "sh", "-c", command, (char *)NULL); _exit(1); } @@ -668,8 +669,8 @@ keybinding_cycle_outputs(struct cg_server *server, bool reverse, "{\"event_name\":\"cycle_outputs\",\"old_output\":\"%s\",\"old_" "output_id\":%d," "\"new_output\":\"%s\",\"new_output_id\":%d,\"reverse\":%d}", - old_output->wlr_output->name, output_get_num(old_output), - output->wlr_output->name, output_get_num(output), reverse); + old_output->name, output_get_num(old_output), output->name, + output_get_num(output), reverse); } } @@ -719,7 +720,7 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { curr_id, curr_pid, next_view == NULL ? -1 : (int)next_view->id, next_view == NULL ? -1 : (int)next_view->impl->get_pid(next_view), next_view->tile->id, curr_workspace->num + 1, - curr_workspace->output->wlr_output->name, + curr_workspace->output->name, output_get_num(curr_workspace->output)); } } @@ -742,7 +743,7 @@ keybinding_focus_tile(struct cg_server *server, uint32_t tile_id) { "{\"event_name\":\"focus_tile\",\"old_tile_id\":%d,\"new_tile_" "id\":%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", old_tile->id, workspace->focused_tile->id, workspace->num + 1, - output->wlr_output->name, output_get_num(output)); + output->name, output_get_num(output)); break; } } @@ -776,8 +777,7 @@ keybinding_switch_ws(struct cg_server *server, uint32_t ws) { ipc_send_event(output->server, "{\"event_name\":\"switch_ws\",\"old_workspace\":%d," "\"new_workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", - old_ws + 1, ws + 1, output->wlr_output->name, - output_get_num(output)); + old_ws + 1, ws + 1, output->name, output_get_num(output)); return 0; } @@ -834,6 +834,50 @@ print_str(struct dyn_str *outp, const char *fmt, ...) { return 0; } +char * +print_message_conf(struct cg_message_config *config) { + struct dyn_str outp_str; + outp_str.len = 0; + outp_str.cur_pos = 0; + uint32_t nmemb = 7; + outp_str.str_arr = calloc(nmemb, sizeof(char *)); + print_str(&outp_str, "\"message_config\": {"); + print_str(&outp_str, "\"font\": \"%s\",\n", config->font); + print_str(&outp_str, "\"display_time\": %d,\n", config->display_time); + print_str(&outp_str, "\"bg_color\": [%f,%f,%f,%f],\n", config->bg_color[0], + config->bg_color[1], config->bg_color[2], config->bg_color[3]); + print_str(&outp_str, "\"fg_color\": [%f,%f,%f,%f],\n", config->fg_color[0], + config->fg_color[1], config->fg_color[2], config->fg_color[3]); + switch(config->anchor) { + case CG_MESSAGE_TOP_LEFT: + print_str(&outp_str, "\"anchor\": \"top_left\"\n", config->font); + break; + case CG_MESSAGE_TOP_CENTER: + print_str(&outp_str, "\"anchor\": \"top_center\"\n", config->font); + break; + case CG_MESSAGE_TOP_RIGHT: + print_str(&outp_str, "\"anchor\": \"top_right\"\n", config->font); + break; + case CG_MESSAGE_BOTTOM_LEFT: + print_str(&outp_str, "\"anchor\": \"bottom_left\"\n", config->font); + break; + case CG_MESSAGE_BOTTOM_CENTER: + print_str(&outp_str, "\"anchor\": \"bottom_center\"\n", config->font); + break; + case CG_MESSAGE_BOTTOM_RIGHT: + print_str(&outp_str, "\"anchor\": \"bottom_right\"\n", config->font); + break; + case CG_MESSAGE_CENTER: + print_str(&outp_str, "\"anchor\": \"center\"\n", config->font); + break; + case CG_MESSAGE_NOPT: // This should actually never occur + print_str(&outp_str, "\"anchor\": \"no_op\"\n", config->font); + break; + } + print_str(&outp_str, "}"); + return dyn_str_to_str(&outp_str); +} + void print_modes(struct dyn_str *str, char **modes) { uint32_t len = 0; @@ -1017,19 +1061,19 @@ print_output(struct cg_output *outp) { struct dyn_str outp_str; outp_str.len = 0; outp_str.cur_pos = 0; - uint32_t nmemb = 8; - struct wlr_box outp_box; - wlr_output_layout_get_box(outp->server->output_layout, outp->wlr_output, - &outp_box); + uint32_t nmemb = 10; outp_str.str_arr = calloc(nmemb, sizeof(char *)); - print_str(&outp_str, "\"%s\": {\n", outp->wlr_output->name); + print_str(&outp_str, "\"%s\": {\n", outp->name); print_str(&outp_str, "\"priority\": %d,\n", outp->priority); - print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", outp_box.x, - outp_box.y); + print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", + output_get_layout_box(outp).x, output_get_layout_box(outp).y); print_str(&outp_str, "\"size\": {\"width\":%d,\"height\":%d},\n", outp->wlr_output->width, outp->wlr_output->height); print_str(&outp_str, "\"refresh_rate\": %f,\n", (float)outp->wlr_output->refresh / 1000.0); + print_str(&outp_str, "\"permanent\": %d,\n", + outp->role == OUTPUT_ROLE_PERMANENT); + print_str(&outp_str, "\"active\": %d,\n", !outp->destroyed); print_str(&outp_str, "\"curr_workspace\": %d,\n", outp->curr_workspace + 1); char *workspaces_str = print_workspaces(outp); if(workspaces_str != NULL) { @@ -1183,7 +1227,7 @@ keybinding_dump(struct cg_server *server) { struct dyn_str str; str.len = 0; str.cur_pos = 0; - uint32_t nmemb = 13; + uint32_t nmemb = 14; str.str_arr = calloc(nmemb, sizeof(char *)); print_str(&str, "{\"event_name\":\"dump\","); @@ -1200,11 +1244,15 @@ keybinding_dump(struct cg_server *server) { } print_str(&str, "\"views_curr_id\":%d,\n", curr_view_id); print_str(&str, "\"tiles_curr_id\":%d,\n", curr_tile_id); - print_str(&str, "\"curr_output\":\"%s\",\n", - server->curr_output->wlr_output->name); + print_str(&str, "\"curr_output\":\"%s\",\n", server->curr_output->name); print_str(&str, "\"default_mode\":\"%s\",\n", get_mode_name(server->modes, server->seat->default_mode)); print_modes(&str, server->modes); + char *message_string = print_message_conf(&server->message_config); + if(message_string != NULL) { + print_str(&str, "%s,", message_string); + free(message_string); + } char *outps_str = print_outputs(server); if(outps_str != NULL) { print_str(&str, "%s,", outps_str); @@ -1296,9 +1344,8 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { "{\"event_name\":\"move_view_to_cycle_output\",\"view_id\":%d,\"view_" "pid\":%d,\"old_output\":\"%s\",\"old_output_id\":%d,\"new_output\":\"%" "s\",\"new_output_id\":%d,\"old_tile_id\":%d,\"new_tile_id\":%d}", - id, pid, old_outp->wlr_output->name, output_get_num(old_outp), - server->curr_output->wlr_output->name, - output_get_num(server->curr_output), + id, pid, old_outp->name, output_get_num(old_outp), + server->curr_output->name, output_get_num(server->curr_output), old_outp->workspaces[old_outp->curr_workspace]->focused_tile->id, server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->id); @@ -1420,8 +1467,8 @@ keybinding_switch_output(struct cg_server *server, int output) { "{\"event_name\":\"switch_output\",\"old_output\":" "\"%s\",\"old_output_id\":%d,\"new_output\":\"%s\"," "\"new_output_id\":%d}", - old_outp->wlr_output->name, output_get_num(old_outp), - it->wlr_output->name, output_get_num(it)); + old_outp->name, output_get_num(old_outp), it->name, + output_get_num(it)); return; } ++count; @@ -1467,8 +1514,7 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { server, "{\"event_name\":\"move_view_to_output\",\"view_id\":%d,\"old_" "output\":\"%s\",\"new_output\":\"%s\"}", - view_id, old_outp->wlr_output->name, - server->curr_output->wlr_output->name); + view_id, old_outp->name, server->curr_output->name); } void @@ -1503,7 +1549,7 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { "\"old_workspace\":%d,\"new_workspace\":%d," "\"output\":\"%s\",\"output_id\":%d,\"view_pid\":%d}", view == NULL ? -1 : (int)view->id, old_ws + 1, ws + 1, - server->curr_output->wlr_output->name, + server->curr_output->name, output_get_num(server->curr_output), view == NULL ? 0 : view->impl->get_pid(view)); } @@ -1552,17 +1598,18 @@ keybinding_configure_output(struct cg_server *server, struct cg_output *output, *tmp_output; wl_list_for_each_safe(output, tmp_output, &server->outputs, link) { - if(strcmp(config->output_name, output->wlr_output->name) == 0) { + if(strcmp(config->output_name, output->name) == 0) { + int output_num = output_get_num(output); output_configure(server, output); - ipc_send_event(output->server, + ipc_send_event(server, "{\"event_name\":\"configure_output\",\"output\":\"%" "s\",\"output_id\":%d}", - cfg->output_name, output_get_num(output)); + cfg->output_name, output_num); return; } } wl_list_for_each_safe(output, tmp_output, &server->disabled_outputs, link) { - if(strcmp(config->output_name, output->wlr_output->name) == 0) { + if(strcmp(config->output_name, output->name) == 0) { output_configure(server, output); ipc_send_event( output->server, @@ -1618,6 +1665,9 @@ keybinding_configure_message(struct cg_server *server, server->message_config.fg_color[2] = config->fg_color[2]; server->message_config.fg_color[3] = config->fg_color[3]; } + if(config->anchor != CG_MESSAGE_NOPT) { + server->message_config.anchor = config->anchor; + } ipc_send_event(server, "{\"event_name\":\"configure_message\"}"); } @@ -1659,6 +1709,10 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_RUN_COMMAND: { int pid; if((pid = fork()) == 0) { + setsid(); + sigset_t set; + sigemptyset(&set); + sigprocmask(SIG_SETMASK, &set, NULL); if(fork() == 0) { into_process(data.c); } diff --git a/keybinding.h b/keybinding.h index a5958f0..fca1271 100644 --- a/keybinding.h +++ b/keybinding.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef KEYBINDING_H diff --git a/keys/cagebreak@project-repo.co.pub b/keys/cagebreak@project-repo.co.pub index 648618b..4ef3235 100644 --- a/keys/cagebreak@project-repo.co.pub +++ b/keys/cagebreak@project-repo.co.pub @@ -1,87 +1,76 @@ -----BEGIN PGP PUBLIC KEY BLOCK----- -mQINBGQh0wgBEADIIjCM9OkxJiof/YNG3HRzlsbTACuppDJHmg6RTGZb6dKNHt98 -ZLs2pmDdTMslzffoNUTov7e9JymrCNFSlTcw+lHZ0mx6nqVhPKnMEWeN84YwU76m -qMH99GfNt/j9KYSJuqRINmuoyP2dkj+jgMs8BGnEQsEsfE+ilC8Pgzn0BwH2AuUY -XdGOkIRPdOZHEjlwBVVUVgrhVUwWY6E+XUCDxiXwbITwozGDuRa630Uvr3ON8q2N -6GblOjKkSwbnTEjdSGfsoBORol94f2XaOvBXr7BrQW0kiqB00LtcFpQzm7Jd6NF6 -Ch/jP+aHkXiDO7r9EJXzVssJhySJP/r00T4kB2E3tucqj4q/X60eLndWy0b9kf4n -VnKKsRQ8hZvtBOK9BfCBBYX365msICqpKPFwgb3HefgdCpLN/OBPjerbDeGCbWNB -bZfT0arLKWbFU/8rYg392PnCydE/9UtXNLUxuIqwOjH62xvHI41hDglq/GH7a71W -IusqEfPkdmT1+N2VyUCnawIwlmLic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HfG28ok7rVTiGWi1ooe163k2L0xzgLEWM1nFIkl5cVNQ3el9qD +5QMIcNrVNYp//MtUpwMT37SB7GXI98kaYA6e46pPeVN/YDoEIkQT9a2hYfu7NiEA +EQEAAYkCPAQYAQgAJhYhBOfVs1ib/N3qGfPKD8VGZYYFObWyBQJllXmAAhsMBQkB +4TOAAAoJEMVGZYYFObWycmAP/3P6FmUh2BHqNGiIgSBg1AEFoTHKzipswX4cXsDz +UlI3L/bBBCVaqAGr5Ff5gPYsBDjhWh4qWGtMRFpuyTyvJMsyN942yozSW5dMb2oU +Mj0ka8JCMGZ/Nmuk9mrrCkzhOOnZxR0W+B4QGZgBuKZQNu6vCD+BMvLtQ313h05R +DLp3+tiXHXT5Btm1G74iuKcSaYYz3jjGJo+d1eVrvIG+c39L2d0ryHV9KLWq+VuQ +XcOr6apSDQueQn6b0IfaXAhUMNo1lImxz50z+pFFVAg8zZMTgaG+V6fKV/rUOfOo +4KD4LKuWnIQErfcPeHbEcc+mPZKtFpeUNTXCo0+9WnLZCCk9M659Vh6JcICbh3Ln +KtfkxsE3EvuYbghpdMdInnBtB6IHkwh80+Kc1b0iKvWA2Uq00WS9FLyRzbC+Rv2v +P0kRGskwnYymNue4nCgGYgS3Eu6uTJGxDeUwtG70wcXBoC8Pq9Df78MdhWWG83y7 +nuksxaPoe7wsvIaLbuzsi+AsPYE1zqdzMEfhxS/0MDxlcByy7Fq2WQcBOAFFktYF +u68mcKvZ5UQuZm4IPnYGIIlhrHPP5SMWmUL4Roh0/KmTPiNFnDH+yRAWwPX3m7Hc +0j2bX/OGH9XoNw1Zq3Mf15MC2SZp+4uJfGyxmLg7lQghPXWMMqsKtx6mQLoUnGhv +6arp +=AorA -----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak@project-repo.co.pub-legacy-4 b/keys/cagebreak@project-repo.co.pub-legacy-4 new file mode 100644 index 0000000..648618b --- /dev/null +++ b/keys/cagebreak@project-repo.co.pub-legacy-4 @@ -0,0 +1,87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x8RYLjV5g6hPD ++riXIhhH3II0vwj9hUP3I8AGdZBR9oV8X4TwlWtZAPAKdw== +=bl5A +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_13@project-repo.co.pub b/keys/cagebreak_signing_key_13@project-repo.co.pub new file mode 100644 index 0000000..7c8a376 --- /dev/null +++ b/keys/cagebreak_signing_key_13@project-repo.co.pub @@ -0,0 +1,76 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGWUZaEBEACb84wE6iLL+FjnziWKDUR0zeYLth3x10UZS7Yu0zmrZOFlht4M +OQJ7Fr7aOAu30XRrNWKMaXov5kBIaggpg3vMGT4bL0yoeWoHc39mU2JL78pP1c08 +H+I+KusCcsLtCT07k+YvUWCXYjRtSs/w14SS7Hj5CyMp4NNLqMRkLd4Hcd4CT5qp +PhlHAULVCEPsALk7krrNLG4XqAwvpvuWZR6FDgdxHHwpu2zI+43cfhZQ3XP88dk0 +WGI+owoD+yYib2xY2+gU5IbHoVNUCF7Zdkf+5a2K1mYU4hkCGQQyx3LBKEa45BVF +I25uxBQ/elH9r02K3ppAdixqEs+RlL5VFudM3/Cdl04qfgHOxmkNJzSAiZlhoYHw +uta0o0ynFwYJIi1EUnOAFsrGeE0XcKeT7DXjbAsSqBm1lev7s4ueKvCgfnY5S06k +JhQZsVFnF7XxW6Ar+32AxEH+8fO1KQUJlenzIupPg03hx2zQ9BxaXnS+3rDzXDaF +kbFTaHz5ldU1DyqmHaFH9NEZH+2k2b45nmoc2Ts5D24g59+siJzb/mWk/iQCioJ/ +pAFrDuEunHVoXMOlZ43cph3qAy7mjG+KnUY9QSIZl+SsHvJHUJXD3qJkoDPOwQI/ +jro66de7U3WS28z1yPEr5jGkBgnPMEN35QbrGQ2tUPDJl12vJgvU24HpmQARAQAB +tENDYWdlYnJlYWsgU2lnbmluZyBLZXkgMTMgPGNhZ2VicmVha19zaWduaW5nX2tl +eV8xM0Bwcm9qZWN0LXJlcG8uY28+iQJXBBM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qAAWuQpDwZIZB3CZ7HPBXAInH5J5dR/s3akZdwb6zvxdK +RuvbkIdw8hFWsc0M3tIIM3mWim9ctB3xYqC4O6gyFdqDNHk4B4j0xrbeSVgp+kPP +gV5J8rfegY09uxzPKlUgpIf8NRhdE/gLjm5nv1KrIe3G1Bk/0H7RhRkqug5rkAE8 +TfLGrvXkYCWJ0BHU3mivBJt/NaAgj/SF0YbomRPFt5BJzYGU6EEyj+G6AIHrm4np +88/5ZAqxfb37wtucXJ+IcjHZsEBAuh61xMWHpgxlJ1246+G+FJM1aHlqGbWruNlo +R6dymqN/kMbN4nKWG3j8549Av03ltpzxaASf4vjDHZ0GziXCovnzGaF9Bt5wyG7v +TyaUBFxacdtKCgMzGidIvPVrTqLxSr7Dwn8Iz3oZp4yVZpldEuTP5OxA/OP55ym1 +tAPEKVpa9Ui+R+5dwhRWzMxdZ7Ns0OrquFbZ6/rGafqie8fjVmEIoSjd0Ny+/40t +EGKSx//F90ZPS02ZRqy12rVV/i5Xyt38UCzlegFq9BAsz2IhXkUQSts0EAS3wE2Q +D+B+0RH+tcL4I8AzyE/LMpHBA7m1hi6kciCOHSzYANvuTJ3na6p0x6YBhcRkPgTD +XPUssBeVi6uNhWON/EjKc0cLAfNwuBrjj6I= +=5Ie4 +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_14@project-repo.co.pub b/keys/cagebreak_signing_key_14@project-repo.co.pub new file mode 100644 index 0000000..974001d --- /dev/null +++ b/keys/cagebreak_signing_key_14@project-repo.co.pub @@ -0,0 +1,76 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGWUZeUBEAC3tS/7YZznD2QlyIPUqMMxT7475FQqxPCd11OM2I6tc9wjtKqt +m4l2HvMZ8tiykHNfts/3sgbBW9nsev4NwKV60GFOyFUT+W9IpxuO6ghzbsu+vO1f +8768GHa8376Ls1y3ujxfOoP7zQsvfs6JJYeFgzPLTLbA/hPciby9hnQcBrBq0vL9 +iSNdMNv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l4QVnJ+S +ICUtM1K2xPymTSrajBnkqTin8HOIigAiFo6RyvSv0XD6IQc43y0UnaYDZH7GpF1Z +6M9mgn15INWAc8kzI/NV1MsRAiRDCixL7gO0dAGZueCO7MgLiGpQB/6dLK8ETfHm +2rpj+N0DJVi3/r0GWYgBEzvO+yV1ly011sk= +=AVO4 +-----END PGP PUBLIC KEY BLOCK----- diff --git a/libinput.c b/libinput.c index e980060..b6244aa 100644 --- a/libinput.c +++ b/libinput.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #include "input.h" @@ -219,7 +219,7 @@ output_by_name_or_id(const char *name_or_id, struct cg_server *server) { char identifier[128]; output_get_identifier(identifier, sizeof(identifier), output); if(strcasecmp(identifier, name_or_id) == 0 || - strcasecmp(output->wlr_output->name, name_or_id) == 0) { + strcasecmp(output->name, name_or_id) == 0) { return output; } } diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index d5b4969..ee68d72 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,8 +1,8 @@ -cagebreak-config(5) "Version 2.2.3" "Cagebreak Manual" +cagebreak-config(5) "Version 2.3.0" "Cagebreak Manual" # NAME -*cagebreak-config* — Cagebreak configuration file +*cagebreak-config* Cagebreak configuration file # SYNOPSIS @@ -17,9 +17,8 @@ are parsed sequentially but independently from the rest of the file. Each line starting with a "#" is a comment. -Note that nesting of commands is limited to 50 times, though lines -are arbitrarily long in practice, though a reasonable limit of 4Mb has -been set. +Note that nesting of commands is limited to 50 times. +Lines are arbitrarily long in practice, though a reasonable limit of 4Mb has been set. See *KEY DEFINITIONS* for details on modifier keys and *MODES* for details on modes. @@ -29,8 +28,8 @@ on modes. *abort* Return to default mode -*background * - Set RGB of background - <[r|g|b]> are floating point numbers +*background * + Set RGB of background - <[r|g|b]\> are floating point numbers between 0 and 1. There is no support for background images. @@ -39,8 +38,8 @@ on modes. background 1.0 0.0 0.0 ``` -*bind * - Bind to execute if pressed in root mode +*bind * + Bind to execute if pressed in root mode ``` bind @@ -52,15 +51,17 @@ definekey root Close current window - This may be useful for windows of applications which do not offer any method of closing them. -*configure_message [font |[f|b]g_color b> |display_time ]* +*configure_message [font |[f|b]g_color |display_time |anchor ]* Configure message characteristics - - - font sets - - is - - X core font description or - - FreeType font description via pango - - fg_color sets RGBA of foreground - - bg_color sets RGBA of background - - display_time sets display time in seconds + - font sets the font of the message. + Here, is either + - an X core font description or + - a FreeType font description via pango + - fg_color sets the RGBA of the foreground + - bg_color sets the RGBA of the background + - display_time sets the display time in seconds + - anchor sets the position of the message. + may be one of {top,bottom}\_{left,center,right} or center. ``` # Set font @@ -85,20 +86,20 @@ configure_message display_time 4 This simply hides the cursor. Pointing and clicking is still possible. -*custom_event * +*custom_event * Send a custom event to the IPC socket This sends an event of type "custom_event" to all programs - listening to the IPC socket along with the string . + listening to the IPC socket along with the string . See *cagebreak-socket(7)* for more details. -*definekey * - Bind to execute if pressed in - +*definekey * + Bind to execute if pressed in - *definekey* is a more general version of *bind*. -*definemode * - Define new mode - After a call to *definemode*, - can be used with *definekey* to create a custom key mapping. +*definemode * + Define new mode - After a call to *definemode*, + can be used with *definekey* to create a custom key mapping. ``` # define new mode and create a mapping for it @@ -109,8 +110,8 @@ definekey foo C-t abort *dump* Triggers the *dump* event, see *cagebreak-socket(7)* for details -*escape * - Set to switch to root mode to execute one command +*escape * + Set to switch to root mode to execute one command ``` escape @@ -130,8 +131,8 @@ definekey top mode root *exchangeup* Exchange current window with window in the tile to the top -*exec * - Execute using *sh -c* +*exec * + Execute using *sh -c* *focus* Focus next tile @@ -154,10 +155,10 @@ definekey top mode root *hsplit* Split current tile horizontally -*input * - Set to for device - - can be "\*" (wildcard), of the form - "type:" or the identifier of the device as printed +*input * + Set to for device - + can be "\*" (wildcard), of the form + "type:" or the identifier of the device as printed for example by *cagebreak -s*. The supported input types are - touchpad - pointer @@ -174,7 +175,7 @@ definekey top mode root *accel_profile adaptive|flat* Set pointer acceleration profile for specified input device - *calibration_matrix <6 space-separated floating point values>* + *calibration_matrix <6 space-separated floating point values\>* Set calibration matrix *click_method none|button_areas|clickfinger* @@ -207,26 +208,26 @@ definekey top mode root Enable or disable natural (inverted) scrolling for specified input device - *pointer_accel [<-1|1>]* + *pointer_accel [<-1|1\>]* Change the pointer acceleration for specified input device - *scroll_button disable|* + *scroll_button disable|* Set button used for scroll_method on_button_down - The button can be given as an event name or code, which can be obtained from *libinput debug-events*. If set to _disable_, it disables the scroll_method on_button_down. - *scroll_factor * + *scroll_factor * Change the scroll factor for the specified input device - Scroll speed will be scaled by the given value, which must be non-negative. *scroll_method none|two_finger|edge|on_button_down* Change scroll method for specified input device - *repeat_delay * + *repeat_delay * Repeat delay in ms for keyboards only - *repeat_rate * + *repeat_rate * Repeat rate in 1/s for keyboards only *tap enabled|disabled* @@ -238,11 +239,11 @@ definekey top mode root middle click. _lmr_ treats 1 finger as left click, 2 fingers as middle click, and 3 fingers as right click. -message +message Display a line of arbitrary text. -*mode * - Enter mode "" - Returns to default mode, after a command is +*mode * + Enter mode "" - Returns to default mode, after a command is executed. *movetonextscreen* @@ -253,12 +254,12 @@ message Move currently focused window to previous screen See *output* for differences between screen and output. -*movetoscreen * - Move currently focused window to -th screen +*movetoscreen * + Move currently focused window to -th screen See *output* for differences between screen and output. -*movetoworkspace * - Move currently focused window to -th workspace +*movetoworkspace * + Move currently focused window to -th workspace See *output* for differences between screen and output. *next* @@ -271,23 +272,32 @@ message *only* Remove all splits and make current window fill the entire screen -*output [[pos res x rate [scale ]] | enable | disable | prio | rotate ]* - Configure output "" - - - and are the position of the +*output [[pos res x rate [scale ]] | enable | disable | [permanent|peripheral] | prio | rotate ]* + Configure output "" - + - and are the position of the monitor in pixels. The top-left monitor should have the coordinates 0 0. - - and specify the resolution in pixels. - - sets the refresh rate of the monitor (often this is 50 or 60). - - sets the output scale (default is 1.0) - - enable and disable enable or disable . Note that if - is the only enabled output, *output disable* has + - and specify the resolution in pixels. + - sets the refresh rate of the monitor (often this is 50 or 60). + - sets the output scale (default is 1.0) + - enable and disable enable or disable . Note that if + is the only enabled output, *output disable* has no effect. - - prio is used to set the priority of an output. If + - permanent sets to persist even on disconnect. When + the physical monitor is disconnected, the output is + maintained and operates identically to the attached monitor. On reconnect, + the monitor operates as though it was never disconnected. Setting the + output role to peripheral when the monitor is disconnected, + destroys the output, as if the monitor were disconnected. + - peripheral sets the role of to peripheral, meaning that on + disconnecting the respective monitor, all views will be moved to another + available output. The default role is peripheral. + - prio is used to set the priority of an output. If nothing else is set, outputs are added as they request to be added - and have a numerical priority of -1. Using prio it is possible - to set priorities for outputs, where >= 1. The larger is, + and have a numerical priority of -1. Using prio it is possible + to set priorities for outputs, where >= 1. The larger is, the higher the priority is, that is to say, the earlier the output will appear in the list of outputs. - - rotate is used to rotate the output by ` mod 4 x 90` degrees + - rotate is used to rotate the output by ` mod 4 x 90` degrees counter-clockwise. ``` @@ -333,19 +343,19 @@ output DP-1 rotate 3 *resizeup* Resize current tile towards the top -*screen * - Change to -th screen +*screen * + Change to -th screen See *output* for differences between screen and output. *show_info* Display information about the current setup - In particular, print the identifiers of the available inputs and outputs. -*setmode * - Set default mode to +*setmode * + Set default mode to -*switchvt * - Switch to tty +*switchvt * + Switch to tty *time* Display time @@ -353,11 +363,11 @@ output DP-1 rotate 3 *vsplit* Split current tile vertically -*workspace * - Change to -th workspace +*workspace * + Change to -th workspace -*workspaces * - Set number of workspaces to - is a single integer larger than 1 +*workspaces * + Set number of workspaces to - is a single integer larger than 1 and less than 30. # MODES @@ -386,7 +396,7 @@ Keys are specified by their names as displayed for example by *xev*. Modifiers can be specified using the following syntax: - - + - The supported modifiers are: @@ -398,7 +408,7 @@ The supported modifiers are: *S - Shift* -*2 - Mod2* +*2 - Mod 2* *3 - Mod 3* @@ -425,14 +435,12 @@ Mail contact: `cagebreak @ project-repo . co` GPG Fingerprints: -- B15B92642760E11FE002DE168708D42451A94AB5 -- F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C -- 3ACEA46CCECD59E4C8222F791CBEB493681E8693 - 0A268C188D7949FEB39FD1462F2AD980247E4918 +- 283D10F54201B0C6CCEE2C561DE04E4B056C749D # LICENSE -Copyright (c) 2020-2023 The Cagebreak authors +Copyright (c) 2020-2024 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 19365d6..ed47f05 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -1,8 +1,8 @@ -cagebreak-socket(7) "Version 2.2.3" "Cagebreak Manual" +cagebreak-socket(7) "Version 2.3.0" "Cagebreak Manual" # NAME -*cagebreak-socket* — Cagebreak socket +*cagebreak-socket* Cagebreak socket # SYNOPSIS @@ -30,7 +30,10 @@ Here is an example of how this works using *only* as a command sent over the soc ``` only -cg-ipc{"event_name":"fullscreen","tile_id":2,"workspace":1,"output":"eDP-1"} +cg-ipc{"event_name":"fullscreen", +"tile_id":2, +"workspace":1, +"output":"eDP-1"} ``` This documentation describes the trigger for the events, the keys and the data @@ -45,7 +48,9 @@ type of the values of each event. ``` background 0 1.0 0 -cg-ipc{"event_name":"background","old_bg":[0.000000,1.000000,1.000000],"new_bg":[0.000000,1.000000,0.000000]} +cg-ipc{"event_name":"background", +"old_bg":[0.000000,1.000000,1.000000], +"new_bg":[0.000000,1.000000,0.000000]} ``` *close* @@ -61,7 +66,13 @@ cg-ipc{"event_name":"background","old_bg":[0.000000,1.000000,1.000000],"new_bg": ``` close -cg-ipc{"event_name":"close","view_id":47,"view_pid":30456,"tile_id":47,"workspace":1,"output":"eDP-1","output_id":1} +cg-ipc{"event_name":"close", +"view_id":47, +"view_pid":30456, +"tile_id":47, +"workspace":1, +"output":"eDP-1", +"output_id":1} ``` *configure_input* @@ -110,7 +121,13 @@ cg-ipc{"event_name":"configure_output","output":"eDP-1","output_id":1} ``` # Cursor switches tile -cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_output_id":1,"old_tile":2,"new_output":"eDP-1","new_output_id":1,"new_tile":3} +cg-ipc{"event_name":"cursor_switch_tile", +"old_output":"eDP-1", +"old_output_id":1, +"old_tile":2, +"new_output":"eDP-1", +"new_output_id":1, +"new_tile":3} ``` *custom_event* @@ -136,7 +153,12 @@ cg-ipc{"event_name":"custom_event","message":"Hello World!"} ``` nextscreen -cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","old_output_id":1,"new_output":"HDMI-A-1","new_output_id":2,"reverse":0} +cg-ipc{"event_name":"cycle_outputs", +"old_output":"eDP-1", +"old_output_id":1, +"new_output":"HDMI-A-1", +"new_output_id":2, +"reverse":0} ``` *cycle_views* @@ -154,7 +176,15 @@ cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","old_output_id":1,"new_ ``` next -cg-ipc{"event_name":"cycle_views","old_view_id":11,"old_view_pid":32223,"new_view_id":4,"old_view_pid";53221,"tile_id":13,"workspace":1,"output":"eDP-1","output_id":1} +cg-ipc{"event_name":"cycle_views", +"old_view_id":11, +"old_view_pid":32223, +"new_view_id":4, +"old_view_pid";53221, +"tile_id":13, +"workspace":1, +"output":"eDP-1", +"output_id":1} ``` *definekey* @@ -220,12 +250,20 @@ cg-ipc{"event_name":"destroy_output","output":"HDMI-A-1","output_id":2} - curr_output: current output as a string - default_mode: name of the default mode as a string - modes: list of names of modes as strings + - message_config: the current configuration of the cagebreak messages + - font: the font used to display the messages + - display_time: the duration in seconds that the cagebreak messages are displayed + - bg_color: list of four floating point numbers denoting the background color in rgba + - fg_color: list of four floating point numbers denoting the foreground color in rgba + - anchor: the positioning of the messages on the screen (see *cagebreak-config(5)* for more information) - outputs: object of objects for each output - output name as string - priority: priority as per *output* prio in *cagebreak-config(5)* or default - coords: object of x and y coordinates of output - size: object of width and height as integers - refresh_rate: refresh rate as float + - permanent: 0 if peripheral, 1 if permanent + - active: 1 if the output is active, 0 if not - curr_workspace: current workspace as an integer - workspaces: list of objects for each workspace - views: list of objects for each view @@ -258,11 +296,18 @@ cg-ipc{"event_name":"dump","nws":1, "curr_output":"eDP-1", "default_mode":"top", "modes":["top","root","resize"], -"outputs": {"eDP-1": { +"message_config": {"font": "pango:Monospace 10", +"display_time": 2, +"bg_color": [0.900000,0.850000,0.850000,1.000000], +"fg_color": [0.000000,0.000000,0.000000,1.000000], +"anchor": "top_right" +},"outputs": {"eDP-1": { "priority": -1, "coords": {"x":0,"y":0}, "size": {"width":2560,"height":1440}, "refresh_rate": 60.012000, +"permanent": 0, +"active": 1, "curr_workspace": 0, "workspaces": [{"views": [{ "id": 16, @@ -351,7 +396,12 @@ cg-ipc{"event_name":"dump","nws":1, ``` focus -cg-ipc{"event_name":"focus_tile","old_tile_id":14,"new_tile_id":13,"workspace":1,"output":"eDP-1","output_id":1} +cg-ipc{"event_name":"focus_tile", +"old_tile_id":14, +"new_tile_id":13, +"workspace":1, +"output":"eDP-1", +"output_id":1} ``` *fullscreen* @@ -365,7 +415,11 @@ cg-ipc{"event_name":"focus_tile","old_tile_id":14,"new_tile_id":13,"workspace":1 ``` only -cg-ipc{"event_name":"fullscreen","tile_id":3,"workspace":1,"output":"eDP-1","output_id":1} +cg-ipc{"event_name":"fullscreen", +"tile_id":3, +"workspace":1, +"output":"eDP-1", +"output_id":1} ``` *move_view_to_cycle_output* @@ -381,8 +435,17 @@ cg-ipc{"event_name":"fullscreen","tile_id":3,"workspace":1,"output":"eDP-1","out ``` movetonextscreen -cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1","reverse":0} -cg-ipc{"event_name":"move_view_to_cycle_output","view_id":11,"view_pid":43123,"old_output":"eDP-1","old_output_id":1,"new_output":"HDMI-A-1","new_output_id":2} +cg-ipc{"event_name":"cycle_outputs", +"old_output":"eDP-1", +"new_output":"HDMI-A-1", +"reverse":0} +cg-ipc{"event_name":"move_view_to_cycle_output", +"view_id":11, +"view_pid":43123, +"old_output":"eDP-1", +"old_output_id":1, +"new_output":"HDMI-A-1", +"new_output_id":2} ``` *move_view_to_output* @@ -395,8 +458,13 @@ cg-ipc{"event_name":"move_view_to_cycle_output","view_id":11,"view_pid":43123,"o ``` movetoscreen 2 -cg-ipc{"event_name":"switch_output","old_output":"eDP-1","new_output":"HDMI-A-1"} -cg-ipc{"event_name":"move_view_to_output","view_id":78,"old_output":"eDP-1","new_output":"HDMI-A-1"} +cg-ipc{"event_name":"switch_output", +"old_output":"eDP-1", +"new_output":"HDMI-A-1"} +cg-ipc{"event_name":"move_view_to_output", +"view_id":78, +"old_output":"eDP-1", +"new_output":"HDMI-A-1"} ``` *move_view_to_ws* @@ -412,8 +480,17 @@ cg-ipc{"event_name":"move_view_to_output","view_id":78,"old_output":"eDP-1","new ``` movetoworkspace 1 -cg-ipc{"event_name":"switch_ws","old_workspace":1,"new_workspace":1,"output":"eDP-1"} -cg-ipc{"event_name":"move_view_to_ws","view_id":43,"old_workspace":0,"new_workspace":0,"output":"eDP-1","output_id":1,"view_pid":64908} +cg-ipc{"event_name":"switch_ws", +"old_workspace":1, +"new_workspace":1, +"output":"eDP-1"} +cg-ipc{"event_name":"move_view_to_ws", +"view_id":43, +"old_workspace":0, +"new_workspace":0, +"output":"eDP-1", +"output_id":1, +"view_pid":64908} ``` *new_output* @@ -442,8 +519,19 @@ cg-ipc{"event_name":"new_output","output":"HDMI-A-1","output_id":2,"priority":-1 ``` resizeleft -cg-ipc{"event_name":"resize_tile","tile_id":14,"old_dims":"[1280,0,1440,1280]","new_dims":"[1270,0,1440,1290]","workspace":1,"output":"eDP-1","output_id":1} -cg-ipc{"event_name":"resize_tile","tile_id":13,"old_dims":"[0,0,1440,1280]","new_dims":"[0,0,1440,1270]","workspace":1,"output":"eDP-1","output_id":1} +cg-ipc{"event_name":"resize_tile", +"tile_id":14, +"old_dims":"[1280,0,1440,1280]", +"new_dims":"[1270,0,1440,1290]", +"workspace":1,"output":"eDP-1", +"output_id":1} +cg-ipc{"event_name":"resize_tile", +"tile_id":13, +"old_dims":"[0,0,1440,1280]", +"new_dims":"[0,0,1440,1270]", +"workspace":1, +"output":"eDP-1", +"output_id":1} ``` *set_nws* @@ -471,7 +559,13 @@ cg-ipc{"event_name":"set_nws","old_nws":1,"new_nws":2} ``` hsplit -cg-ipc{"event_name":"split","tile_id":11,"new_tile_id":12,"workspace":1,"output":"eDP-1","output_id":1,"vertical":0} +cg-ipc{"event_name":"split", +"tile_id":11, +"new_tile_id":12, +"workspace":1, +"output":"eDP-1", +"output_id":1, +"vertical":0} ``` *swap_tile* @@ -488,7 +582,13 @@ cg-ipc{"event_name":"split","tile_id":11,"new_tile_id":12,"workspace":1,"output" ``` exchangeright -cg-ipc{"event_name":"swap_tile","tile_id":1,"tile_pid":53478,"swap_tile_id":3,"swap_tile_pid":98234,"workspace":1,"output":"eDP-1"} +cg-ipc{"event_name":"swap_tile", +"tile_id":1, +"tile_pid":53478, +"swap_tile_id":3, +"swap_tile_pid":98234, +"workspace":1, +"output":"eDP-1"} ``` *switch_default_mode* @@ -514,7 +614,11 @@ switch_output ``` screen 2 -cg-ipc{"event_name":"switch_output","old_output":"eDP-1","old_output_id":1,"new_output":"HDMI-A-1","new_output_id":2} +cg-ipc{"event_name":"switch_output", +"old_output":"eDP-1", +"old_output_id":1, +"new_output":"HDMI-A-1", +"new_output_id":2} ``` switch_ws @@ -528,7 +632,11 @@ switch_ws ``` workspace 2 -cg-ipc{"event_name":"switch_ws","old_workspace":1,"new_workspace":2,"output":"eDP-1","output_id":1} +cg-ipc{"event_name":"switch_ws", +"old_workspace":1, +"new_workspace":2, +"output":"eDP-1", +"output_id":1} ``` *view_map* @@ -544,7 +652,13 @@ cg-ipc{"event_name":"switch_ws","old_workspace":1,"new_workspace":2,"output":"eD ``` # process opens a view -cg-ipc{"event_name":"view_map","view_id":28,"tile_id":14,"workspace":1,"output":"eDP-1","output_id":1,"view_pid":39827} +cg-ipc{"event_name":"view_map", +"view_id":28, +"tile_id":14, +"workspace":1, +"output":"eDP-1", +"output_id":1, +"view_pid":39827} ``` *view_unmap* @@ -560,7 +674,13 @@ cg-ipc{"event_name":"view_map","view_id":28,"tile_id":14,"workspace":1,"output": ``` # view is closed by the process -cg-ipc{"event_name":"view_unmap","view_id":24,"tile_id":13,"workspace":1,"output":"eDP-1","output_id":1,"view_pid":39544} +cg-ipc{"event_name":"view_unmap", +"view_id":24, +"tile_id":13, +"workspace":1, +"output":"eDP-1", +"output_id":1, +"view_pid":39544} ``` ## SECURITY @@ -590,14 +710,12 @@ Mail contact: `cagebreak @ project-repo . co` GPG Fingerprints: -- B15B92642760E11FE002DE168708D42451A94AB5 -- F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C -- 3ACEA46CCECD59E4C8222F791CBEB493681E8693 - 0A268C188D7949FEB39FD1462F2AD980247E4918 +- 283D10F54201B0C6CCEE2C561DE04E4B056C749D # LICENSE -Copyright (c) 2022 - 2023 The Cagebreak authors +Copyright (c) 2022 - 2024 The Cagebreak authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index bdd469f..4dfd854 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 2.2.3" "Cagebreak Manual" +cagebreak(1) "Version 2.3.0" "Cagebreak Manual" # NAME @@ -28,7 +28,7 @@ socket specified in the environment variable *\$CAGEBREAK_SOCKET*. The syntax accepted through this socket is identical to that of the configuration file (see *cagebreak-config(5)*). Errors which occur during interaction over IPC channel -are displayed in a message box at the top right of the screen. +are displayed in a message box on the screen. # OPTIONS @@ -87,14 +87,12 @@ Mail contact: `cagebreak @ project-repo . co` GPG Fingerprints: -- B15B92642760E11FE002DE168708D42451A94AB5 -- F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C -- 3ACEA46CCECD59E4C8222F791CBEB493681E8693 - 0A268C188D7949FEB39FD1462F2AD980247E4918 +- 283D10F54201B0C6CCEE2C561DE04E4B056C749D # LICENSE -Copyright (c) 2020-2023 The Cagebreak authors +Copyright (c) 2020-2024 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes diff --git a/manuals.md b/manuals.md new file mode 100644 index 0000000..dd5f84b --- /dev/null +++ b/manuals.md @@ -0,0 +1,5 @@ +# Cagebreak Manuals + + * [cagebreak-config (5)](man/cagebreak-config.5.md) (probably, what you are looking for, commands etc.) + * [cagebreak (1)](man/cagebreak.1.md) (command line arguments, environment variables etc.) + * [cagebreak-socket (7)](man/cagebreak-socket.7.md) (mostly useful for scripting, socket information) diff --git a/meson.build b/meson.build index aeb3346..b0b458d 100644 --- a/meson.build +++ b/meson.build @@ -1,9 +1,9 @@ -# Copyright 2020 - 2023, project-repo and the cagebreak contributors +# Copyright 2020 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT project( 'cagebreak', 'c', -version : '2.2.3', +version : '2.3.0', license : 'MIT', default_options : ['c_std=c11', 'warning_level=3'] ) @@ -204,12 +204,12 @@ reproducible_build_versions = { 'wayland_server': '1.19.0', 'wayland_client': '1.22.0', 'wayland_cursor': '1.22.0', - 'wlroots': '0.17.0', + 'wlroots': '0.17.1', 'xkbcommon': '1.6.0', - 'fontconfig': '2.14.2', - 'libinput': '1.24.0', + 'fontconfig': '2.15.0', + 'libinput': '1.25.0', 'libevdev': '1.13.1', - 'libudev': '254', + 'libudev': '255', 'pango': '1.51.0', 'cairo': '1.18.0', 'pangocairo': '1.51.0', @@ -260,7 +260,7 @@ install_data('LICENSE', install_dir : '/usr/share/licenses/' + meson.project_nam if get_option('man-pages') scdoc = find_program('scdoc') - secssinceepoch = 1701768836 + secssinceepoch = 1706213605 shcommand = 'export SOURCE_DATE_EPOCH=' + secssinceepoch.to_string() + ' ; @0@ < @INPUT@'.format(scdoc.path()) sh = find_program('sh') mandir1 = join_paths(get_option('mandir'), 'man1') @@ -371,12 +371,16 @@ run_target('create-artefacts', # Test Suite test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('Example script header is consistent', find_program('test/script-header'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('Script executability is consistent', find_program('test/script-header'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('Man page consistency', find_program('test/man-pages'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Copyright and LICENSE', find_program('test/copyright-license'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()), ''.join('MESONLICENSE=', meson.project_license())], suite: 'devel' ) -test('Clang-format (formatting check)', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') -test('Shellcheck (script linting)', find_program('test/shellcheck'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('Formatting check (clang-format)', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('Script linting (shellcheck)', find_program('test/shellcheck'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('GPG key validity', find_program('test/gpg-validity'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') -test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel-long') +test('Illegal Strings', find_program('test/illegal-strings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('Static analysis (scan-build)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel-long') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Semantic versioning', find_program('test/versions'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/meson_options.txt b/meson_options.txt index eba2f60..a4377b9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,8 +1,8 @@ -# Copyright 2020 - 2023, project-repo and the cagebreak contributors +# Copyright 2020 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT option('xwayland', type: 'boolean', value: 'false', description: 'Enable support for X11 applications') option('man-pages', type: 'boolean', value: 'false', description: 'Build man pages (requires pandoc)') option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets') option('version_override', type: 'string', description: 'Set the project version to the string specified. Used for creating hashes for reproducible builds.') option('corpus', type: 'string', value: 'fuzz_corpus', description: 'Set fuzzing corpus directory') -option('gpg_id', type: 'string', value: '4E82C72C6B3E58A7BC4FF8554909F84CA83BB867', description: 'Set gpg signing key for cagebreak') +option('gpg_id', type: 'string', value: '438C27DDB5D174673DF4D67B451205B3528C7C63', description: 'Set gpg signing key for cagebreak') diff --git a/message.c b/message.c index d74b8cf..4b99aaf 100644 --- a/message.c +++ b/message.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #include @@ -174,13 +174,9 @@ create_message_texture(const char *string, const struct cg_output *output) { return buf; } -#if CG_HAS_FANALYZE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" -#endif void message_set_output(struct cg_output *output, const char *string, - struct wlr_box *box, enum cg_message_align align) { + struct wlr_box *box, enum cg_message_anchor anchor) { struct cg_message *message = malloc(sizeof(struct cg_message)); if(!message) { wlr_log(WLR_ERROR, "Error allocating message structure"); @@ -202,26 +198,35 @@ message_set_output(struct cg_output *output, const char *string, int height = buf->base.height / scale; message->position->width = width; message->position->height = height; - switch(align) { - case CG_MESSAGE_TOP_RIGHT: { + switch(anchor) { + case CG_MESSAGE_TOP_LEFT: + message->position->x = 0; + message->position->y = 0; + break; + case CG_MESSAGE_TOP_CENTER: + message->position->x -= width / 2; + message->position->y = 0; + break; + case CG_MESSAGE_TOP_RIGHT: message->position->x -= width; + message->position->y = 0; break; - } - case CG_MESSAGE_BOTTOM_LEFT: { + case CG_MESSAGE_BOTTOM_LEFT: + message->position->x = 0; message->position->y -= height; break; - } - case CG_MESSAGE_BOTTOM_RIGHT: { + case CG_MESSAGE_BOTTOM_CENTER: + message->position->x -= width / 2; + message->position->y -= height; + break; + case CG_MESSAGE_BOTTOM_RIGHT: message->position->x -= width; message->position->y -= height; break; - } - case CG_MESSAGE_CENTER: { + case CG_MESSAGE_CENTER: message->position->x -= width / 2; message->position->y -= height / 2; break; - } - case CG_MESSAGE_TOP_LEFT: default: break; } @@ -235,17 +240,18 @@ message_set_output(struct cg_output *output, const char *string, wlr_scene_buffer_create(&scene_output->scene->tree, &buf->base); wlr_scene_node_raise_to_top(&message->message->node); wlr_scene_node_set_enabled(&message->message->node, true); - struct wlr_box outp_box; - wlr_output_layout_get_box(output->server->output_layout, output->wlr_output, - &outp_box); wlr_scene_buffer_set_dest_size(message->message, width, height); - wlr_scene_node_set_position(&message->message->node, - message->position->x + outp_box.x, - message->position->y + outp_box.y); + wlr_scene_node_set_position( + &message->message->node, + message->position->x + output_get_layout_box(output).x, + message->position->y + output_get_layout_box(output).y); } void message_printf(struct cg_output *output, const char *fmt, ...) { + if(output->destroyed) { + return; + } va_list ap; va_start(ap, fmt); char *buffer = malloc_vsprintf_va_list(fmt, ap); @@ -261,26 +267,55 @@ message_printf(struct cg_output *output, const char *fmt, ...) { free(buffer); return; } - struct wlr_box output_box; - wlr_output_layout_get_box(output->server->output_layout, output->wlr_output, - &output_box); - - box->x = output_box.width; - box->y = 0; + struct wlr_box output_box = output_get_layout_box(output); box->width = 0; box->height = 0; + switch(output->server->message_config.anchor) { + case CG_MESSAGE_TOP_LEFT: + box->x = 0; + box->y = 0; + break; + case CG_MESSAGE_TOP_CENTER: + box->x = output_box.width / 2; + box->y = 0; + break; + case CG_MESSAGE_TOP_RIGHT: + box->x = output_box.width; + box->y = 0; + break; + case CG_MESSAGE_BOTTOM_LEFT: + box->x = 0; + box->y = output_box.height; + break; + case CG_MESSAGE_BOTTOM_CENTER: + box->x = output_box.width / 2; + box->y = output_box.height; + break; + case CG_MESSAGE_BOTTOM_RIGHT: + box->x = output_box.width; + box->y = output_box.height; + break; + case CG_MESSAGE_CENTER: + box->x = output_box.width / 2; + box->y = output_box.height / 2; + break; + default: + break; + } - message_set_output(output, buffer, box, CG_MESSAGE_TOP_RIGHT); + message_set_output(output, buffer, box, + output->server->message_config.anchor); free(buffer); alarm(output->server->message_config.display_time); } -#if CG_HAS_FANALYZE -#pragma GCC diagnostic pop -#endif void message_printf_pos(struct cg_output *output, struct wlr_box *position, - const enum cg_message_align align, const char *fmt, ...) { + const enum cg_message_anchor anchor, const char *fmt, ...) { + if(output->destroyed) { + free(position); + return; + } uint16_t buf_len = 256; char *buffer = (char *)malloc(buf_len * sizeof(char)); va_list ap; @@ -289,7 +324,7 @@ message_printf_pos(struct cg_output *output, struct wlr_box *position, vsnprintf(buffer, buf_len, fmt, ap); va_end(ap); - message_set_output(output, buffer, position, align); + message_set_output(output, buffer, position, anchor); free(buffer); alarm(output->server->message_config.display_time); } diff --git a/message.h b/message.h index 806307c..a1b8f13 100644 --- a/message.h +++ b/message.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef MESSAGE_H @@ -11,12 +11,15 @@ struct cg_output; struct wlr_box; struct wlr_buffer; -enum cg_message_align { +enum cg_message_anchor { CG_MESSAGE_TOP_LEFT, + CG_MESSAGE_TOP_CENTER, CG_MESSAGE_TOP_RIGHT, CG_MESSAGE_BOTTOM_LEFT, + CG_MESSAGE_BOTTOM_CENTER, CG_MESSAGE_BOTTOM_RIGHT, CG_MESSAGE_CENTER, + CG_MESSAGE_NOPT }; struct cg_message_config { @@ -24,6 +27,7 @@ struct cg_message_config { int display_time; float bg_color[4]; float fg_color[4]; + enum cg_message_anchor anchor; }; struct cg_message { @@ -37,7 +41,7 @@ void message_printf(struct cg_output *output, const char *fmt, ...); void message_printf_pos(struct cg_output *output, struct wlr_box *position, - enum cg_message_align, const char *fmt, ...); + enum cg_message_anchor, const char *fmt, ...); void message_clear(struct cg_output *output); diff --git a/output.c b/output.c index 0a482f0..c048b9b 100644 --- a/output.c +++ b/output.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L @@ -14,13 +14,16 @@ #if WLR_HAS_X11_BACKEND #include #endif +#include #include #include #include +#include #include #include #include #include +#include #include #include #if CG_HAS_XWAYLAND @@ -103,7 +106,7 @@ output_get_num(const struct cg_output *output) { struct cg_output *it; int count = 1; wl_list_for_each(it, &output->server->outputs, link) { - if(strcmp(output->wlr_output->name, it->wlr_output->name) == 0) { + if(strcmp(output->name, it->name) == 0) { return count; } ++count; @@ -111,33 +114,64 @@ output_get_num(const struct cg_output *output) { return -1; } +struct wlr_box +output_get_layout_box(struct cg_output *output) { + struct wlr_box box; + wlr_output_layout_get_box(output->server->output_layout, output->wlr_output, + &box); + if(!output->destroyed && !wlr_box_empty(&box)) { + output->layout_box.x = box.x; + output->layout_box.y = box.y; + output->layout_box.width = box.width; + output->layout_box.height = box.height; + } + return output->layout_box; +} + static void output_destroy(struct cg_output *output) { struct cg_server *server = output->server; - char *outp_name = strdup(output->wlr_output->name); + char *outp_name = strdup(output->name); int outp_num = output_get_num(output); - wl_list_remove(&output->destroy.link); - wl_list_remove(&output->commit.link); - wl_list_remove(&output->frame.link); + if(output->destroyed == false) { + wl_list_remove(&output->destroy.link); + wl_list_remove(&output->commit.link); + wl_list_remove(&output->frame.link); + wlr_scene_output_destroy(output->scene_output); + output->scene_output = NULL; + } + output->destroyed = true; + enum output_role role = output->role; + if(role == OUTPUT_ROLE_PERMANENT) { + output->wlr_output = wlr_headless_add_output(server->headless_backend, + output->layout_box.width, + output->layout_box.height); + output->scene_output = + wlr_scene_output_create(server->scene, output->wlr_output); + struct wlr_output_layout_output *lo = + wlr_output_layout_add(server->output_layout, output->wlr_output, + output->layout_box.x, output->layout_box.y); + wlr_scene_output_layout_add_output(server->scene_output_layout, lo, + output->scene_output); - output_clear(output); + } else { - /*Important: due to unfortunate events, "workspace" and "output->workspace" - * have nothing in common. The former is the workspace of a single output, - * whereas the latter is the workspace of the outputs.*/ - for(unsigned int i = 0; i < server->nws; ++i) { - workspace_free(output->workspaces[i]); - } - free(output->workspaces); + output_clear(output); - free(output); + for(unsigned int i = 0; i < server->nws; ++i) { + workspace_free(output->workspaces[i]); + } + free(output->workspaces); + free(output->name); + free(output); + } if(outp_name != NULL) { ipc_send_event(server, "{\"event_name\":\"destroy_output\",\"output\":\"%s\"," - "\"output_id\":%d}", - outp_name, outp_num); + "\"output_id\":%d,\"permanent\":%d}", + outp_name, outp_num, role == OUTPUT_ROLE_PERMANENT); free(outp_name); } else { wlr_log(WLR_ERROR, @@ -154,6 +188,27 @@ handle_output_destroy(struct wl_listener *listener, void *data) { output_destroy(output); } +void +handle_output_gamma_control_set_gamma(struct wl_listener *listener, + void *data) { + struct cg_server *server = + wl_container_of(listener, server, gamma_control_set_gamma); + const struct wlr_gamma_control_manager_v1_set_gamma_event *event = data; + + struct wlr_gamma_control_v1 *gamma_control = + wlr_gamma_control_manager_v1_get_control(server->gamma_control, + event->output); + + struct wlr_output_state pending = {0}; + wlr_gamma_control_v1_apply(gamma_control, &pending); + if(!wlr_output_test_state(event->output, &pending)) { + wlr_gamma_control_v1_send_failed_and_destroy(gamma_control); + } else { + wlr_output_commit_state(event->output, &pending); + wlr_output_schedule_frame(event->output); + } +} + static void handle_output_frame(struct wl_listener *listener, void *data) { struct cg_output *output = wl_container_of(listener, output, frame); @@ -257,11 +312,24 @@ output_apply_config(struct cg_server *server, struct cg_output *output, struct cg_output_config *config) { struct wlr_output *wlr_output = output->wlr_output; - if(output->wlr_output->enabled) { - wlr_output_layout_remove(server->output_layout, wlr_output); + struct wlr_box prev_box; + prev_box.x = output->layout_box.x; + prev_box.y = output->layout_box.y; + prev_box.width = output->layout_box.width; + prev_box.height = output->layout_box.height; + bool prio_changed = false; + if(config->role != OUTPUT_ROLE_DEFAULT) { + output->role = config->role; + if((output->role == OUTPUT_ROLE_PERIPHERAL) && + (output->destroyed == true)) { + output_destroy(output); + wlr_output_destroy(wlr_output); + return; + } } if(config->priority != -1) { + prio_changed = (output->priority != config->priority); output->priority = config->priority; } @@ -282,18 +350,57 @@ output_apply_config(struct cg_server *server, struct cg_output *output, wlr_output_commit(wlr_output); return; } - struct wlr_output_layout_output *lo = wlr_output_layout_add( - server->output_layout, wlr_output, config->pos.x, config->pos.y); - wlr_scene_output_layout_add_output(server->scene_output_layout, lo, - output->scene_output); - /* Since the size of the output may have changed, we - * reinitialize all workspaces with a fullscreen layout */ - for(unsigned int i = 0; i < output->server->nws; ++i) { - output_make_workspace_fullscreen(output, i); + if(wlr_box_empty(&output->layout_box)) { + struct wlr_output_layout_output *lo = + wlr_output_layout_add(server->output_layout, wlr_output, + config->pos.x, config->pos.y); + wlr_scene_output_layout_add_output(server->scene_output_layout, lo, + output->scene_output); + } else { + wlr_scene_output_set_position(output->scene_output, config->pos.x, + config->pos.y); } - } else { + if(output->workspaces != NULL) { + wlr_output_layout_get_box(server->output_layout, output->wlr_output, + &output->layout_box); + /* Since the size of the output may have changed, we + * reinitialize all workspaces with a fullscreen layout */ + if(output->layout_box.width != prev_box.width || + output->layout_box.height != prev_box.height) { + for(unsigned int i = 0; i < output->server->nws; ++i) { + output_make_workspace_fullscreen(output, i); + } + } + if(prev_box.x != output->layout_box.x || + prev_box.y != output->layout_box.y) { + for(unsigned int i = 0; i < server->nws; ++i) { + struct cg_workspace *ws = output->workspaces[i]; + bool first = true; + for(struct cg_tile *tile = ws->focused_tile; + first || output->workspaces[i]->focused_tile != tile; + tile = tile->next) { + first = false; + if(tile->view != NULL) { + wlr_scene_node_set_position( + &tile->view->scene_tree->node, + tile->view->ox + output->layout_box.x, + tile->view->oy + output->layout_box.y); + } + } + } + } + } + } else if(wlr_box_empty(&output->layout_box)) { + wlr_output_layout_add_auto(server->output_layout, wlr_output); + // The following two lines make sure that the output is "manually" + // managed, so that its position doesn't change anymore in the + // future. + wlr_output_layout_get_box(server->output_layout, output->wlr_output, + &output->layout_box); + wlr_output_layout_remove(server->output_layout, output->wlr_output); struct wlr_output_layout_output *lo = - wlr_output_layout_add_auto(server->output_layout, wlr_output); + wlr_output_layout_add(server->output_layout, output->wlr_output, + output->layout_box.x, output->layout_box.y); wlr_scene_output_layout_add_output(server->scene_output_layout, lo, output->scene_output); @@ -311,8 +418,10 @@ output_apply_config(struct cg_server *server, struct cg_output *output, wlr_output_enable(wlr_output, false); wlr_output_commit(wlr_output); } else { - wl_list_remove(&output->link); - output_insert(server, output); + if(prio_changed) { + wl_list_remove(&output->link); + output_insert(server, output); + } wlr_output_enable(wlr_output, true); wlr_output_commit(wlr_output); } @@ -329,9 +438,8 @@ output_apply_config(struct cg_server *server, struct cg_output *output, output->bg = wlr_scene_rect_create( &scene_output->scene->tree, output->wlr_output->width, output->wlr_output->height, server->bg_color); - struct wlr_box box; - wlr_output_layout_get_box(server->output_layout, output->wlr_output, &box); - wlr_scene_node_set_position(&output->bg->node, box.x, box.y); + wlr_scene_node_set_position(&output->bg->node, scene_output->x, + scene_output->y); wlr_scene_node_lower_to_bottom(&output->bg->node); } @@ -344,6 +452,7 @@ empty_output_config(void) { } cfg->status = OUTPUT_DEFAULT; + cfg->role = OUTPUT_ROLE_DEFAULT; cfg->pos.x = -1; cfg->pos.y = -1; cfg->pos.width = -1; @@ -367,6 +476,11 @@ merge_output_configs(struct cg_output_config *cfg1, } else { out_cfg->status = cfg1->status; } + if(cfg1->role == out_cfg->role) { + out_cfg->role = cfg2->role; + } else { + out_cfg->role = cfg1->role; + } if(cfg1->pos.x == out_cfg->pos.x) { out_cfg->pos.x = cfg2->pos.x; out_cfg->pos.y = cfg2->pos.y; @@ -415,7 +529,7 @@ output_configure(struct cg_server *server, struct cg_output *output) { struct cg_output_config *tot_config = empty_output_config(); struct cg_output_config *config; wl_list_for_each(config, &server->output_config, link) { - if(strcmp(config->output_name, output->wlr_output->name) == 0) { + if(strcmp(config->output_name, output->name) == 0) { if(tot_config == NULL) { return; } @@ -459,9 +573,9 @@ handle_output_commit(struct wl_listener *listener, void *data) { void output_make_workspace_fullscreen(struct cg_output *output, int ws) { struct cg_server *server = output->server; - struct cg_view *current_view = seat_get_focus(server->seat); + struct cg_view *current_view = output->workspaces[ws]->focused_tile->view; - if(current_view == NULL || ws != output->curr_workspace) { + if(current_view == NULL) { struct cg_view *it = NULL; wl_list_for_each(it, &output->workspaces[ws]->views, link) { if(view_is_visible(it)) { @@ -472,7 +586,7 @@ output_make_workspace_fullscreen(struct cg_output *output, int ws) { } workspace_free_tiles(output->workspaces[ws]); - if(full_screen_workspace_tiles(server->output_layout, output->wlr_output, + if(full_screen_workspace_tiles(server->output_layout, output->workspaces[ws], &server->tiles_curr_id) != 0) { wlr_log(WLR_ERROR, "Failed to allocate space for fullscreen workspace"); @@ -484,19 +598,18 @@ output_make_workspace_fullscreen(struct cg_output *output, int ws) { it_view->tile = output->workspaces[ws]->focused_tile; } - if(ws == output->curr_workspace) { + workspace_tile_update_view(output->workspaces[ws]->focused_tile, + current_view); + if((ws == output->curr_workspace) && (output == server->curr_output)) { seat_set_focus(server->seat, current_view); } } -#if CG_HAS_FANALYZE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" -#endif void handle_new_output(struct wl_listener *listener, void *data) { struct cg_server *server = wl_container_of(listener, server, new_output); struct wlr_output *wlr_output = data; + wlr_output_enable(wlr_output, true); if(!wlr_output_init_render(wlr_output, server->allocator, server->renderer)) { @@ -504,59 +617,102 @@ handle_new_output(struct wl_listener *listener, void *data) { return; } - struct cg_output *output = calloc(1, sizeof(struct cg_output)); - output->scene_output = wlr_scene_output_create(server->scene, wlr_output); + struct cg_output *ito; + bool reinit = false; + struct cg_output *output = NULL; + wl_list_for_each(ito, &server->outputs, link) { + if((strcmp(ito->name, wlr_output->name) == 0) && (ito->destroyed)) { + reinit = true; + output = ito; + } + } + if(reinit) { + wlr_output_layout_remove(server->output_layout, output->wlr_output); + wlr_scene_output_destroy(output->scene_output); + } else { + output = calloc(1, sizeof(struct cg_output)); + } if(!output) { wlr_log(WLR_ERROR, "Failed to allocate output"); return; } + output->scene_output = wlr_scene_output_create(server->scene, wlr_output); output->wlr_output = wlr_output; - output->server = server; - output->last_scanned_out_view = NULL; - - struct cg_output_priorities *it; - int prio = -1; - wl_list_for_each(it, &server->output_priorities, link) { - if(strcmp(output->wlr_output->name, it->ident) == 0) { - prio = it->priority; - } - } - output->priority = prio; - wlr_output_set_transform(wlr_output, WL_OUTPUT_TRANSFORM_NORMAL); - output->workspaces = NULL; + output->destroyed = false; - wl_list_init(&output->messages); + if(!reinit) { + output->server = server; + output->name = strdup(wlr_output->name); - if(!wlr_xcursor_manager_load(server->seat->xcursor_manager, - wlr_output->scale)) { - wlr_log(WLR_ERROR, - "Cannot load XCursor theme for output '%s' with scale %f", - wlr_output->name, wlr_output->scale); - } + struct cg_output_priorities *it; + int prio = -1; + wl_list_for_each(it, &server->output_priorities, link) { + if(strcmp(output->name, it->ident) == 0) { + prio = it->priority; + } + } + output->priority = prio; + wlr_output_set_transform(wlr_output, WL_OUTPUT_TRANSFORM_NORMAL); + output->workspaces = NULL; - output_insert(server, output); - output_configure(server, output); + wl_list_init(&output->messages); - output->workspaces = malloc(server->nws * sizeof(struct cg_workspace *)); - for(unsigned int i = 0; i < server->nws; ++i) { - output->workspaces[i] = full_screen_workspace(output); - if(!output->workspaces[i]) { - wlr_log(WLR_ERROR, "Failed to allocate workspaces for output"); - return; + if(!wlr_xcursor_manager_load(server->seat->xcursor_manager, + wlr_output->scale)) { + wlr_log(WLR_ERROR, + "Cannot load XCursor theme for output '%s' with scale %f", + output->name, wlr_output->scale); } - output->workspaces[i]->num = i; - wl_list_init(&output->workspaces[i]->views); - wl_list_init(&output->workspaces[i]->unmanaged_views); - } - wlr_scene_node_raise_to_top(&output->workspaces[0]->scene->node); - workspace_focus(output, 0); + output_insert(server, output); + // This is duplicated here only as a cue for the static analysis tool + output->destroyed = false; + output_configure(server, output); + wlr_output_layout_get_box(server->output_layout, output->wlr_output, + &output->layout_box); + + output->workspaces = + malloc(server->nws * sizeof(struct cg_workspace *)); + for(unsigned int i = 0; i < server->nws; ++i) { + output->workspaces[i] = full_screen_workspace(output); + if(!output->workspaces[i]) { + wlr_log(WLR_ERROR, "Failed to allocate workspaces for output"); + return; + } + output->workspaces[i]->num = i; + wl_list_init(&output->workspaces[i]->views); + wl_list_init(&output->workspaces[i]->unmanaged_views); + } + + wlr_scene_node_raise_to_top(&output->workspaces[0]->scene->node); + workspace_focus(output, 0); - /* We are the first output. Set the current output to this one. */ - if(server->curr_output == NULL) { - server->curr_output = output; + /* We are the first output. Set the current output to this one. */ + if(server->curr_output == NULL) { + server->curr_output = output; + } + } else { + struct wlr_output_layout_output *lo = + wlr_output_layout_add(server->output_layout, wlr_output, + output->layout_box.x, output->layout_box.y); + wlr_scene_output_layout_add_output(server->scene_output_layout, lo, + output->scene_output); + + struct wlr_output_mode *preferred_mode = + wlr_output_preferred_mode(wlr_output); + if(preferred_mode) { + wlr_output_set_mode(wlr_output, preferred_mode); + } + wlr_output_set_transform(wlr_output, WL_OUTPUT_TRANSFORM_NORMAL); + wlr_scene_output_set_position( + output->scene_output, output->layout_box.x, output->layout_box.y); + wlr_output_enable(wlr_output, true); + wlr_output_commit(wlr_output); + output_configure(server, output); + output_get_layout_box(output); } + wlr_cursor_set_xcursor(server->seat->cursor, server->seat->xcursor_manager, DEFAULT_XCURSOR); wlr_cursor_warp(server->seat->cursor, NULL, 0, 0); @@ -570,10 +726,7 @@ handle_new_output(struct wl_listener *listener, void *data) { ipc_send_event(server, "{\"event_name\":\"new_output\",\"output\":\"%s\",\"output_" - "id\":%d,\"priority\":%d}", - output->wlr_output->name, output_get_num(output), - output->priority); + "id\":%d,\"priority\":%d,\"restart\":%d}", + output->name, output_get_num(output), output->priority, + reinit); } -#if CG_HAS_FANALYZE -#pragma GCC diagnostic pop -#endif diff --git a/output.h b/output.h index c1d4853..573c259 100644 --- a/output.h +++ b/output.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_OUTPUT_H @@ -12,6 +12,12 @@ struct cg_view; struct wlr_output; struct wlr_surface; +enum output_role { + OUTPUT_ROLE_PERIPHERAL, + OUTPUT_ROLE_PERMANENT, + OUTPUT_ROLE_DEFAULT +}; + struct cg_output { struct cg_server *server; struct wlr_output *wlr_output; @@ -23,9 +29,12 @@ struct cg_output { struct wl_listener frame; struct cg_workspace **workspaces; struct wl_list messages; + struct wlr_box layout_box; int curr_workspace; int priority; - struct cg_view *last_scanned_out_view; + enum output_role role; + bool destroyed; + char *name; struct wl_list link; // cg_server::outputs }; @@ -40,6 +49,7 @@ enum output_status { OUTPUT_ENABLE, OUTPUT_DISABLE, OUTPUT_DEFAULT }; struct cg_output_config { enum output_status status; + enum output_role role; struct wlr_box pos; char *output_name; float refresh_rate; @@ -53,7 +63,8 @@ typedef void (*cg_surface_iterator_func_t)(struct cg_output *output, struct wlr_surface *surface, struct wlr_box *box, void *user_data); - +struct wlr_box +output_get_layout_box(struct cg_output *output); void handle_new_output(struct wl_listener *listener, void *data); void @@ -64,4 +75,8 @@ void output_make_workspace_fullscreen(struct cg_output *output, int ws); int output_get_num(const struct cg_output *output); +void +handle_output_gamma_control_set_gamma(struct wl_listener *listener, void *data); +void +output_insert(struct cg_server *server, struct cg_output *output); #endif diff --git a/pango.c b/pango.c index 3af6f7f..3006f5b 100644 --- a/pango.c +++ b/pango.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #include diff --git a/pango.h b/pango.h index 53a78cc..5aa6c8d 100644 --- a/pango.h +++ b/pango.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef _SWAY_PANGO_H diff --git a/parse.c b/parse.c index c163b3a..72d8295 100644 --- a/parse.c +++ b/parse.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200812L @@ -543,6 +543,10 @@ parse_output_config_keyword(char *key_str, enum output_status *status) { *status = OUTPUT_DEFAULT; } else if(strcmp(key_str, "enable") == 0) { *status = OUTPUT_ENABLE; + } else if(strcmp(key_str, "permanent") == 0) { + *status = OUTPUT_DEFAULT; + } else if(strcmp(key_str, "peripheral") == 0) { + *status = OUTPUT_DEFAULT; } else if(strcmp(key_str, "disable") == 0) { *status = OUTPUT_DISABLE; } else { @@ -566,6 +570,7 @@ parse_output_config(char **saveptr, char **errstr) { cfg->priority = -1; cfg->scale = -1; cfg->angle = -1; + cfg->role = OUTPUT_ROLE_DEFAULT; char *name = strtok_r(NULL, " ", saveptr); if(name == NULL) { *errstr = @@ -574,8 +579,9 @@ parse_output_config(char **saveptr, char **errstr) { } char *key_str = strtok_r(NULL, " ", saveptr); if(parse_output_config_keyword(key_str, &(cfg->status)) != 0) { - *errstr = log_error("Expected keyword \"pos\", \"prio\", \"enable\" or " - "\"disable\" in output configuration for output %s", + *errstr = log_error("Expected keyword \"pos\", \"prio\", \"enable\", " + "\"disable\", \"permanent\" or \"peripheral\" in " + "output configuration for output %s", name); goto error; } @@ -622,6 +628,18 @@ parse_output_config(char **saveptr, char **errstr) { return cfg; } + if(strcmp(key_str, "peripheral") == 0) { + cfg->output_name = strdup(name); + cfg->role = OUTPUT_ROLE_PERIPHERAL; + return cfg; + } + + if(strcmp(key_str, "permanent") == 0) { + cfg->output_name = strdup(name); + cfg->role = OUTPUT_ROLE_PERMANENT; + return cfg; + } + cfg->pos.x = parse_uint(saveptr, " "); if(cfg->pos.x < 0) { *errstr = log_error( @@ -702,6 +720,7 @@ parse_message_config(char **saveptr, char **errstr) { cfg->fg_color[0] = -1; cfg->display_time = -1; cfg->font = NULL; + cfg->anchor = CG_MESSAGE_NOPT; char *setting = strtok_r(NULL, " ", saveptr); if(setting == NULL) { @@ -745,6 +764,22 @@ parse_message_config(char **saveptr, char **errstr) { goto error; } } + } else if(strcmp(setting, "anchor") == 0) { + char *anchors[] = {"top_left", "top_center", "top_right", + "bottom_left", "bottom_center", "bottom_right", + "center"}; + for(int i = 0; i < 7; ++i) { + if(strcmp(*saveptr, anchors[i]) == 0) { + cfg->anchor = i; + break; + } + } + if(cfg->anchor == CG_MESSAGE_NOPT) { + *errstr = + log_error("Error parsing command \"configure_message anchor\", " + "the given anchor value is not a valid option"); + goto error; + } } else { *errstr = log_error("Invalid option to command \"configure_message\""); goto error; diff --git a/parse.h b/parse.h index 2949315..d78df94 100644 --- a/parse.h +++ b/parse.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef PARSE_H diff --git a/release-non-auto-checks/Bugs.md b/release-non-auto-checks/Bugs.md index 16e03cd..b196533 100644 --- a/release-non-auto-checks/Bugs.md +++ b/release-non-auto-checks/Bugs.md @@ -1,2 +1,2 @@ -2.2.3 -2023-12-05 +2.3.0 +2024-01-26 diff --git a/release-non-auto-checks/FAQ.md b/release-non-auto-checks/FAQ.md index 16e03cd..b196533 100644 --- a/release-non-auto-checks/FAQ.md +++ b/release-non-auto-checks/FAQ.md @@ -1,2 +1,2 @@ -2.2.3 -2023-12-05 +2.3.0 +2024-01-26 diff --git a/release-non-auto-checks/SECURITY.md b/release-non-auto-checks/SECURITY.md index 16e03cd..b196533 100644 --- a/release-non-auto-checks/SECURITY.md +++ b/release-non-auto-checks/SECURITY.md @@ -1,2 +1,2 @@ -2.2.3 -2023-12-05 +2.3.0 +2024-01-26 diff --git a/release-non-auto-checks/WLR_XDG_VERSION b/release-non-auto-checks/WLR_XDG_VERSION index 16e03cd..b196533 100644 --- a/release-non-auto-checks/WLR_XDG_VERSION +++ b/release-non-auto-checks/WLR_XDG_VERSION @@ -1,2 +1,2 @@ -2.2.3 -2023-12-05 +2.3.0 +2024-01-26 diff --git a/release-non-auto-checks/acknowledge-contributors b/release-non-auto-checks/acknowledge-contributors index 16e03cd..b196533 100644 --- a/release-non-auto-checks/acknowledge-contributors +++ b/release-non-auto-checks/acknowledge-contributors @@ -1,2 +1,2 @@ -2.2.3 -2023-12-05 +2.3.0 +2024-01-26 diff --git a/release-non-auto-checks/archwiki b/release-non-auto-checks/archwiki new file mode 100644 index 0000000..b196533 --- /dev/null +++ b/release-non-auto-checks/archwiki @@ -0,0 +1,2 @@ +2.3.0 +2024-01-26 diff --git a/release-non-auto-checks/changelog-major-minor b/release-non-auto-checks/changelog-major-minor index 16e03cd..b196533 100644 --- a/release-non-auto-checks/changelog-major-minor +++ b/release-non-auto-checks/changelog-major-minor @@ -1,2 +1,2 @@ -2.2.3 -2023-12-05 +2.3.0 +2024-01-26 diff --git a/release-non-auto-checks/internal-wiki b/release-non-auto-checks/internal-wiki index 16e03cd..b196533 100644 --- a/release-non-auto-checks/internal-wiki +++ b/release-non-auto-checks/internal-wiki @@ -1,2 +1,2 @@ -2.2.3 -2023-12-05 +2.3.0 +2024-01-26 diff --git a/release-non-auto-checks/release-note b/release-non-auto-checks/release-note index 16e03cd..b196533 100644 --- a/release-non-auto-checks/release-note +++ b/release-non-auto-checks/release-note @@ -1,2 +1,2 @@ -2.2.3 -2023-12-05 +2.3.0 +2024-01-26 diff --git a/release-non-auto-checks/reproducibility-checked b/release-non-auto-checks/reproducibility-checked index 16e03cd..b196533 100644 --- a/release-non-auto-checks/reproducibility-checked +++ b/release-non-auto-checks/reproducibility-checked @@ -1,2 +1,2 @@ -2.2.3 -2023-12-05 +2.3.0 +2024-01-26 diff --git a/release-non-auto-checks/security-to-man-page-info-transfer b/release-non-auto-checks/security-to-man-page-info-transfer index 16e03cd..b196533 100644 --- a/release-non-auto-checks/security-to-man-page-info-transfer +++ b/release-non-auto-checks/security-to-man-page-info-transfer @@ -1,2 +1,2 @@ -2.2.3 -2023-12-05 +2.3.0 +2024-01-26 diff --git a/release-non-auto-checks/version-restrictions b/release-non-auto-checks/version-restrictions index 16e03cd..b196533 100644 --- a/release-non-auto-checks/version-restrictions +++ b/release-non-auto-checks/version-restrictions @@ -1,2 +1,2 @@ -2.2.3 -2023-12-05 +2.3.0 +2024-01-26 diff --git a/scripts/adjust-epoch b/scripts/adjust-epoch index 362c840..14b935c 100755 --- a/scripts/adjust-epoch +++ b/scripts/adjust-epoch @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT if [[ -n ${MESON_SOURCE_ROOT} ]] diff --git a/scripts/create-release-artefacts b/scripts/create-release-artefacts index 4b16167..05212a5 100755 --- a/scripts/create-release-artefacts +++ b/scripts/create-release-artefacts @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT if [[ -n ${MESON_SOURCE_ROOT} ]] diff --git a/scripts/create-signatures b/scripts/create-signatures index 3292374..958825f 100755 --- a/scripts/create-signatures +++ b/scripts/create-signatures @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT if [[ -n ${MESON_SOURCE_ROOT} ]] diff --git a/scripts/fuzz b/scripts/fuzz index 7f227ec..e90e17a 100755 --- a/scripts/fuzz +++ b/scripts/fuzz @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT readonly fuzzing_corpus="${1}" diff --git a/scripts/git-tag b/scripts/git-tag index bd8e541..4b5dbbc 100755 --- a/scripts/git-tag +++ b/scripts/git-tag @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT readonly gpg_id="${1}" diff --git a/scripts/install-development-environment b/scripts/install-development-environment old mode 100644 new mode 100755 index 1b71ce5..b799eec --- a/scripts/install-development-environment +++ b/scripts/install-development-environment @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT sudo pacman -Syu --noconfirm git grep sed xorg-xev meson ninja clang gcc shellcheck jq openbsd-netcat gnupg binutils alacritty wlroots wayland wayland-protocols libxkbcommon cairo pango fontconfig libinput libevdev pkgconf scdoc systemd-libs # systemd-libs is included because of libudev diff --git a/scripts/output-hashes b/scripts/output-hashes index cf7cacf..d18088b 100755 --- a/scripts/output-hashes +++ b/scripts/output-hashes @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT if [[ -n ${MESON_SOURCE_ROOT} ]] diff --git a/scripts/set-version b/scripts/set-version index 3ee035c..3f7875e 100755 --- a/scripts/set-version +++ b/scripts/set-version @@ -1,9 +1,7 @@ #!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT -# TODO man pages - if [[ -n ${MESON_SOURCE_ROOT} ]] then # shellcheck disable=2164 diff --git a/seat.c b/seat.c index 80206e9..a011251 100644 --- a/seat.c +++ b/seat.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200812L @@ -95,7 +95,7 @@ new_touch(struct cg_seat *seat, struct cg_input_device *input_device) { if(wlr_touch->output_name != NULL) { struct cg_output *output; wl_list_for_each(output, &seat->server->outputs, link) { - if(strcmp(wlr_touch->output_name, output->wlr_output->name) == 0) { + if(strcmp(wlr_touch->output_name, output->name) == 0) { wlr_cursor_map_input_to_output(seat->cursor, device, output->wlr_output); break; @@ -133,8 +133,7 @@ new_pointer(struct cg_seat *seat, struct cg_input_device *input_device) { if(wlr_pointer->output_name != NULL) { struct cg_output *output; wl_list_for_each(output, &seat->server->outputs, link) { - if(strcmp(wlr_pointer->output_name, output->wlr_output->name) == - 0) { + if(strcmp(wlr_pointer->output_name, output->name) == 0) { wlr_cursor_map_input_to_output(seat->cursor, device, output->wlr_output); break; @@ -732,35 +731,39 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { break; } } - struct cg_tile *c_tile; - bool first = true; - for(c_tile = cg_outp->workspaces[cg_outp->curr_workspace]->focused_tile; - first || - c_tile != cg_outp->workspaces[cg_outp->curr_workspace]->focused_tile; - c_tile = c_tile->next) { - first = false; - double ox = seat->cursor->x, oy = seat->cursor->y; - wlr_output_layout_output_coords(seat->server->output_layout, c_outp, - &ox, &oy); - if(c_tile->tile.x <= ox && c_tile->tile.y <= oy && - c_tile->tile.x + c_tile->tile.width >= ox && - c_tile->tile.y + c_tile->tile.height >= oy) { - break; + if(c_outp) { + struct cg_tile *c_tile; + bool first = true; + for(c_tile = cg_outp->workspaces[cg_outp->curr_workspace]->focused_tile; + first || + c_tile != + cg_outp->workspaces[cg_outp->curr_workspace]->focused_tile; + c_tile = c_tile->next) { + first = false; + double ox = seat->cursor->x, oy = seat->cursor->y; + wlr_output_layout_output_coords(seat->server->output_layout, c_outp, + &ox, &oy); + if(c_tile->tile.x <= ox && c_tile->tile.y <= oy && + c_tile->tile.x + c_tile->tile.width >= ox && + c_tile->tile.y + c_tile->tile.height >= oy) { + break; + } } + if(seat->cursor_tile != NULL && seat->cursor_tile != c_tile && + seat->server->running) { + ipc_send_event( + seat->server, + "{\"event_name\":\"cursor_switch_tile\",\"old_output\":" + "\"%s\",\"old_output_id\":%d," + "\"old_tile\":%d,\"new_output\":\"%s\",\"new_output_" + "id\":%d,\"new_tile\":%d}", + seat->cursor_tile->workspace->output->name, + output_get_num(seat->cursor_tile->workspace->output), + seat->cursor_tile->id, c_outp->name, output_get_num(cg_outp), + c_tile->id); + } + seat->cursor_tile = c_tile; } - if(seat->cursor_tile != NULL && seat->cursor_tile != c_tile && - seat->server->running) { - ipc_send_event(seat->server, - "{\"event_name\":\"cursor_switch_tile\",\"old_output\":" - "\"%s\",\"old_output_id\":%d," - "\"old_tile\":%d,\"new_output\":\"%s\",\"new_output_" - "id\":%d,\"new_tile\":%d}", - seat->cursor_tile->workspace->output->wlr_output->name, - output_get_num(seat->cursor_tile->workspace->output), - seat->cursor_tile->id, c_outp->name, - output_get_num(cg_outp), c_tile->id); - } - seat->cursor_tile = c_tile; } static void @@ -915,6 +918,7 @@ handle_destroy(struct wl_listener *listener, void *_data) { wl_list_remove(&seat->request_set_cursor.link); wl_list_remove(&seat->request_set_selection.link); wl_list_remove(&seat->request_set_primary_selection.link); + seat->server->seat = NULL; free(seat); } @@ -1095,9 +1099,8 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { wlr_scene_node_raise_to_top(&view->scene_tree->node); process_cursor_motion(seat, -1); - struct wlr_box box; - wlr_output_layout_get_box(server->output_layout, - view->workspace->output->wlr_output, &box); - wlr_scene_node_set_position(&view->workspace->output->bg->node, box.x, - box.y); + wlr_scene_node_set_position( + &view->workspace->output->bg->node, + output_get_layout_box(view->workspace->output).x, + output_get_layout_box(view->workspace->output).y); } diff --git a/seat.h b/seat.h index 74f4092..135c06a 100644 --- a/seat.h +++ b/seat.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_SEAT_H diff --git a/server.c b/server.c index c50f528..98c7630 100644 --- a/server.c +++ b/server.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L @@ -43,8 +43,7 @@ server_show_info(struct cg_server *server) { return NULL; } output_str_tmp = output_str; - output_str = malloc_vsprintf("%s\t * %s\n", output_str, - output->wlr_output->name); + output_str = malloc_vsprintf("%s\t * %s\n", output_str, output->name); free(output_str_tmp); } char *input_str = strdup(""), *input_str_tmp; diff --git a/server.h b/server.h index 0c067ec..3224174 100644 --- a/server.h +++ b/server.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_SERVER_H @@ -29,6 +29,8 @@ struct cg_server { struct wlr_idle_notifier_v1 *idle; struct wlr_idle_inhibit_manager_v1 *idle_inhibit_v1; struct wl_listener new_idle_inhibitor_v1; + struct wlr_gamma_control_manager_v1 *gamma_control; + struct wl_listener gamma_control_set_gamma; struct wl_list inhibitors; struct wlr_output_layout *output_layout; @@ -38,6 +40,7 @@ struct cg_server { struct cg_output *curr_output; struct wl_listener new_output; struct wl_list output_priorities; + struct wlr_backend *headless_backend; struct wlr_session *session; struct wlr_renderer *renderer; diff --git a/signatures/2.2.3-cagebreak-config.5.sig b/signatures/2.2.3-cagebreak-config.5.sig new file mode 100644 index 0000000000000000000000000000000000000000..6d7f6c16507165c9ac9b5646e45cb4cc3a89863b GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%dO=&HxGt5J?I6 zOsG4!XG8W6|9R#;J{FE-UT8#I!Fi4#zi*ov9Xy@$5_IOwHC)DCP)s(==UVe6N7@ z7-A^-dEBpXnVsr`4n6aH48XT2AyHl2pVYRfFaF(bzfgb5CP>9$GN1&xC*(lsKc$ES zs%PuSW{ZB7f7oK6icaf23!q$wo7AdmkJ8aL2E@?F2594cy;Bn5~L z9(UAzOi$oHQJh|t!#oTPbMGoOZ^%H@=|cd#EU(M^3U*H3e9_{g{BV#!>42q+@7Wxi}6Hzo4QkhM=B3~=^{TsW09d;k=38L|LYbj z1!=3-gW5s4#~j8OX3#|G#e)MUguD-d$ATD;!Z5iJ0K4(!s?r{__=2_g72L z?`g>X^*N-@l^ncjW8n9PqAzR}vsQF-1=>w_+i&?Sy88qG&0dbXVAB?;Pby!`eiwUBN@f;NyKrXVlUf?VnplxxC=W^W_Zg+WAns( zFor@FIpAV*0laHJ%ILoX*MD55X=+$Zn3=->a9yE$BwCpc6jSY57l9Y~B;!p=jC522 z7h9{U8HL#aL&CA)`KAkQj5mm=SosFH8@H_a{Q`~Uy| literal 0 HcmV?d00001 diff --git a/signatures/2.2.3-cagebreak.1.sig b/signatures/2.2.3-cagebreak.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..14ac7ab7fd60b8337eaa18e060f7a24402925528 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%dO=%>W7s5J?I6 zOsG4!XL#rj{T+Al-oPBN+x!MHM~QdkHzBr|Cl+us_ro^WM3!tDhfsBw7Pq%1Z{RD62N4N=i9+{y)3(Ru$V?xv1!7mfQc zC$)a&YY~(X8+6uKax?zdKvEm$?XN0+!~nA+>4rgX2FGfWUVr~jg!oq%fFplfE=b^F z*E|X$ABEacp-D>5QmMs>^C6Kt%bZKs7tqA@eZhm@7mF-$$2nRbtUkK-UAVyflBeE9)=j4Yx^^blg0G{qp7&RP?Tv#W249hQ1 z;a&i5R!X|YVS?xn#d0KHbp+uZ^eJiDp=DK7Q8q&K9V9}>7lfH+!()^ zhVi<3>Oy_K@#g6CBoJ+moJ(*_iX~jCgMSc+nVn=Xw^uft*T^QSAPhrD>@L20qNDU4 ztoB5mA&Wu>syLrBc^DsmQiQ@QL)6zpT7!BG>>{O|HFtXgh)1Ps5ZqLl)Cx&OS1)v+ z86sR8$66K)Dqhg=5(4#f`GiL&3yh2z0{z#Pk)7X@=tDjJ_J`^&YaK-^$7k{&2ct;Q Er@2=MA^-pY literal 0 HcmV?d00001 diff --git a/signatures/2.2.3-cagebreak.sig b/signatures/2.2.3-cagebreak.sig new file mode 100644 index 0000000000000000000000000000000000000000..b06130553f46759a6b0c15d2ec5e4a7f3fe3714d GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%dO=%>W7s5J?I6 zOsG4!XRMG9{S^4?G%^Y3m5el0Q_7oaILK}lji>EKqg2qNLmPHp`AzALIN3h@;a~B) zymaY@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Q@QL)6zpT7!BG>>{O|HFtXgh)1Ps5ZqLl)Cx&OS1)v+ z86sR8$66K)Dqhg=5(4#f`GiL&3yh2z0{z#Pk)7X@=tDjJ_J`^&YaK-^$7k{&2ct;Q Er@2=MA^-pY diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index b06130553f46759a6b0c15d2ec5e4a7f3fe3714d..e106209e41a6bc13a33cc9aa55e3b69e7b2586f4 100644 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*fj3?c-(R61$^wxVt5(TqTjC^AS0%fy{!~hBj5JeIN zvr>$FV`0b-|6sTKs%81)qQ(2WTT;zI;D3i|(&bmgFIMKXHUUH#P8VWTQwxv31z{)GG*1|?@P=OqGu(-c||L}F3ukC8;C=2;C0-2qv zNyyrDjgI2;(Sjt${|gcD%cXlm69&36I+EXi|5cFyo(-51B$llX+QTcB>=yAin9pT! zWo#@SSY@vb6AYPts>DbiLtLY=fxFX%MI-4s;Wo9VgW^OuIDQY;Zd6Z2;!^Tx#X20~kzP7eKjm};|Ek*U% EY6-U&D*ylh literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%dO=%>W7s5J?I6 zOsG4!XRMG9{S^4?G%^Y3m5el0Q_7oaILK}lji>EKqg2qNLmPHp`AzALIN3h@;a~B) zymaY@9KZ9Z?6L?yxsZ1pU=68cL;~wowNV!k(}NRXx`~nO6O%vds-sG3-$iS`TqsdT zy69<@`z1%3|EV0;2c&?;WEN~;S=m2 z?~wRpF((7yAP7A+^P8Iwf*BC^zzRW1uK-TzJJQ?z8i%||)(5V~qx+VB?pRqYq0@!B zIo-vd&QOv|KoOWnF*@AlRmS2Vrdh0b@5a>H^Utb8 CONFIGPATH ) quit diff --git a/example_scripts/cb_script_header.sh b/test/testing-configurations/cb_script_header.sh similarity index 89% rename from example_scripts/cb_script_header.sh rename to test/testing-configurations/cb_script_header.sh index 770f075..d844a0a 100644 --- a/example_scripts/cb_script_header.sh +++ b/test/testing-configurations/cb_script_header.sh @@ -1,7 +1,5 @@ -#!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT - named_pipe_send="$(mktemp -u)" named_pipe_recv="$(mktemp -u)" mkfifo "${named_pipe_send}" diff --git a/test/testing-configurations/config b/test/testing-configurations/config index 9925aec..268fe77 100644 --- a/test/testing-configurations/config +++ b/test/testing-configurations/config @@ -1,4 +1,4 @@ -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT exec (echo $CAGEBREAK_SOCKET > CONFIGPATH) quit diff --git a/test/testing-configurations/env-var-config b/test/testing-configurations/env-var-config index a769e73..8476149 100644 --- a/test/testing-configurations/env-var-config +++ b/test/testing-configurations/env-var-config @@ -1,4 +1,4 @@ -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT exec (echo "SUCCESS" > CONFIGPATH ) quit diff --git a/test/testing-configurations/my-scan-build b/test/testing-configurations/my-scan-build index 526f1dd..db3f3d0 100755 --- a/test/testing-configurations/my-scan-build +++ b/test/testing-configurations/my-scan-build @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT scan-build --status-bugs "$@" diff --git a/test/versions b/test/versions index b408c71..66b6d11 100644 --- a/test/versions +++ b/test/versions @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors +# Copyright 2023 - 2024, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT readonly newversion="${1}" diff --git a/util.c b/util.c index f8c7a82..1f84bdc 100644 --- a/util.c +++ b/util.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #include diff --git a/util.h b/util.h index b509a00..b9a95ef 100644 --- a/util.h +++ b/util.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_UTIL_H diff --git a/view.c b/view.c index 69ee5fe..1d2d9c3 100644 --- a/view.c +++ b/view.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L @@ -80,11 +80,10 @@ void view_maximize(struct cg_view *view, struct cg_tile *tile) { view->ox = tile->tile.x; view->oy = tile->tile.y; - struct wlr_box box; - wlr_output_layout_get_box(view->server->output_layout, - view->workspace->output->wlr_output, &box); - wlr_scene_node_set_position(&view->scene_tree->node, view->ox + box.x, - view->oy + box.y); + wlr_scene_node_set_position( + &view->scene_tree->node, + view->ox + output_get_layout_box(view->workspace->output).x, + view->oy + output_get_layout_box(view->workspace->output).y); view->impl->maximize(view, tile->tile.width, tile->tile.height); view->tile = tile; wlr_scene_node_raise_to_top(&view->scene_tree->node); @@ -96,7 +95,7 @@ view_unmap(struct cg_view *view) { uint32_t id = view->id; uint32_t tile_id = 0; uint32_t ws = view->workspace->num; - char *output_name = view->workspace->output->wlr_output->name; + char *output_name = view->workspace->output->name; int output_id = output_get_num(view->workspace->output); pid_t pid = view->impl->get_pid(view); /* If the view is not mapped, do nothing */ @@ -170,11 +169,10 @@ view_map(struct cg_view *view, struct wlr_surface *surface, their own (x,y) coordinates in handle_wayland_surface_map. */ if(view->type == CG_XWAYLAND_VIEW && !xwayland_view_should_manage(view)) { wl_list_insert(&ws->unmanaged_views, &view->link); - struct wlr_box box; - wlr_output_layout_get_box(view->server->output_layout, - view->workspace->output->wlr_output, &box); - wlr_scene_node_set_position(&view->scene_tree->node, view->ox + box.x, - view->oy + box.y); + wlr_scene_node_set_position( + &view->scene_tree->node, + view->ox + output_get_layout_box(view->workspace->output).x, + view->oy + output_get_layout_box(view->workspace->output).y); } else #endif { @@ -192,8 +190,8 @@ view_map(struct cg_view *view, struct wlr_surface *surface, "{\"event_name\":\"view_map\",\"view_id\":%d,\"tile_id\":%d," "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d,\"view_pid\":%d}", view->id, tile_id, view->workspace->num + 1, - view->workspace->output->wlr_output->name, - output_get_num(view->workspace->output), view->impl->get_pid(view)); + view->workspace->output->name, output_get_num(view->workspace->output), + view->impl->get_pid(view)); } void diff --git a/view.h b/view.h index b9ec0a1..b2ff05d 100644 --- a/view.h +++ b/view.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_VIEW_H diff --git a/workspace.c b/workspace.c index 3f84c6f..7d93183 100644 --- a/workspace.c +++ b/workspace.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L @@ -29,13 +29,8 @@ workspace_tile_update_view(struct cg_tile *tile, struct cg_view *view) { } } -#if CG_HAS_FANALYZE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" -#endif int full_screen_workspace_tiles(struct wlr_output_layout *layout, - struct wlr_output *output, struct cg_workspace *workspace, uint32_t *tiles_curr_id) { workspace->focused_tile = calloc(1, sizeof(struct cg_tile)); @@ -47,18 +42,15 @@ full_screen_workspace_tiles(struct wlr_output_layout *layout, workspace->focused_tile->prev = workspace->focused_tile; workspace->focused_tile->tile.x = 0; workspace->focused_tile->tile.y = 0; - struct wlr_box output_box; - wlr_output_layout_get_box(layout, output, &output_box); - workspace->focused_tile->tile.width = output_box.width; - workspace->focused_tile->tile.height = output_box.height; + workspace->focused_tile->tile.width = + output_get_layout_box(workspace->output).width; + workspace->focused_tile->tile.height = + output_get_layout_box(workspace->output).height; workspace_tile_update_view(workspace->focused_tile, NULL); workspace->focused_tile->id = *tiles_curr_id; ++(*tiles_curr_id); return 0; } -#if CG_HAS_FANALYZE -#pragma GCC diagnostic pop -#endif struct cg_workspace * full_screen_workspace(struct cg_output *output) { @@ -72,16 +64,15 @@ full_screen_workspace(struct cg_output *output) { free(workspace); return NULL; } + workspace->output = output; workspace->server = output->server; workspace->num = -1; workspace->scene = wlr_scene_tree_create(&scene_output->scene->tree); - if(full_screen_workspace_tiles(output->server->output_layout, - output->wlr_output, workspace, + if(full_screen_workspace_tiles(output->server->output_layout, workspace, &output->server->tiles_curr_id) != 0) { free(workspace); return NULL; } - workspace->output = output; return workspace; } @@ -102,10 +93,10 @@ void workspace_free_tiles(struct cg_workspace *workspace) { workspace->focused_tile->prev->next = NULL; while(workspace->focused_tile != NULL) { - if(workspace->output->server->running && - workspace->output->server->seat->cursor_tile == - workspace->focused_tile) { - workspace->output->server->seat->cursor_tile = NULL; + if(workspace->server->seat != NULL && + (!workspace->output->server->running || + workspace->focused_tile == workspace->server->seat->cursor_tile)) { + workspace->server->seat->cursor_tile = NULL; } struct cg_tile *next = workspace->focused_tile->next; free(workspace->focused_tile); diff --git a/workspace.h b/workspace.h index b669cec..83b41a1 100644 --- a/workspace.h +++ b/workspace.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_WORKSPACE_H @@ -33,7 +33,6 @@ struct cg_workspace * full_screen_workspace(struct cg_output *output); int full_screen_workspace_tiles(struct wlr_output_layout *layout, - struct wlr_output *output, struct cg_workspace *workspace, uint32_t *tiles_curr_id); void diff --git a/xdg_shell.c b/xdg_shell.c index 79f322f..fa15ad0 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L @@ -53,10 +53,6 @@ xdg_decoration_handle_destroy(struct wl_listener *listener, void *data) { free(xdg_decoration); } -#if CG_HAS_FANALYZE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" -#endif static void xdg_decoration_handle_request_mode(struct wl_listener *listener, void *_data) { struct cg_xdg_decoration *xdg_decoration = @@ -67,21 +63,18 @@ xdg_decoration_handle_request_mode(struct wl_listener *listener, void *_data) { wlr_xdg_toplevel_decoration_v1_set_mode(xdg_decoration->wlr_decoration, mode); } -#if CG_HAS_FANALYZE -#pragma GCC diagnostic pop -#endif static void popup_unconstrain(struct cg_view *view, struct wlr_xdg_popup *popup) { struct wlr_box *popup_box = &popup->current.geometry; struct wlr_output_layout *output_layout = view->server->output_layout; - struct wlr_box view_output_box; - wlr_output_layout_get_box( - output_layout, view->workspace->output->wlr_output, &view_output_box); struct wlr_output *wlr_output = wlr_output_layout_output_at( - output_layout, view_output_box.x + view->ox + popup_box->x, - view_output_box.y + view->oy + popup_box->y); + output_layout, + output_get_layout_box(view->workspace->output).x + view->ox + + popup_box->x, + output_get_layout_box(view->workspace->output).y + view->oy + + popup_box->y); struct wlr_box output_box; wlr_output_layout_get_box(output_layout, wlr_output, &output_box); @@ -171,8 +164,9 @@ handle_xdg_shell_surface_request_fullscreen(struct wl_listener *listener, * they display in fullscreen mode, so we set it here. */ struct wlr_box layout_box; - wlr_output_layout_get_box(xdg_shell_view->view.server->output_layout, NULL, - &layout_box); + wlr_output_layout_get_box( + xdg_shell_view->view.server->output_layout, + xdg_shell_view->view.workspace->output->wlr_output, &layout_box); wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface->toplevel, layout_box.width, layout_box.height); diff --git a/xdg_shell.h b/xdg_shell.h index fd80b99..5f9456c 100644 --- a/xdg_shell.h +++ b/xdg_shell.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_XDG_SHELL_H diff --git a/xwayland.c b/xwayland.c index 21cc2ba..5755148 100644 --- a/xwayland.c +++ b/xwayland.c @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #include "config.h" @@ -96,13 +96,11 @@ maximize(struct cg_view *view, int width, int height) { } } - struct wlr_box output_box; - wlr_output_layout_get_box(view->server->output_layout, - view->server->curr_output->wlr_output, - &output_box); - wlr_xwayland_surface_configure(xwayland_view->xwayland_surface, - view->ox + output_box.x, - view->oy + output_box.y, width, height); + wlr_xwayland_surface_configure( + xwayland_view->xwayland_surface, + view->ox + output_get_layout_box(view->server->curr_output).x, + view->oy + output_get_layout_box(view->server->curr_output).y, width, + height); wlr_xwayland_surface_set_maximized(xwayland_view->xwayland_surface, true); } @@ -138,12 +136,10 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *_data) { wl_container_of(listener, xwayland_view, map); struct cg_view *view = &xwayland_view->view; if(!xwayland_view_should_manage(view)) { - struct wlr_output_layout *output_layout = view->server->output_layout; - struct wlr_box output_box; - wlr_output_layout_get_box( - output_layout, view->server->curr_output->wlr_output, &output_box); - view->ox = xwayland_view->xwayland_surface->x - output_box.x; - view->oy = xwayland_view->xwayland_surface->y - output_box.y; + view->ox = xwayland_view->xwayland_surface->x - + view->server->curr_output->layout_box.x; + view->oy = xwayland_view->xwayland_surface->y - + view->server->curr_output->layout_box.y; } view_map(view, xwayland_view->xwayland_surface->surface, diff --git a/xwayland.h b/xwayland.h index 79c265a..6661f0e 100644 --- a/xwayland.h +++ b/xwayland.h @@ -1,4 +1,4 @@ -// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// Copyright 2020 - 2024, project-repo and the cagebreak contributors // SPDX-License-Identifier: MIT #ifndef CG_XWAYLAND_H