Skip to content

Commit e9e1cdc

Browse files
committed
Merge branch 'next' into feat-convert-legacy-parameters-to-rules
1 parent e83bf64 commit e9e1cdc

38 files changed

+1070
-415
lines changed

.github/workflows/cross.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: cross
2+
on: push
3+
4+
jobs:
5+
check:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
with:
10+
fetch-depth: 1
11+
- uses: cachix/install-nix-action@v27
12+
with:
13+
nix_path: nixpkgs=channel:nixpkgs-unstable
14+
- uses: DeterminateSystems/magic-nix-cache-action@main
15+
- run: nix build '.#picom-cross.merged' -L
16+

.github/workflows/page.yml

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
asciidoctor -a doctype=article -a stylesheet=../assets/next.css -b html man/picom-trans.1.adoc -D _site
3333
cp -r assets _site/
3434
cp _site/picom.1.html _site/index.html
35+
- name: Copy .well-known
36+
run: cp -r .well-known _site
3537

3638
- name: Upload
3739
uses: actions/upload-pages-artifact@v3

.well-known/funding-manifest-urls

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://yshui.github.io/funding.json

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
- `sw-opti`
1515
- `clear-shadow`
1616

17+
# 12.x (unreleased)
18+
19+
## Build fixes
20+
21+
* Fix build on arm32 (#1355)
22+
1723
# 12.3 (2024-Oct-14)
1824

1925
## Improvements

flake.nix

+34-49
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,22 @@
77
inputs.nixpkgs.follows = "nixpkgs";
88
};
99
};
10-
outputs = {
11-
self,
12-
flake-utils,
13-
nixpkgs,
14-
git-ignore-nix,
15-
...
16-
}:
17-
flake-utils.lib.eachDefaultSystem (system: let
10+
outputs =
11+
{ self
12+
, flake-utils
13+
, nixpkgs
14+
, git-ignore-nix
15+
, ...
16+
}:
17+
flake-utils.lib.eachDefaultSystem (system:
18+
let
1819
# like lib.lists.remove, but takes a list of elements to remove
1920
removeFromList = toRemove: list: pkgs.lib.foldl (l: e: pkgs.lib.remove e l) list toRemove;
20-
overlay = self: super: {
21-
picom = super.picom.overrideAttrs (oldAttrs: rec {
22-
version = "11";
23-
pname = "picom";
24-
nativeBuildInputs = (removeFromList [ self.asciidoc ] oldAttrs.nativeBuildInputs) ++
25-
[
26-
self.asciidoctor
27-
];
28-
buildInputs =
29-
[
30-
self.pcre2
31-
self.xorg.xcbutil
32-
self.libepoxy
33-
] ++ (removeFromList [
34-
self.xorg.libXinerama
35-
self.xorg.libXext
36-
self.pcre
37-
] oldAttrs.buildInputs);
38-
src = git-ignore-nix.lib.gitignoreSource ./.;
39-
});
40-
};
41-
python = pkgs.python3.withPackages (ps: with ps; [
42-
xcffib pip dbus-next
43-
]);
44-
21+
picomOverlay = final: prev: { picom = prev.callPackage ./package.nix { }; };
22+
overlays = [
23+
(final: prev: { inherit git-ignore-nix; })
24+
picomOverlay
25+
];
4526
pkgs = import nixpkgs {
4627
inherit system overlays;
4728
config.allowBroken = true;
@@ -60,15 +41,8 @@
6041
];
6142
};
6243

63-
overlays = [overlay];
6444
mkDevShell = p: p.overrideAttrs (o: {
65-
nativeBuildInputs = o.nativeBuildInputs ++ (with pkgs; [
66-
clang-tools_18
67-
llvmPackages_18.clang-unwrapped.python
68-
llvmPackages_18.libllvm
69-
python
70-
]);
71-
hardeningDisable = ["fortify"];
45+
hardeningDisable = [ "fortify" ];
7246
shellHook = ''
7347
# Workaround a NixOS limitation on sanitizers:
7448
# See: https://github.com/NixOS/nixpkgs/issues/287763
@@ -77,21 +51,32 @@
7751
export ASAN_OPTIONS="disable_coredump=0:unmap_shadow_on_exit=1:abort_on_error=1"
7852
'';
7953
});
80-
in rec {
81-
inherit
82-
overlay
83-
overlays
84-
;
54+
in
55+
rec {
56+
overlay = picomOverlay;
8557
packages = {
58+
picom = pkgs.picom;
8659
default = pkgs.picom;
87-
};
88-
devShells.default = mkDevShell packages.default;
60+
} // (nixpkgs.lib.optionalAttrs (system == "x86_64-linux") rec {
61+
picom-cross = {
62+
armv7l = pkgs.pkgsCross.armv7l-hf-multiplatform.picom;
63+
aarch64 = pkgs.pkgsCross.aarch64-multiplatform.picom;
64+
i686 = pkgs.pkgsi686Linux.picom;
65+
merged = pkgs.runCommand "picom-merged" {} ''
66+
mkdir $out
67+
ln -s ${picom-cross.armv7l} $out/armv7l
68+
ln -s ${picom-cross.aarch64} $out/aarch64
69+
ln -s ${picom-cross.i686} $out/i686
70+
'';
71+
};
72+
});
73+
devShells.default = mkDevShell (packages.default.override { devShell = true; });
8974
devShells.useClang = devShells.default.override {
9075
inherit (pkgs.llvmPackages_18) stdenv;
9176
};
9277
# build picom and all dependencies with frame pointer, making profiling/debugging easier.
9378
# WARNING! many many rebuilds
94-
devShells.useClangProfile = (mkDevShell profilePkgs.picom).override {
79+
devShells.useClangProfile = (mkDevShell (profilePkgs.picom.override { devShell = true; })).override {
9580
stdenv = profilePkgs.withCFlags "-fno-omit-frame-pointer" profilePkgs.llvmPackages_18.stdenv;
9681
};
9782
});

