Skip to content

Commit

Permalink
Merge branch 'next' into md_deps_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adamperkowski authored Dec 11, 2024
2 parents 8264063 + fcb4a2d commit e7726a2
Show file tree
Hide file tree
Showing 52 changed files with 1,770 additions and 863 deletions.
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
<!-- Please enable "Allow edits from maintainers" so we can make necessary changes to your PR -->

# Changelog

<!-- If you want to add a changelog entry for this PR, write it here; otherwise delete this section -->
* Category: (Bug fixes, new features, etc.)
* Description: (Describe changes made)
16 changes: 16 additions & 0 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: cross
on: push

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build '.#picom-cross.merged' -L

2 changes: 2 additions & 0 deletions .github/workflows/page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
asciidoctor -a doctype=article -a stylesheet=../assets/next.css -b html man/picom-trans.1.adoc -D _site
cp -r assets _site/
cp _site/picom.1.html _site/index.html
- name: Copy .well-known
run: cp -r .well-known _site

- name: Upload
uses: actions/upload-pages-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ target
# Python
*.pyc
*.py
!/tools/*.py
!/tests/testcases/*.py

# Misc files
Expand Down
1 change: 1 addition & 0 deletions .well-known/funding-manifest-urls
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://yshui.github.io/funding.json
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@
- `sw-opti`
- `clear-shadow`

## Bug fixes

* Fix assertion failure when running with some window managers (e.g. qtile) and no window is focused (#1384)

# 12.4 (2024-Nov-09)

## Improvements

* Better workaround for a NVIDIA qurik, fix high CPU usage when screen is off (#1265)
* Avoid using xrender convolution in all cases, should improve shadow performance for most users. (#1349)

# Bug fixes

* Fix leak of saved window images.

## Build fixes

* Fix build on arm32 (#1355)

# 12.3 (2024-Oct-14)

## Improvements
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Keith Packard <keithp at keithp.com>
Kevin Kelley <kelleyk at kelleyk.net>
ktprograms <ktprograms at gmail.com>
Kurenshe Nurdaulet
Lenivaya <xocada at gmail.com>
Lenivaya <danylo.osipchuk at proton.me>
Lukas Schmelzeisen <l.schmelzeisen at gmx.de>
Mark Tiefenbruck <mark at fluxbox.org>
Matthew Allum <breakfast at 10.am>
Expand Down Expand Up @@ -90,6 +90,7 @@ tokyoneon78 <mockcoder at protonmail.ch>
Tom Dörr <tomdoerr96 at gmail.com>
Tomas Janousek <tomi at nomi.cz>
Toni Jarjour
triallax <triallax at tutanota.com>
Tuomas Kinnunen <tuomas.kinnunen at aalto.fi>
Uli Schlachter <psychon at znc.in>
Walter Lapchynski <wxl at ubuntu.com>
Expand Down
88 changes: 36 additions & 52 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,47 +1,27 @@
{
inputs = {
flake-utils.url = github:numtide/flake-utils;
nixpkgs.url = github:nixos/nixpkgs;
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs";
git-ignore-nix = {
url = github:hercules-ci/gitignore.nix/master;
url = "github:hercules-ci/gitignore.nix/master";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
flake-utils,
nixpkgs,
git-ignore-nix,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
outputs =
{ self
, flake-utils
, nixpkgs
, git-ignore-nix
, ...
}:
flake-utils.lib.eachDefaultSystem (system:
let
# like lib.lists.remove, but takes a list of elements to remove
removeFromList = toRemove: list: pkgs.lib.foldl (l: e: pkgs.lib.remove e l) list toRemove;
overlay = self: super: {
picom = super.picom.overrideAttrs (oldAttrs: rec {
version = "11";
pname = "picom";
nativeBuildInputs = (removeFromList [ self.asciidoc ] oldAttrs.nativeBuildInputs) ++
[
self.asciidoctor
];
buildInputs =
[
self.pcre2
self.xorg.xcbutil
self.libepoxy
] ++ (removeFromList [
self.xorg.libXinerama
self.xorg.libXext
self.pcre
] oldAttrs.buildInputs);
src = git-ignore-nix.lib.gitignoreSource ./.;
});
};
python = pkgs.python3.withPackages (ps: with ps; [
xcffib pip dbus-next
]);

picomOverlay = final: prev: { picom = prev.callPackage ./package.nix { inherit git-ignore-nix; }; };
overlays = [
picomOverlay
];
pkgs = import nixpkgs {
inherit system overlays;
config.allowBroken = true;
Expand All @@ -60,15 +40,8 @@
];
};

overlays = [overlay];
mkDevShell = p: p.overrideAttrs (o: {
nativeBuildInputs = o.nativeBuildInputs ++ (with pkgs; [
clang-tools_18
llvmPackages_18.clang-unwrapped.python
llvmPackages_18.libllvm
python
]);
hardeningDisable = ["fortify"];
hardeningDisable = [ "fortify" ];
shellHook = ''
# Workaround a NixOS limitation on sanitizers:
# See: https://github.com/NixOS/nixpkgs/issues/287763
Expand All @@ -77,21 +50,32 @@
export ASAN_OPTIONS="disable_coredump=0:unmap_shadow_on_exit=1:abort_on_error=1"
'';
});
in rec {
inherit
overlay
overlays
;
in
rec {
overlay = picomOverlay;
packages = {
picom = pkgs.picom;
default = pkgs.picom;
};
devShells.default = mkDevShell packages.default;
} // (nixpkgs.lib.optionalAttrs (system == "x86_64-linux") rec {
picom-cross = {
armv7l = pkgs.pkgsCross.armv7l-hf-multiplatform.picom;
aarch64 = pkgs.pkgsCross.aarch64-multiplatform.picom;
i686 = pkgs.pkgsi686Linux.picom;
merged = pkgs.runCommand "picom-merged" {} ''
mkdir $out
ln -s ${picom-cross.armv7l} $out/armv7l
ln -s ${picom-cross.aarch64} $out/aarch64
ln -s ${picom-cross.i686} $out/i686
'';
};
});
devShells.default = mkDevShell (packages.default.override { devShell = true; });
devShells.useClang = devShells.default.override {
inherit (pkgs.llvmPackages_18) stdenv;
};
# build picom and all dependencies with frame pointer, making profiling/debugging easier.
# WARNING! many many rebuilds
devShells.useClangProfile = (mkDevShell profilePkgs.picom).override {
devShells.useClangProfile = (mkDevShell (profilePkgs.picom.override { devShell = true; })).override {
stdenv = profilePkgs.withCFlags "-fno-omit-frame-pointer" profilePkgs.llvmPackages_18.stdenv;
};
});
Expand Down
2 changes: 1 addition & 1 deletion include/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) Yuxuan Shui <[email protected]>
subdirs('picom')
subdir('picom')
43 changes: 0 additions & 43 deletions include/picom/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,49 +172,6 @@ enum backend_image_capability {
BACKEND_IMAGE_CAP_DST = 1 << 1,
};

enum backend_command_op {
BACKEND_COMMAND_INVALID = -1,
BACKEND_COMMAND_BLIT,
BACKEND_COMMAND_BLUR,
BACKEND_COMMAND_COPY_AREA,
};

/// Symbolic references used as render command source images. The actual `image_handle`
/// will later be filled in by the renderer using this symbolic reference.
enum backend_command_source {
BACKEND_COMMAND_SOURCE_WINDOW,
BACKEND_COMMAND_SOURCE_WINDOW_SAVED,
BACKEND_COMMAND_SOURCE_SHADOW,
BACKEND_COMMAND_SOURCE_BACKGROUND,
};

// TODO(yshui) might need better names

struct backend_command {
enum backend_command_op op;
ivec2 origin;
enum backend_command_source source;
union {
struct {
struct backend_blit_args blit;
/// Region of the screen that will be covered by this blit
/// operations, in screen coordinates.
region_t opaque_region;
};
struct {
image_handle source_image;
const region_t *region;
} copy_area;
struct backend_blur_args blur;
};
/// Source mask for the operation.
/// If the `source_mask` of the operation's argument points to this, a mask image
/// will be created for the operation for the renderer.
struct backend_mask_image source_mask;
/// Target mask for the operation.
region_t target_mask;
};

enum backend_quirk {
/// Backend cannot do blur quickly. The compositor will avoid using blur to create
/// shadows on this backend
Expand Down
2 changes: 1 addition & 1 deletion include/picom/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) Yuxuan Shui <[email protected]>

api_headers = [
'api.h'
'api.h',
'backend.h'
]
install_headers(api_headers, subdir: 'picom')
27 changes: 14 additions & 13 deletions man/picom.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ OPTIONS
Daemonize process. Fork to background after initialization. This option can only be set from the command line, setting this in the configuration file will have no effect.
*--log-level*::
Set the log level. Possible values are "TRACE", "DEBUG", "INFO", "WARN", "ERROR", in increasing level of importance. Case doesn't matter. If using the "TRACE" log level, it's better to log into a file using *--log-file*, since it can generate a huge stream of logs.
Set the log level. Possible values are "TRACE", "VERBOSE", "DEBUG", "INFO", "WARN", "ERROR", in increasing level of importance. Case doesn't matter. If using the "TRACE" log level, it's better to log into a file using *--log-file*, since it can generate a huge stream of logs.
*--log-file*::
Set the log file. If *--log-file* is never specified, logs will be written to stderr. Otherwise, logs will to written to the given file, though some of the early logs might still be written to the stderr. When setting this option from the config file, it is recommended to use an absolute path.
Expand All @@ -71,10 +71,10 @@ OPTIONS
Show all X errors (for debugging).
*--config* _PATH_::
Look for configuration file at the path. See *CONFIGURATION FILES* section below for where picom looks for a configuration file by default. Use `/dev/null` to avoid loading configuration file.
Look for configuration file at the path. See xref:_configuration_files[*CONFIGURATION FILES*] section below for where picom looks for a configuration file by default. Use `/dev/null` to avoid loading configuration file.
*--write-pid-path* _PATH_::
Write process ID to a file. it is recommended to use an absolute path.
Write process ID to a file. It is recommended to use an absolute path.
*--plugins* _PATH_::
Specify plugins to load. Plugins will first be searched in current working directory (unless specified in the config file, in which case this step is skipped), then in `$XDG_CONFIG_HOME/picom/plugins`, then in `$XDG_CONFIG_DIRS/picom/plugins`. If all of the above fail, the plugin name is passed directly to the dynamic loader. Can be specified multiple times to load more than one plugins.
Expand Down Expand Up @@ -173,10 +173,10 @@ OPTIONS
Use _WM_TRANSIENT_FOR_ to group windows, and consider windows in the same group focused at the same time.

[[detect-client-leader]]*--detect-client-leader*::
Use _WM_CLIENT_LEADER_ to group windows, and consider windows in the same group focused at the same time. This usually means windows from the same application will be considered focused or unfocused at the same time._WM_TRANSIENT_FOR_ has higher priority if *--detect-transient* is enabled, too.
Use _WM_CLIENT_LEADER_ to group windows, and consider windows in the same group focused at the same time. This usually means windows from the same application will be considered focused or unfocused at the same time. _WM_TRANSIENT_FOR_ has higher priority if *--detect-transient* is enabled, too.

*--blur-method*, *--blur-size*, *--blur-deviation*, *--blur-strength*::
Parameters for background blurring, see the *BLUR* section for more information.
Parameters for background blurring, see the xref:_blur[*BLUR*] section for more information.

*--blur-background*::
Blur background of semi-transparent / ARGB windows. Bad in performance, with driver-dependent behavior. The name of the switch may change without prior notifications.
Expand Down Expand Up @@ -206,7 +206,7 @@ A 7x7 Gaussian blur kernel (sigma = 0.84089642) looks like:
--blur-kern '7,7,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0.000003,0.000102,0.003494,0.029143,0.059106,0.029143,0.003494,0.000102,0.000849,0.029143,0.243117,0.493069,0.243117,0.029143,0.000849,0.001723,0.059106,0.493069,0.493069,0.059106,0.001723,0.000849,0.029143,0.243117,0.493069,0.243117,0.029143,0.000849,0.000102,0.003494,0.029143,0.059106,0.029143,0.003494,0.000102,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0.000003'
----
+
May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box`, `3x3gaussian`, `5x5gaussian`, `7x7gaussian`, `9x9gaussian`, `11x11gaussian`. All Gaussian kernels are generated with sigma = 0.84089642 . If you find yourself needing to generate custom blur kernels, you might want to try the new blur configuration (See *BLUR*).
May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box`, `3x3gaussian`, `5x5gaussian`, `7x7gaussian`, `9x9gaussian`, `11x11gaussian`. All Gaussian kernels are generated with sigma = 0.84089642 . If you find yourself needing to generate custom blur kernels, you might want to try the new blur configuration (see the xref:_blur[*BLUR*] section).

[[blur-background-exclude]]*--blur-background-exclude* _CONDITION_::
Exclude conditions for background blur.
Expand All @@ -221,12 +221,11 @@ May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box
Crop shadow of a window fully on a particular monitor to that monitor. This is currently implemented using the X RandR extension.

*--backend* _BACKEND_::
Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. `xrender` is the default one.
Specify the backend to use: `xrender` or `glx`. `xrender` is the default one.
+
--
* `xrender` backend performs all rendering operations with X Render extension. It is what `xcompmgr` uses, and is generally a safe fallback when you encounter rendering artifacts or instability.
* `glx` (OpenGL) backend performs all rendering operations with OpenGL. It is more friendly to some VSync methods, and has significantly superior performance on color inversion (*--invert-color-include*) or blur (*--blur-background*). It requires proper OpenGL 2.0 support from your driver and hardware. You may wish to look at the GLX performance optimization options below. *--xrender-sync-fence* might be needed on some systems to avoid delay in changes of screen contents.
* `xr_glx_hybrid` backend renders the updated screen contents with X Render and presents it on the screen with GLX. It attempts to address the rendering issues some users encountered with GLX backend and enables the better VSync of GLX backends. *--vsync-use-glfinish* might fix some rendering issues with this backend.
--

*--no-use-damage*::
Expand All @@ -239,7 +238,7 @@ May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box
Force all windows to be painted with blending. Useful if you have a window shader that could turn opaque pixels transparent.

*--dbus*::
Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
Enable remote control via D-Bus. See the xref:_d_bus_api[*D-BUS API*] section below for more details.

*--benchmark* _CYCLES_::
Benchmark mode. Repeatedly paint until reaching the specified cycles.
Expand Down Expand Up @@ -510,9 +509,11 @@ animations = ({

_decrease-opacity_:: When the opacity of a window is decreased.

[[trigger-geometry]]_geometry_:: When the geometry of a window is changed. (EXPERIMENTAL)
_size_, _position_:: When the size or position of a window is changed. If both changed, the position trigger has priority. (EXPERIMENTAL)

[[trigger-geometry]]_geometry_:: Alias of size + position.
+
WARNING: The _geometry_ trigger is experimental. Using this means you accept the caveat that geometry animations will also trigger when you manually resize or move a window, like when you drag the window around with your mouse.
WARNING: The _size_ and _position_ triggers are experimental. Using this means you accept the caveat that these animations will also trigger when you manually resize or move a window, like when you drag the window around with your mouse.

_suppressions_:::
Which other animations should be suppressed when this animation is running. Normally, if another trigger is activated while an animation is already running, the animation in progress will be interrupted and the new animation will start. If you want to prevent this, you can set the `suppressions` option to a list of triggers that should be suppressed. This is optional, the default value for this is an empty list.
Expand Down Expand Up @@ -750,11 +751,11 @@ If you have created an animation script that you think is particularly cool, you
SHADER INTERFACE
----------------
This secion describes the interface of a custom shader, how it is used by picom, and what parameters are passed by picom to the shader.
This section describes the interface of a custom shader, how it is used by picom, and what parameters are passed by picom to the shader.
A custom shader is a GLSL fragment shader program, which can be used to override the default way of how a window is rendered. If a custom shader is used, the default picom effects (e.g. dimming, color inversion, etc.) will no longer be automatically applied. It would be the custom shader's responsibility to apply these effects.
The interface between picom and a custom shader is dependent on which backend is being used. The xrender backend doesn't support shader at all. Here we descibe the interface provided by the glx backend.
The interface between picom and a custom shader is dependent on which backend is being used. The xrender backend doesn't support shader at all. Here we describe the interface provided by the glx backend.
The shader must define a function, _vec4 window_shader()_, which would be the entry point of the shader. The returned _vec4_ will be used to set __gl_FragColor__. A function, _vec4 default_post_processing(vec4 c)_, is provided for applying the default picom effects to input color 'c'.
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ test_h_dep = subproject('test.h').get_variable('test_h_dep')
subdir('src')
subdir('man')
subdir('tools')
subdir('include')

install_data('bin/picom-trans', install_dir: get_option('bindir'))
install_data('picom.desktop', install_dir: 'share/applications')
Expand Down
Loading

0 comments on commit e7726a2

Please sign in to comment.