pax_global_header00006660000000000000000000000064147561602570014527gustar00rootroot0000000000000052 comment=1fe4797a9d29b5094c9e38c336752d7f57ed593f labwc-0.8.3/000077500000000000000000000000001475616025700126275ustar00rootroot00000000000000labwc-0.8.3/.clang-format000066400000000000000000000017511475616025700152060ustar00rootroot00000000000000# Note: this is an VERY rough approximation of labwc's coding style (see # CONTRIBUTING.md) and is intended only as a hint for IDE formatting # aids. DO NOT rely on clang-format or your IDE for correct formatting; # always check the result manually (and run ./scripts/check)! # # Some notable things that clang-format gets wrong: # - no support for double-indenting before an opening brace # - does not always round continuation indent/alignment to tab stops BasedOnStyle: LLVM UseTab: Always IndentWidth: 8 ContinuationIndentWidth: 8 AlignAfterOpenBracket: DontAlign AlwaysBreakAfterDefinitionReturnType: true BreakBeforeBinaryOperators: NonAssignment BreakBeforeBraces: Linux IndentCaseLabels: false SpaceBeforeParens: ControlStatementsExceptControlMacros ForEachMacros: ['for_each_view', 'wl_array_for_each', 'wl_list_for_each', 'wl_list_for_each_reverse', 'wl_list_for_each_reverse_safe', 'wl_list_for_each_safe'] labwc-0.8.3/.editorconfig000066400000000000000000000004551475616025700153100ustar00rootroot00000000000000root = true [*.{c,h,scd}] end_of_line = lf insert_final_newline = true charset = utf-8 trim_trailing_whitespace = true indent_style = tab indent_size = 8 max_line_length = 80 [*.{xml,build,md}] indent_style = space indent_size = 2 [*.md] max_line_length = 80 [COMMIT_EDITMSG] max_line_length = 74 labwc-0.8.3/.gitattributes000066400000000000000000000002271475616025700155230ustar00rootroot00000000000000# Exclude checkpatch.pl from language stats # https://github.com/github/linguist/blob/master/docs/overrides.md scripts/checkpatch.pl linguist-vendored labwc-0.8.3/.github/000077500000000000000000000000001475616025700141675ustar00rootroot00000000000000labwc-0.8.3/.github/ISSUE_TEMPLATE/000077500000000000000000000000001475616025700163525ustar00rootroot00000000000000labwc-0.8.3/.github/ISSUE_TEMPLATE/bug-report.yml000066400000000000000000000040441475616025700211650ustar00rootroot00000000000000name: Bug Report description: File a bug report labels: [ "bug " ] body: - type: markdown attributes: value: > Thanks for taking the time to fill out this bug report. This form is for bug reports only. Questions and feature requests are part of Discussions. Wrap text output and commands with triple backticks (```) for proper formatting. - id: description type: textarea attributes: label: Problem description description: A clear and concise description of what the bug is placeholder: I hit enter and my computer hacked the Gibson validations: required: true - id: steps type: textarea attributes: label: Steps to reproduce description: Clear steps to reproduce the bug placeholder: | 1. Launch labwc with a default configuration on multiple displays. 2. Launch a terminal on each output, etc, etc. Expected behavior: Foo. Actual behavior: Bar. validations: required: true - id: labwc_source type: dropdown attributes: label: labwc build source description: labwc build source (binary, local, etc) options: - Release - Local build validations: required: true - id: labwc_version type: input attributes: label: labwc version description: labwc version or commit sha (run `labwc -v` to find out) placeholder: 0.8.1 validations: required: true - id: labwc_environment type: dropdown attributes: label: labwc environment description: How is labwc being run options: - From a TTY or some display manager like lightdm - Nested on Wayland - Nested on X.Org Server - With Virtualisation (VirtualBox) - With Virtualisation (Qemu) - Not Applicable - I do not know what all that means validations: required: true - id: distribution type: input attributes: label: Distribution description: Distribution placeholder: Void Linux labwc-0.8.3/.github/ISSUE_TEMPLATE/config.yml000066400000000000000000000011311475616025700203360ustar00rootroot00000000000000blank_issues_enabled: true contact_links: - name: labwc website url: https://labwc.github.io about: General information, manuals and FAQ - name: labwc questions url: https://github.com/labwc/labwc/discussions/categories/q-a about: Ask the community for help - name: labwc feature requests url: https://github.com/labwc/labwc/discussions/categories/feature-requests about: Suggest a feature for labwc - name: labwc on IRC url: https://web.libera.chat/gamja/?channels=#labwc about: Use IRC to get community support for labwc. Might take a while to get an answer. labwc-0.8.3/.github/workflows/000077500000000000000000000000001475616025700162245ustar00rootroot00000000000000labwc-0.8.3/.github/workflows/build.yml000066400000000000000000000206651475616025700200570ustar00rootroot00000000000000# Void-musl images: # https://github.com/void-linux/void-containers/pkgs/container/void-musl # # Void dependencies based on: # https://github.com/void-linux/void-packages/blob/master/srcpkgs/labwc/template # # Recommended GH CI Void mirror based on # https://docs.voidlinux.org/xbps/repositories/mirrors/changing.html name: CI on: pull_request: paths: - 'meson.build' - 'meson_options.txt' - 'src/**' - 'include/**' - 'protocols/**' - 'scripts/**' - '.github/workflows/**' jobs: codestyle: name: CodeStyleCheck runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Code Style run: | ./scripts/check make -C scripts/helper ./scripts/find-banned.sh build: name: Build needs: codestyle timeout-minutes: 10 strategy: fail-fast: false matrix: name: [ Arch, Debian, FreeBSD, Void-musl ] include: - name: Arch os: ubuntu-latest container: archlinux:base-devel env: TARGET: 'sh -xe' - name: Debian os: ubuntu-latest container: debian:testing env: TARGET: 'sh -xe' - name: FreeBSD os: ubuntu-latest env: TARGET: 'ssh freebsd /bin/sh -xe' - name: Void-musl os: ubuntu-latest container: ghcr.io/void-linux/void-musl:latest env: TARGET: 'sh -xe' env: ${{ matrix.env }} runs-on: ${{ matrix.os }} container: ${{ matrix.container }} steps: - uses: actions/checkout@v1 - name: Install Arch Linux dependencies if: matrix.name == 'Arch' run: | pacman-key --init pacman -Syu --noconfirm pacman -S --noconfirm git meson clang wlroots libdrm libinput \ wayland-protocols cairo pango libxml2 xorg-xwayland librsvg \ libdisplay-info gdb ttf-dejavu foot libsfdo - name: Install Debian Testing dependencies if: matrix.name == 'Debian' run: | sed -i '/^Types/ s/deb/& deb-src/' /etc/apt/sources.list.d/debian.sources apt-get update apt-get upgrade -y apt-get install -y git gcc clang gdb xwayland apt-get build-dep -y labwc #apt-get build-dep -y libwlroots-0.18-dev - name: Install FreeBSD dependencies if: matrix.name == 'FreeBSD' uses: vmactions/freebsd-vm@v1 with: usesh: true prepare: | sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf pkg set -yn pkg:mesa-dri # hack to skip llvm dependency pkg install -y git meson gcc pkgconf cairo pango evdev-proto \ hwdata wayland-protocols wlroots libdisplay-info run: echo "setup done" - name: Install Void Linux dependencies if: matrix.name == 'Void-musl' run: | mkdir -p /etc/xbps.d cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/ sed -i "s:repo-default\.voidlinux\.org:repo-ci.voidlinux.org:g" \ /etc/xbps.d/*-repository-*.conf xbps-install -Syu || xbps-install -yu xbps xbps-install -Syu xbps-install -y git meson gcc clang pkg-config scdoc \ cairo-devel glib-devel libpng-devel librsvg-devel libxml2-devel \ pango-devel wlroots0.18-devel gdb bash xorg-server-xwayland \ dejavu-fonts-ttf libsfdo-devel foot # These builds are executed on all runners - name: Build with gcc run: | echo ' cd "$GITHUB_WORKSPACE" export CC=gcc meson setup build-gcc -Dxwayland=enabled --werror meson compile -C build-gcc ' | $TARGET - name: Build with clang if: matrix.name != 'Debian' run: | echo ' cd "$GITHUB_WORKSPACE" export CC=clang meson setup build-clang -Dxwayland=enabled --werror meson compile -C build-clang ' | $TARGET - name: Build with gcc - no-xwayland run: | echo ' cd "$GITHUB_WORKSPACE" export CC=gcc meson setup build-gcc-no-xwayland -Dxwayland=disabled --werror meson compile -C build-gcc-no-xwayland ' | $TARGET - name: Build with clang - no-xwayland if: matrix.name != 'Debian' run: | echo ' cd "$GITHUB_WORKSPACE" export CC=clang meson setup build-clang-no-xwayland -Dxwayland=disabled --werror meson compile -C build-clang-no-xwayland ' | $TARGET - name: Build with gcc - release run: | echo ' cd "$GITHUB_WORKSPACE" export CC=gcc meson setup build-gcc-release -Dxwayland=enabled \ -Dbuildtype=release -Db_ndebug=true --werror meson configure build-gcc-release -Dwlroots:b_ndebug=false || true meson compile -C build-gcc-release ' | $TARGET - name: Build with gcc - static analyzer run: | echo ' cd "$GITHUB_WORKSPACE" export CC=gcc meson setup build-gcc-static_analyzer -Dxwayland=enabled \ -Dstatic_analyzer=enabled --werror meson compile -C build-gcc-static_analyzer ' | $TARGET - name: Build with clang - release if: matrix.name != 'Debian' run: | echo ' cd "$GITHUB_WORKSPACE" export CC=clang meson setup build-clang-release -Dxwayland=enabled \ -Dbuildtype=release -Db_ndebug=true --werror meson configure build-clang-release -Dwlroots:b_ndebug=false || true meson compile -C build-clang-release ' | $TARGET # Non-feature build, run on Arch only - name: Build with gcc - no-feature test if: matrix.name == 'Arch' run: | echo ' cd "$GITHUB_WORKSPACE" export CC=gcc meson setup build-gcc-no-feature -Dxwayland=disabled \ -Dicon=disabled -Dsvg=disabled --werror meson compile -C build-gcc-no-feature ' | $TARGET # Runtime tests, these run on Arch and Void only (the later due to libmusl being used) - name: Build with gcc - runtime test if: matrix.name == 'Arch' run: | echo ' cd "$GITHUB_WORKSPACE" export CC=gcc meson setup build-gcc-gdb -Dxwayland=enabled -Db_sanitize=undefined --werror meson compile -C build-gcc-gdb scripts/ci/smoke-test.sh build-gcc-gdb ' | $TARGET - name: Build with clang - runtime test if: matrix.name == 'Arch' run: | echo ' cd "$GITHUB_WORKSPACE" export CC=clang meson setup build-clang-gdb -Dxwayland=enabled -Db_sanitize=undefined --werror meson compile -C build-clang-gdb scripts/ci/smoke-test.sh build-clang-gdb ' | $TARGET - name: Build with gcc - runtime leak test if: matrix.name == 'Arch' run: | echo ' cd "$GITHUB_WORKSPACE" export CC=gcc meson setup build-gcc-leak -Dxwayland=enabled -Db_sanitize=address,undefined \ --werror --force-fallback-for=wlroots meson compile -C build-gcc-leak LABWC_LEAK_TEST=1 scripts/ci/smoke-test.sh build-gcc-leak ' | $TARGET - name: Build with clang - runtime leak test if: matrix.name == 'Arch' run: | echo ' cd "$GITHUB_WORKSPACE" export CC=clang meson setup build-clang-leak -Dxwayland=enabled -Db_sanitize=address,undefined \ --werror --force-fallback-for=wlroots meson compile -C build-clang-leak LABWC_LEAK_TEST=1 scripts/ci/smoke-test.sh build-clang-leak ' | $TARGET # Void-musl doesn't support sanitizer - name: Build with gcc - runtime test w/o sanitizer if: matrix.name == 'Void-musl' run: | echo ' cd "$GITHUB_WORKSPACE" export CC=gcc meson setup build-gcc-gdb -Dxwayland=enabled --werror meson compile -C build-gcc-gdb LABWC_RUNS=2 scripts/ci/smoke-test.sh build-gcc-gdb ' | $TARGET labwc-0.8.3/.github/workflows/irc.yml000066400000000000000000000130041475616025700175220ustar00rootroot00000000000000name: "IRC Notifications" on: create: pull_request: types: [opened, closed, reopened] issues: types: [opened, closed, reopened] discussion: types: [created, closed, deleted] push: branches: - 'master_disabled' - 'v0.5_disabled' jobs: test: runs-on: ubuntu-latest steps: - name: irc push uses: rectalogic/notify-irc@v1 if: github.event_name == 'push' with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "[${{ github.event.ref }}] ${{ github.actor }} pushed new commits: ${{ github.event.compare }}" - name: irc issue opened uses: rectalogic/notify-irc@v1 if: github.event_name == 'issues' && github.event.action == 'opened' with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "${{ github.actor }} opened issue '${{ github.event.issue.title }}' (${{ github.event.issue.html_url }})" - name: irc issue reopened uses: rectalogic/notify-irc@v1 if: github.event_name == 'issues' && github.event.action == 'reopened' with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "${{ github.actor }} reopened issue: '${{ github.event.issue.title }}' (${{ github.event.issue.html_url }})" - name: irc issue closed uses: rectalogic/notify-irc@v1 if: github.event_name == 'issues' && github.event.action == 'closed' with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "${{ github.actor }} closed issue '${{ github.event.issue.title }}' (${{ github.event.issue.html_url }})" - name: discussion started uses: rectalogic/notify-irc@v1 if: github.event_name == 'discussion' && github.event.action == 'created' with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "${{ github.actor }} opened discussion '${{ github.event.discussion.title }}' in [${{ github.event.discussion.category.name }}] (${{ github.event.discussion.html_url }})" - name: discussion closed uses: rectalogic/notify-irc@v1 if: github.event_name == 'discussion' && github.event.action == 'closed' with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "${{ github.actor }} closed discussion '${{ github.event.discussion.title }}' in [${{ github.event.discussion.category.name }}] (${{ github.event.discussion.html_url }})" - name: discussion deleted uses: rectalogic/notify-irc@v1 if: github.event_name == 'discussion' && github.event.action == 'deleted' with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "${{ github.actor }} deleted discussion '${{ github.event.discussion.title }}' in [${{ github.event.discussion.category.name }}] (${{ github.event.discussion.html_url }})" - name: irc pull request opened uses: rectalogic/notify-irc@v1 if: github.event_name == 'pull_request' && github.event.action == 'opened' with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "[${{ github.event.pull_request.base.ref }}] ${{ github.actor }} opened PR '${{ github.event.pull_request.title }}' (${{ github.event.pull_request.html_url }})" - name: irc pull request reopened uses: rectalogic/notify-irc@v1 if: github.event_name == 'pull_request' && github.event.action == 'reopened' with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "[${{ github.event.pull_request.base.ref }}] ${{ github.actor }} reopened PR '${{ github.event.pull_request.title }}' (${{ github.event.pull_request.html_url }})" - name: irc pull request merged uses: rectalogic/notify-irc@v1 if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "[${{ github.event.pull_request.base.ref }}] ${{ github.actor }} merged PR '${{ github.event.pull_request.title }}' (${{ github.event.pull_request.html_url }})" - name: irc pull request closed uses: rectalogic/notify-irc@v1 if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == false with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "[${{ github.event.pull_request.base.ref }}] ${{ github.actor }} closed PR '${{ github.event.pull_request.title }}' (${{ github.event.pull_request.html_url }})" - name: irc tag created uses: rectalogic/notify-irc@v1 if: github.event_name == 'create' && github.event.ref_type == 'tag' with: server: "irc.libera.chat" channel: "#labwc" nickname: "labwc" notice: true message: "${{ github.actor }} tagged ${{ github.repository }}: ${{ github.event.ref }}" labwc-0.8.3/.github/workflows/labwc.github.io.yml000066400000000000000000000007751475616025700217370ustar00rootroot00000000000000# Triggers a rebuild and deploy of labwc.github.io when man pages change # # https://stackoverflow.com/a/65514259 name: "labwc.github.io" on: push: branches: - 'master' - 'v0.5_disabled' paths: - 'docs/*.scd' jobs: notify: runs-on: ubuntu-latest steps: - name: labwc.github.io env: GITHUB_TOKEN: ${{ secrets.WEB_DEPLOY_TOKEN }} run: | gh api repos/labwc/labwc.github.io/dispatches \ --raw-field event_type=rebuild labwc-0.8.3/.gitignore000066400000000000000000000001231475616025700146130ustar00rootroot00000000000000# VS Code cache .cache # vim swap files *.swp *.swo # Qt Creator settings *.user labwc-0.8.3/CONTRIBUTING.md000066400000000000000000000402261475616025700150640ustar00rootroot00000000000000- [1. How to Contribute](#how-to-contribute) - [2. Debugging](#debugging) - [2.1 Backtraces](#backtraces) - [2.2 Debug Logs](#debug-logs) - [2.3 Output](#output) - [2.4 Input](#input) - [3. Packaging](#packaging) - [4. Coding Style](#coding-style) - [4.1 Linux Kernel Style Basics](#linux-kernel-style-basics) - [4.2 Devault Deviations](#devault-deviations) - [4.3 Labwc Specifics](#labwc-specifics) - [4.3.1 API](#api) - [4.3.2 The Use of glib](#the-use-of-glib) - [4.3.3 The use of GNU extensions](#the-use-of-gnu-extensions) - [4.3.4 Naming Conventions](#naming-conventions) - [5. Commit Messages](#commit-messages) - [6. Unit Tests](#unit-tests) - [7. Submitting Patches](#submitting-patches) - [8. Native Language Support](#native-language-support) - [9. Upversion](#upversion) # How to Contribute 1. Report bugs as github issues. We use a template prompting you to provide some sensible information such as what happened, what you expected to happen and steps to reproduce. If applicable try with default configuration. If you are able to, try to do some debugging (guidelines below). 2. Submit patches as github pull-requests. If you wish to introduces significant changes or new features, consult the [scope document], discuss on IRC or via a github issue first. # Debugging There is no one-way-fits-all method for debugging, so you have to use your antennae and do some detective work. This section contains some approaches which may prove useful. ## Backtraces If the compositor crashes, a good starting point is to produce a backtrace by building with ASAN/UBSAN: ``` meson setup -Db_sanitize=address,undefined build/ meson compile -C build/ ``` ## Debug Logs Get debug log with `labwc -d`. The log can be directed to a file with `labwc -d 2>log.txt` To see what is happening on the wayland protocol for a specific client, run it with environment variable `WAYLAND_DEBUG` set to 1, for example `WAYLAND_DEBUG=1 foot`. To see what the compositor is doing on the protocol run `labwc` nested (i.e. start labwc from a terminal in another instance of labwc or some other compositor) with `WAYLAND_DEBUG=server`. This filters out anything from clients. For wayland clients, you can get a live view of some useful info using [wlhax]. ## Output If you think you've got a damage issue, you can run labwc like this: `WLR_SCENE_DEBUG_DAMAGE=highlight labwc` to get a visual indication of damage regions. To emulate multiple outputs (even if you only have one physical monitor), run with `WLR_WL_OUTPUTS=2 labwc` or similar. See [`wlroots/docs/env_vars.md`] for more options. For some types of bugs, it might be useful to find out which mesa driver (.so) you are using. This can be done with `EGL_LOG_LEVEL=debug labwc 2>&1 | grep MESA-LOADER` To rule out driver issues you can run with `WLR_RENDERER=pixman labwc` You can also get some useful system info with [drm_info]. ## Input Use `sudo libinput debug-events` to show input events. From a terminal you can use `xev -event keyboard` and `wev -f wl_keyboard:key` to analyse keyboard events # Packaging Some distributions carry labwc in their repositories or user repositories. - @ptrcnull (Alpine) - @narrat (Arch) - @artist-artix (Artix) - @b1rger (Debian) - @jbeich (FreeBSD) - @epsilon-0 (Gentoo) - @spl237 (Raspberry Pi OS) - @adcdam (Slackware) - @bdantas (Tiny Core Linux) - @Visone-Selektah (Venom Linux) - @tranzystorekk (Void Linux) kindly maintain the packages in their respective distro. Let's keep them informed of new releases and any changes that relate to packaging. If you are maintaining a labwc package for another distro feel free to open an issue so we can add you to this list. # Coding Style labwc is written in the [Linux kernel coding style] with a small number of deviations to align with [Drew Devault's preferred coding style] namely: 1. [Function Declaration](https://git.sr.ht/~sircmpwn/cstyle#function-declarations) 2. [Braces for one-line statement](https://git.sr.ht/~sircmpwn/cstyle#brace-placement) 3. [Organisation of header #include statements](https://git.sr.ht/~sircmpwn/cstyle#header-files) 4. [Breaking of long lines](https://git.sr.ht/~sircmpwn/cstyle#splitting-long-lines) The reasons for specifying a style is not that we enjoy creating rules, but because it makes reading/maintaining the code and spotting problems much easier. If you are new to this style and want to get going quickly, either just imitate the style around you, or read the summary below and use `./scripts/check` to run some formatting checks. ## Linux Kernel Style Basics The preferred line length limit is 80 columns, although this is a bit soft. Tabs are 8 columns wide. Indentation with spaces is not used. Opening braces go on the same line, except for function definitions. Put `*` with the identifier when defining pointers, for example `char *foo` Spaces are placed around binary operators but not unary, like this: ``` int x = y * (2 + z); foo(--a, -b); ``` `sizeof(*foo)` is preferred over `sizeof(struct foo)` Use `if (!p)` instead of `if (p == 0)` or `if (p == NULL)` Comments are written as follows: ``` /* This is a single-line comment */ /* * This is a multi-line comment which is much much much much much much * longer. */ ``` When documenting functions in header files we use the [kernel-doc format]: ``` /** * function_name() - Brief description of function. * @arg1: Describe the first argument. * @arg2: Describe the second argument. * One can provide multiple line descriptions * for arguments. * * A longer description, with more discussion of the function function_name() * that might be useful to those using or modifying it. Begins with an * empty comment line, and may include additional embedded empty * comment lines. * * The longer description may have multiple paragraphs. * * Return: Describe the return value of function_name. * * The return value description can also have multiple paragraphs, and should * be placed at the end of the comment block. */ ``` ## Devault Deviations Functions are defined as below with `name` on a new line: ``` return type name(parameters...) { body } ``` Braces are mandatory even for one-line statements. ``` if (cond) { ... } ``` `#include` statements at the top of the file are organized by locality (`<>` first, then `""`), then alphabetized. When breaking a statement onto several lines, indent the subsequent lines once. If the statement declares a `{}` block, indent twice instead. Also, place operators (for example `&&`) on the next line. ``` if (seat->pressed.surface && ctx->surface != seat->pressed.surface && !update_pressed_surface(seat, ctx) && !seat->drag_icon) { if (cursor_has_moved) { process_cursor_motion_out_of_surface(server, time_msec); } return; } ``` ## Labwc Specifics ### API We have a very small, modest API and encourage you to use it. 1. `znew()` - as a shorthand for calloc(1, sizeof()) with type checking [common/mem.h] 2. `zfree()` to zero after free - [common/mem.h] 3. `wl_list_append()` to add elements at end of lists - [common/list.h] 4. `wl_array_len()` to get number of elements in a `wl_array` [common/array.h] 5. `ARRAY_SIZE()` to get number of elements in visible array [common/macros.h] [common/mem.h]: https://github.com/labwc/labwc/blob/master/include/common/mem.h [common/list.h]: https://github.com/labwc/labwc/blob/master/include/common/list.h [common/array.h]: https://github.com/labwc/labwc/blob/master/include/common/array.h [common/macros.h]: https://github.com/labwc/labwc/blob/master/include/common/macros.h ### The Use of glib We try to keep the use of glib pretty minimal for the following reasons: - The use of glib has been known to make AddressSanitiser diagnose false positives and negatives. - Log messages coming from glib functions look inconsistent. - The use of glib functions, naming-conventions and iterators in a code base that is predominantly ANSI C creates a clash which makes readability and maintainability harder. - Mixing gmalloc()/malloc() and respective free()s can create problems with memory pools [^1] Having said that, with our use of cairo and pango we depend on glib-2.0 anyway so linking with it and making use of some of its helper functions comes for free and can keep the code simpler. For example, if we were going to carry out extensive string manipulation, GString and utf8 helpers would be okay. Some functions such as `g_utf8_casefold()` would be pretty hard to write from scratch and are fine to use. Having said that, labwc does not do much string-mangling. The following functions are used today and are deemed acceptable by the core devs: - `g_shell_parse_argv()` - `g_strsplit()` - `g_pattern_match_simple()` When using these types of functions it is often desirable to support with some glib code, which is okay provided it is kept local and self-contained. See example from `src/theme.c`: ``` static bool match(const gchar *pattern, const gchar *string) { GString *p = g_string_new(pattern); g_string_ascii_down(p); bool ret = (bool)g_pattern_match_simple(p->str, string); g_string_free(p, true); return ret; } ``` ### The use of GNU extensions We avoid [GNU C extensions] because we want to fit into the eco-system (wayland and wlroots) we live in. We do use `__typeof__` which strictly speaking is a GNU C extension (`typeof`) but through the use of `__` is supported by gcc and clang without defining `_GNU_SOURCE`. The justification for this is that Wayland uses it, for example in the [`wl_container_of()`] macro which is needed in `wl_list*` and it does provide pretty big benefits in terms of type safety. We compile with `-std=c11` because that's what 'wlroots' uses and we do not want to increase the entry-level for OSs without good reason (and currently we can't think of one). ### Naming Conventions There are three types of coordinate systems: surface, output and layout - for which the variables (sx, sy), (ox, oy) and (lx, ly) are used respectively in line with wlroots. With the introduction of the scene-graph API, some wlroots functions also use node coordinates (nx, ny) but we prefer (sx, sy) where possible. We do not worry about namespace issues too much and we try to not make the code a pain to use just to uniquify names. If we were writing a library we would prefix public functions and structs with `lab_`, but we are not. We do however prefix public function names with the filename of the translation unit. For example, public functions in `view.c` begin with `view_`. We do start enums with `LAB_` We use the prefix `handle_` for signal-handler-functions in order to be consistent with sway and rootston. For example `view->request_resize.notify = handle_request_resize` # Commit Messages The log messages that explain changes are just as important as the changes themselves. Try to describe the 'why' to help future developers. Write [commit messages] like so, keeping the top line to this sort of syntax: ``` cursor: add special feature ``` This first line should: - Be a short description - In most cases be prefixed with "area: " where area refers to a filename or identifier for the general area of the code being modified. - Not capitalize the first word following the "area: " prefix, unless it's a name, acronym or similar. - Skip the full stop And please wrap the commit message at max 74 characters, otherwise `git log` and similar look so weird. URLs and other references are exempt. # Unit Tests ## Introduction The tests live in the `t/` directory. In the bigger scheme of validating that the compositor meets users' needs, unit tests do not contribute a great deal. However, they have a role to play in providing some verification that stand-alone functions behave as expected. On this project, writing unit-tests is not compulsory nor do we measure coverage. The inclusion of the t/ directory does not signify a move towards test-driven development. We intend to use unit tests sparingly and only when devs find them useful. ## Usage From repo top level directory: meson setup -Dtest=enabled build meson compile -C build/ meson test --verbose -C build/ # Submitting patches Base both bugfixes and new features on `master`. # Native Language Support ## Translators ### Weblate Instance Translators can create an account at [LXQt Weblate](https://translate.lxqt-project.org/projects/labwc/labwc/) and use the web interface. Adding new languages should work, otherwise the administrators can be contacted. Suggestions for improving existing translations can be added without account. ### Github Pull Request Translators can add their `MY_LOCALE.po` files to the `po` directory based on `po/labwc.pot` and issue a pull request. To do this they can generate their `MY_LOCALE.po` file in a few steps: 1. Edit the `po/LINGUAS` file to add their locale code in English alphabetical order to the field of locale codes. 2. Copy the `po/labwc.pot` to `po/MY_LOCALE.po` 3. Edit the newly generated `MY_LOCALE.po` file with some of their contact and locale details in the header of the file then add the translation strings under each English string. [See this tutorial for further guidance](https://www.labri.fr/perso/fleury/posts/programming/a-quick-gettext-tutorial.html) ## Coders Code contributors may need to update relevant files if their additions affect UI elements (at the moment only `src/menu/menu.c` and `src/config/rcxml.c`). In this case the `po/labwc.pot` file needs to be updated so that translators can update their translations. Remember, many translators are _not_ coders! The process is fairly trivial however does involve some manual steps. 1. After adding and testing your code additions to satisfaction, backup `po/labwc.pot`. You need the custom header from that file for the newly generated .pot file in the next step. 2. From the root of the repository run this: ``` xgettext --keyword=_ --language=C --add-comments -o po/labwc.pot src/menu/menu.c src/config/rcxml.c ``` This generates a new pot file at `po/labwc.pot` 3. Copy the header from the original `labwc.pot` to the new one, keeping the newly generated dates, check for sanity and commit. # Upversion It is generally only the lead-maintainer who will upversion, but in order not to forget any key step or in case someone else needs to do it, here follow the steps to be taken: 1. If appropriate, update `revision` in `subprojects/wlroots.wrap` and run `git commit -m 'wlroots.wrap: use A.B.C'` 2. Update `NEWS.md` with the release details and run `git commit -m 'NEWS.md: update notes for X.Y.Z'` Note: If new dependencies are needed, make this clear. 3. In `meson.build` update the version and (if required) the wlroots dependency version. Then run `git commit -m 'build: bump version to X.Y.Z'` 4. Run `git tag -a X.Y.Z`. The first line of the commit message should be "labwc X.Y.Z" and the body should be the `NEWS.md` additions removing hash characters (#) from the headings as these will otherwise be ignored by git. 5. On github, create a 'Release' as some distros use this as a trigger. Set it as 'latest release'. [scope document]: https://github.com/labwc/labwc-scope#readme [`wlroots/docs/env_vars.md`]: https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/docs/env_vars.md [wlhax]: https://git.sr.ht/~kennylevinsen/wlhax [drm_info]: https://github.com/ascent12/drm_info [Drew Devault's preferred coding style]: https://git.sr.ht/~sircmpwn/cstyle [Linux kernel coding style]: https://www.kernel.org/doc/html/v4.10/process/coding-style.html [kernel-doc format]: https://docs.kernel.org/doc-guide/kernel-doc.html [commit messages]: https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/CONTRIBUTING.md#commit-messages [GNU C extensions]: https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html [`wl_container_of()`]: https://github.com/wayland-project/wayland/blob/985ab55d59db45ea62795c76dff5949343e86b2f/src/wayland-util.h#L409 [^1]: The reference documentation for glib notes that: "It's important to match g_malloc() with g_free(), plain malloc() with free(), and (if you're using C++) new with delete and new[] with delete[]. Otherwise bad things can happen, since these allocators may use different memory pools (and new/delete call constructors and destructors)." See: https://developer.gimp.org/api/2.0/glib/glib-Memory-Allocation.html labwc-0.8.3/LICENSE000066400000000000000000000432541475616025700136440ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. labwc-0.8.3/NEWS.md000066400000000000000000003074471475616025700137440ustar00rootroot00000000000000# Introduction This file contains significant user-visible changes for each version. For full changelog, use `git log`. The format is based on [Keep a Changelog] # Summary of Releases | Date | All Changes | wlroots version | lines-of-code | |------------|---------------|-----------------|---------------| | 2025-02-21 | [0.8.3] | 0.18.2 | 27671 | | 2024-12-13 | [0.8.2] | 0.18.2 | 26298 | | 2024-10-25 | [0.8.1] | 0.18.1 | 25473 | | 2024-08-16 | [0.8.0] | 0.18.0 | 23320 | | 2024-06-19 | [0.7.4] | 0.17.4 | 22746 | | 2024-06-12 | [0.7.3] | 0.17.4 | 22731 | | 2024-05-10 | [0.7.2] | 0.17.3 | 21368 | | 2024-03-01 | [0.7.1] | 0.17.1 | 18624 | | 2023-12-22 | [0.7.0] | 0.17.1 | 16576 | | 2023-11-25 | [0.6.6] | 0.16.2 | 15796 | | 2023-09-23 | [0.6.5] | 0.16.2 | 14809 | | 2023-07-14 | [0.6.4] | 0.16.2 | 13675 | | 2023-05-08 | [0.6.3] | 0.16.2 | 13050 | | 2023-03-20 | [0.6.2] | 0.16.2 | 12157 | | 2023-01-29 | [0.6.1] | 0.16.1 | 11828 | | 2022-11-17 | [0.6.0] | 0.16.0 | 10830 | | 2022-07-15 | [0.5.3] | 0.15.1 | 9216 | | 2022-05-17 | [0.5.2] | 0.15.1 | 8829 | | 2022-04-08 | [0.5.1] | 0.15.1 | 8829 | | 2022-02-18 | [0.5.0] | 0.15.1 | 8766 | | 2021-12-31 | [0.4.0] | 0.15.0 | 8159 | | 2021-06-28 | [0.3.0] | 0.14.0 | 5051 | | 2021-04-15 | [0.2.0] | 0.13.0 | 5011 | | 2021-03-05 | [0.1.0] | 0.12.0 | 4627 | ## [0.8.3] The eye-catching new features of this release are undoubtedly: 1. Support for the `ext-workspace` protocol with big thanks to @Consolatis 2. Menu enhancements including icons and dynamic root-menus. Credits here go to @Consolatis, @tokyo4j and @johanmalm for improvements to both backend buffer managements and front end menu mechanics. However - on the whole - the main effort of this release has gone into stability, usability and performance fixes, and it really feels like we have matured nicely against the wlroots 0.18 series. Notes to package maintainers: - This version introduces the ext-workspace protocol which breaks xfce4-panel 4.20.0. There is a fix in subsequent releases so make sure xfce4-panel is shipped at >= 4.20.1. ### Added - Add config options `` and `` [#2529] - Menu icons support [#2509] ```xml yes ``` - Support toplevel pipemenus [#2238] [#2239] ```xml ``` - Add `` to specify the icon name to be used when lookups for an application icon have failed [#2518] - Use 'labwc' directory for themes as well as 'openbox-3' [#2488] - Add default Alt-Shift-Tab keybind for `PreviousWindow` [#2477] - Add config option `` to allow users to avoid automatically enabling outputs at startup and when new outputs are connected. With autoEnableOutputs disabled, tools such as kanshi can be used to give finer-grained control of which outputs are enabled, which may be useful to avoid re-enabling outputs that disconnect and reconnect during powersave [#2458] - Add WarpCursor action. Written-by: @orfeasxyz [#2118] - Support ext-workspace protocol [#2365] ### Fixed - Prevent black flash (caused by unnecessary output commit without buffer) when repeatedly calling `wlopm --on` [#2580] - Set custom output mode on `wlopm --on` to work around a wlroots issue: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3946 [#2578] - Handle layer-shell unmap without any outputs left [#2577] - Fix some odd, inconsistent behaviour with resize edges [#2529] - Cleanup overlay timer on exit [#2574] - Fix unexpected behavior when a menu is opened from another menu [#2537] - Taking into account SSD margin in `MoveTo` action [#2469] [#2563] - Fix UAF caused by trying to update xcursor in an output destroy-handler [#2539] [#2560] - Send wlr-foreign-toplevel `output_enter` on initialization to fix a bug which causes missing taskbar items in Waybar when configured to show windows per output. [#2550] - Use subsurface as reference for out-of-surface cursor movement [#2542] [#2547] - Dynamically look up window icons in server-side-deco titlebar for output scales [#2518] - Do not leak bound scroll events from touchpad to clients in some conditions [#2516] - Ignore duplicated buttons in `` rather than ignoring all of it [#2524] - Set repeat information for virtual keyboards [#2513] - Honour modifier state of virtual keyboards when processing mousebinds. Helps some use-cases under wayvnc [#2511] - Accept uppercase icon endings - IME: fix stuck Ctrl when pressed Ctrl+F in Firefox with Fcitx5 [#2498] - Fix invisible cursor on application after reconfigure [#2499] - Fix abort() on non-ARGB32 PNG file [#2495] - Ignore `wlr_output_state.mode/custom_mode` except for client request [#2486] - Cancel keyboard keybind-repeat on reconfigure [#2473] - Send initial wlr-foreign-toplevel pre-map state [#2460] - Fix NULL `string_prop` crash when `app_id` is NULL [#2453] - Fix scaling for rendering large image in non-square rectangle [#2451] - Fix cursor focus when menu is closed by clicking its border [#2443] - Update pointer focus on xdg-popup/layer popup destruction to fix bug where closing a popup did not move the pointer focus to the main toplevel until the cursor was moved. [#2443] - Improve algorithm for menu placement with xdg-positioner [#2408] - Do not forward IME key-release without correspinding key-press to avoid stuck keys [#2437] ### Changed - Make window switcher more Openbox-like in terms of key processing. The shift key no longer inverts the direction of window switching, so to keep the original behavior, alt-shift-tab has been added as a default keybind to cycle to the previous window [#2477] - Do not set numlock by default, only set on|off if user specifically requests it in the config file [#2483] - Demote libsfdo error-logging to `WLR_INFO` to avoid logging issues with .desktop files as errors [#2456] - Always send modifier release events. This means that when a keybind is triggered while focusing on an application, the key-release event of the modifier key is now sent to the application. This fixes the problem of stuck modifier keys in some applications including Blender and wlfreerdp. Note that this change makes existing keybinds with Alt key show Firefox's menu bar. For those who don't want to make those keybinds interfere with Firefox's menu bar, we recommend replacing Alt key (e.g. "A-s") with Win key (e.g. "W-s") in the keybinds. [#2455] - Removed `wantAbsorbedModifierReleaseEvents` window rule as it's no longer needed [#2455] - Clear the keyboard/pointer focus while a window is dragged, the window switcher is activated or a menu is opened. As a result, with followMouse="yes" and followMouseRequiresMovement="no" in rc.xml, keyboard-focus semantics have subtly changed when using the window-switcher. [#2455] ## [0.8.2] This is a shorter release cycle compared with the usual 10-week one because it contains a significant number of stability and cleanliness fixes which warrant packaging. We do not normally describe behind-the-scenes work in this log, but will mention two here as an exception: 1. A clean run with gcc/clang memory leak check has been achieved. Thanks to @tokyo4j for fantastic work with this [#2331] 2. A buffer-sharing mechanism has been merged to improve both processor and memory usage in the long term. Credits to @tokyo4j and @Consolatis for this one. [#2363] Notes to package maintainers: - The wlroots dependency has been increased to `0.18.1` to avoid a crash when using ext-foreign-toplevel-list protocol. - It is also advisable to use `0.18.2` as soon as possible to fix a crash triggered when the xwayland server closes during a drag-and-drop with an XWayland client. ### Added - Add support for xdg-foreign-v1 and xdg-foreign-v2 protocols [#2400] - Add window rule to send release-events of modifiers which are part of keybinds. This supports clients (like blender) that want to see modifier release events even when they are part of a keybinds. [#2377] ```xml ``` - Support menu borders [#2376] ``` menu.border.width: 1 menu.border.color: #aaaaaa ``` - Add conversion specifier `%n` to the window-switcher `` config option to show desktop entry name in the window-switcher. Written-by: @jp7677 [#2360] ```xml ``` - Add hold gestures. @jp7677 [#2326] - Support ext-foreign-toplevel-list protocol [#2072] - Support additional window rule conditions including `shaded`, `maximized`, `iconified`, `focused`, `omnipresent`, `desktop`, `tiled` and `tiled_region`. This also works for `If` and `ForEach` queries. @orfeasxyz @ahesford [#2245] - Add mouse emulation for touch devices. @spl237 [#2277] - Improve handling of touch events. @jp7677 [#2273] This includes: - Hide the cursor on touch input and keep the cursur invisible until pointer or tablet input - Close xdg-popups on touch down - Notify idle-manager on touch down/up - Clear pointer focus on touch input to avoid pointer focus interfering with touch input, like showing hover effect on unexpected locations - Move touch only with one touch point - in other words do not move the cursor when more than one finger is down - Warp cursor to touch coordinates for consistent behaviour with non-touch capable surfaces including the desktop - Set environment variable `LABWC_VER` with current compositor version. @01micko [#2257] - Broadcast keyboard modifiers to all clients rather than just the one with keyboard focus. [#2274] This enables: - Clients such as panels to display the current keyboard layout without introducing new wayland protocols or other IPC. - Unfocused xdg-shell clients to understand button press with keyboard modifiers for example Ctrl+click. ### Fixed - Fix crash caused by `rc.xml` `` options being specified as elements rather than attributes. [#2412] - Fix `ShowMenu` action position with x/y arguments in multi-monitor setup. [#2409] - Block privileged protocols for sandboxed clients [#2398] - Fix incorrect focus behaviour when switching between workspaces with omnipresent windows open [#2335] - Fall back to loading icon based on app-id when `Icon` defined in .desktop file can not be loaded [#2361] - Fix regression introduced with `0.8.1` to allow negative values for theme option `menu.overlap` [#2356] - Ensure output is usable before setting adaptive sync [#2337] [#2338] - Fix `menu.title.text.justify: right` not working [#2336] - Keep focus on omnipresent windows when switching workspaces [#2329] - Skip painting output when session is not active. @enometh @Madhu [#2249] - Ignore variable assignments > 1 KiB in environment files to guard against recursive constructs like FOO=$FOO:bar which would grow on each reconfigure. [#2325] - Improve support for non-compliant .desktop files by matching partial strings to handle for example app-id="gimp-2.10" with file "gimp.desktop". @spl237 [#2266] - Correctly center menu opened with `` @tokyo4j [#2319] - Allow pointer speed of -1.0. @spl237 [#2321] - Fix off-by-one bug in `buf_add_char()` [#2313] - Fix menu separator-line padding regression introduced in `0.8.1`. @domo141 [#2291] - Avoid permanent disabling of tearing due to rejected commits caused by the cursor plane not allowing async page flips which causes tearing page flips to be rejected if the cursor is moved. @RicArch97 [#2295] - Use `MenuHeader` font height in separators with labels. @domo141 [#2276] ### Changed - Set xwaylandPersistence default value to `yes` when compiled with wlroots <0.18.2. This prevents a bug which has the potential to crash the compositor when performing a drag-and-drop action at the same time as the XWayland server is shutting down. [#2371] [#2414] [#2420] - Set default window placement policy to `cascade` instead of `center` [#2345] ```xml cascade ``` - Set default values of theme option `window.*.border.color` to `#aaaaaa`. This makes the colors of window borders and titlebar different, but will let `menu.border.color` inherit `window.active.border.color` just like Openbox does, without making the menu borders around a selected menu item invisible. [#2376] - Invert the y-offset of submenus applied by `menu.overlap.y` to (i) follow Openbox's behavior and (ii) behave as already described in our own documentation. [#2380] ## [0.8.1] The most noteworthy additions in this release are: 1. Titlebar window icons and layout configuration 2. Support for the cosmic-workspace protocol and the openbox inspired client-list-combined-menu for a better user experience with workspaces. Notes to package maintainers: - The SSD titlebar window icon support requires [libsfdo] to be added as a (build and run-time) dependency or statically linked. If this is not wanted, add `-Dicon=disabled` to the `meson setup` command in the build script for the next release. - PRs [#1716] and [#2205] add labwc xdg-portal configuration, modify `labwc.desktop` and amend `XDG_CURRENT_DESKTOP` which should enable better out-of-the-box support for xdg-desktop-portal, but if you already ship a custom setup for this or have different requirements, please review this change. [libsfdo]: https://gitlab.freedesktop.org/vyivel/libsfdo ### Added - Support dmabuf feedback [#2234] [#1278] - Add initial implementation of cosmic-workspace-unstable-v1 [#2030] - Optionally support SSD titlebar window icons. When an icon file is not found or could not be loaded, the window menu icon is shown as before. The icon theme can be selected with `` [#2128] - Add actions `ToggleSnapToEdge` and `ToggleSnapToRegion`. These behave like `SnapToEdge` and `SnapToRegion`, except that they untile the window when already being tiled to the given region or direction. Written-by: @jp7677 and @tokyo4j [#2154] - Add action `UnSnap`. This behaves like `ToggleSnapToEdge/Region` but unconditionally. Written-by: @jp7677 and @tokyo4j [#2154] - Handle xdg-shell `show_window_menu` requests [#2167] - Support the openbox style menus listed below. Written-by: @droc12345 1. `client-list-combined-menu` shows windows across all workspaces. This can be used with a mouse/key bind using: `` [#2101] 2. `client-send-to` shows all workspaces that the current window can be sent to. This can additional be used within a client menu using: `` [#2152] - Add theme option for titlebar padding and button spacing [#2189] ``` window.button.height: 26 window.titlebar.padding.width: 0 window.titlebar.padding.height: 0 window.button.spacing: 0 ``` - Set titlebar height based on the maximum height of any of the objects within it, rather than just taking the font height into account [#2152] - Add theme option for setting button hover effect corner radius [#2127] [#2231] ``` window.button.hover.bg.corner-radius: 0 ``` - Add position arguments for menus. Written-by: @droc12345 [#2102] ```xml root-menu 0 0 ``` - Allow interactive window movement when horizontally or vertically maximized and add associated config option `` [#2052] - Add optional Shade (shade.xbm) and AllDesktops (desk.xbm) buttons and theme options: ``` window.active.button.desk.unpressed.image.color window.inactive.button.desk.unpressed.image.color window.active.button.shade.unpressed.image.color window.inactive.button.shade.unpressed.image.color ``` - Make action `FocusOutput` behave like `MoveToOutput` by adding direction and wrap arguments. Written-by: @orfeasxyz [#2100] - Add config option for titlebar layout. Written-by: @xi [#2088] [#2150] ```xml icon:iconify,max,close yes|no ``` - Add `Oblique` option to `