include/picom/backend.h

-43
Original file line numberDiff line numberDiff line change
@@ -172,49 +172,6 @@ enum backend_image_capability {
172172
BACKEND_IMAGE_CAP_DST = 1 << 1,
173173
};
174174

175-
enum backend_command_op {
176-
BACKEND_COMMAND_INVALID = -1,
177-
BACKEND_COMMAND_BLIT,
178-
BACKEND_COMMAND_BLUR,
179-
BACKEND_COMMAND_COPY_AREA,
180-
};
181-
182-
/// Symbolic references used as render command source images. The actual `image_handle`
183-
/// will later be filled in by the renderer using this symbolic reference.
184-
enum backend_command_source {
185-
BACKEND_COMMAND_SOURCE_WINDOW,
186-
BACKEND_COMMAND_SOURCE_WINDOW_SAVED,
187-
BACKEND_COMMAND_SOURCE_SHADOW,
188-
BACKEND_COMMAND_SOURCE_BACKGROUND,
189-
};
190-
191-
// TODO(yshui) might need better names
192-
193-
struct backend_command {
194-
enum backend_command_op op;
195-
ivec2 origin;
196-
enum backend_command_source source;
197-
union {
198-
struct {
199-
struct backend_blit_args blit;
200-
/// Region of the screen that will be covered by this blit
201-
/// operations, in screen coordinates.
202-
region_t opaque_region;
203-
};
204-
struct {
205-
image_handle source_image;
206-
const region_t *region;
207-
} copy_area;
208-
struct backend_blur_args blur;
209-
};
210-
/// Source mask for the operation.
211-
/// If the `source_mask` of the operation's argument points to this, a mask image
212-
/// will be created for the operation for the renderer.
213-
struct backend_mask_image source_mask;
214-
/// Target mask for the operation.
215-
region_t target_mask;
216-
};
217-
218175
enum backend_quirk {
219176
/// Backend cannot do blur quickly. The compositor will avoid using blur to create
220177
/// shadows on this backend

man/picom.1.adoc

+10-11
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ OPTIONS
6262
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.
6363
6464
*--log-level*::
65-
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.
65+
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.
6666
6767
*--log-file*::
6868
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.
@@ -71,10 +71,10 @@ OPTIONS
7171
Show all X errors (for debugging).
7272
7373
*--config* _PATH_::
74-
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.
74+
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.
7575
7676
*--write-pid-path* _PATH_::
77-
Write process ID to a file. it is recommended to use an absolute path.
77+
Write process ID to a file. It is recommended to use an absolute path.
7878
7979
*--plugins* _PATH_::
8080
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.
@@ -173,10 +173,10 @@ OPTIONS
173173
Use _WM_TRANSIENT_FOR_ to group windows, and consider windows in the same group focused at the same time.
174174

175175
[[detect-client-leader]]*--detect-client-leader*::
176-
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.
176+
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.
177177

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

181181
*--blur-background*::
182182
Blur background of semi-transparent / ARGB windows. Bad in performance, with driver-dependent behavior. The name of the switch may change without prior notifications.
@@ -206,7 +206,7 @@ A 7x7 Gaussian blur kernel (sigma = 0.84089642) looks like:
206206
--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'
207207
----
208208
+
209-
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*).
209+
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).
210210

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

223223
*--backend* _BACKEND_::
224-
Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. `xrender` is the default one.
224+
Specify the backend to use: `xrender` or `glx`. `xrender` is the default one.
225225
+
226226
--
227227
* `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.
228228
* `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.
229-
* `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.
230229
--
231230

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

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

244243
*--benchmark* _CYCLES_::
245244
Benchmark mode. Repeatedly paint until reaching the specified cycles.
@@ -750,11 +749,11 @@ If you have created an animation script that you think is particularly cool, you
750749
SHADER INTERFACE
751750
----------------
752751
753-
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.
752+
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.
754753
755754
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.
756755
757-
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.
756+
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.
758757
759758
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'.
760759

package.nix

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{ asciidoctor
2+
, dbus
3+
, docbook_xml_dtd_45
4+
, docbook_xsl
5+
, fetchFromGitHub
6+
, clang-tools_18
7+
, llvmPackages_18
8+
, lib
9+
, libconfig
10+
, libdrm
11+
, libev
12+
, libGL
13+
, libepoxy
14+
, libX11
15+
, libxcb
16+
, libxdg_basedir
17+
, libXext
18+
, libxml2
19+
, libxslt
20+
, makeWrapper
21+
, meson
22+
, ninja
23+
, pcre2
24+
, pixman
25+
, pkg-config
26+
, python3
27+
, stdenv
28+
, uthash
29+
, xcbutil
30+
, xcbutilimage
31+
, xcbutilrenderutil
32+
, xorgproto
33+
, xwininfo
34+
, withDebug ? false
35+
, git-ignore-nix
36+
, devShell ? false
37+
}:
38+
39+
let
40+
versionFromMeson = s: builtins.head (builtins.match "project\\('picom',.*version: *'([0-9.]*)'.*" s);
41+
in
42+
stdenv.mkDerivation (finalAttrs: {
43+
pname = "picom";
44+
version = versionFromMeson (builtins.readFile ./meson.build);
45+
46+
src = git-ignore-nix.lib.gitignoreSource ./.;
47+
48+
strictDeps = true;
49+
50+
51+
nativeBuildInputs = [
52+
asciidoctor
53+
docbook_xml_dtd_45
54+
docbook_xsl
55+
makeWrapper
56+
meson
57+
ninja
58+
pkg-config
59+
] ++ (lib.optional devShell [
60+
clang-tools_18
61+
llvmPackages_18.clang-unwrapped.python
62+
llvmPackages_18.libllvm
63+
(python3.withPackages (ps: with ps; [
64+
xcffib pip dbus-next
65+
]))
66+
]);
67+
68+
buildInputs = [
69+
dbus
70+
libconfig
71+
libdrm
72+
libev
73+
libGL
74+
libepoxy
75+
libX11
76+
libxcb
77+
libxdg_basedir
78+
libXext
79+
libxml2
80+
libxslt
81+
pcre2
82+
pixman
83+
uthash
84+
xcbutil
85+
xcbutilimage
86+
xcbutilrenderutil
87+
xorgproto
88+
];
89+
90+
# Use "debugoptimized" instead of "debug" so perhaps picom works better in
91+
# normal usage too, not just temporary debugging.
92+
mesonBuildType = if withDebug then "debugoptimized" else "release";
93+
dontStrip = withDebug;
94+
95+
mesonFlags = [
96+
"-Dwith_docs=true"
97+
];
98+
99+
installFlags = [ "PREFIX=$(out)" ];
100+
101+
# In debug mode, also copy src directory to store. If you then run `gdb picom`
102+
# in the bin directory of picom store path, gdb finds the source files.
103+
postInstall = ''
104+
wrapProgram $out/bin/picom-trans \
105+
--prefix PATH : ${lib.makeBinPath [ xwininfo ]}
106+
'' + lib.optionalString withDebug ''
107+
cp -r ../src $out/
108+
'';
109+
})

0 commit comments

Comments
 (0)