Merge pull request #254 from yshui/rename

Rename
This commit is contained in:
yshui 2019-10-23 20:30:34 +01:00 committed by GitHub
commit 43b21731f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 213 additions and 143 deletions

View File

@ -54,10 +54,10 @@ jobs:
command: ninja -vC build test
- run:
name: test config file parsing
command: xvfb-run -s "-screen 0 640x480x24" build/src/compton --config compton.sample.conf --vsync=none --diagnostics
command: xvfb-run -s "-screen 0 640x480x24" build/src/picom --config picom.sample.conf --no-vsync --diagnostics
- run:
name: run testsuite
command: tests/run_tests.sh build/src/compton
command: tests/run_tests.sh build/src/picom
- run:
name: generate coverage reports
command: cd build; find -name '*.gcno' -exec gcov -pb {} +

View File

@ -13,12 +13,12 @@
### Environment
<!-- Tell us something about the desktop environment you are using, for example: i3-gaps, Gnome Shell, etc. -->
### Compton version
<!-- Put the output of `compton --version` here. -->
<!-- If you are running compton v4 or later, please also include the output of `compton --diagnostics` -->
### picom version
<!-- Put the output of `compton --version` or `picom --version` here. -->
<!-- If you are running compton v4 or later, please also include the output of `compton --diagnostics` or `picom --diagnostics` -->
<!-- Example: v1 -->
### Compton configuration:
### Configuration:
```
// Paste your configuration here
```
@ -38,12 +38,12 @@
### Stack trace
<!--
If compton crashes, please make sure your compton is built with debug info, and provide a stack trace of compton when it crashed.
Note, when compton crashes in a debugger, your screen might look frozen. But gdb will likely still handle your input if it is focused.
If the compositor crashes, please make sure you built it with debug info, and provide a stack trace captured when it crashed.
Note, when the compositor crashes in a debugger, your screen might look frozen. But gdb will likely still handle your input if it is focused.
Often you can use 'bt' and press enter to get the stack trace, then 'q', enter, 'y', enter to quit gdb.
-->
<!-- Or, you can enable core dump, and upload the core file and the compton executable here. -->
<!-- Or, you can enable core dump, and upload the core file with the corresponding executable here. -->
### Other details
<!-- If your problem is visual, you are encouraged to record a short video when the problem occurs and link to it here. -->

View File

@ -1,11 +1,11 @@
compton - a compositor for X11
picom - a compositor for X11
Based on xcompmgr, originally written by Keith Packard, with modifications
from several contributors (according to the xcompmgr man page): Matthew Allum,
Eric Anholt, Dan Doel, Thomas Luebking, Matthew Hawn, Ely Levy, Phil Blundell,
and Carl Worth. Menu transparency was implemented by Dana Jansens.
Numerous contributions to compton from Richard Grenville.
Numerous contributions to picom from Richard Grenville.
See the CONTRIBUTORS file for a complete list of contributors

View File

@ -1,4 +1,4 @@
SPDXVersion: SPDX-2.1
DataLicense: CC0-1.0
PackageName: compton
PackageName: picom
PackageLicenseDeclared: MPL-2.0 AND MIT

View File

@ -25,6 +25,36 @@ To test the new backends, add the `--experimental-backends` flag to the command
To report issues with the new backends, please state explicitly you are using the new backends in your report.
## Rename
### Rational
Since the inception of this fork, the existence of two compton repositories has caused some number of confusions. Mainly, people will report issues of this fork to the original compton, or report issues of the original compton here. Later, when distros started packaging this fork of compton, some wanted to differentiate the newer compton from the older version. They found themselves having no choice but to invent a name for this fork. This is less than ideal since this has the potential to cause more confusions among users.
Therefore, we decided to move this fork to a new name. Personally, I consider this more than justified since this version of compton has gone through significant changes since it was forked.
### The name
The criteria for a good name were
0. Being short, so it's easy to remember.
1. Pronounceability, again, helps memorability
2. Searchability, so when people searches the name, it's easy for them to find this repository.
Of course, choosing a name is never easy, and there is no apparent way to objectively evaluate the names. Yet, we have to solve aforementioned problems as soon as possible.
In the end, we picked `picom` (a portmanteau of `pico` and `composite`) as our new name. This name might not be perfect, but is what we will move forward with unless there's a compelling reason not to.
### Migration
Following the [deprecation process](https://github.com/yshui/compton/issues/114), migration to the new name will be broken into 3 steps:
1. All mentions to `compton` will be updated to `picom` in the code base. `compton` will still be installed, but only as a symlink to `picom`. When `picom` is launched via the symlink, a warning message is printed, alerting the user to migrate. Similarly, the old configuration file names and dbus interface names will still be accepted but warned.
2. 3 major releases after step 1, the warning messages will be prompted to error messages and `picom` will not start when launched via the symlink.
3. 3 major releases after step 2, the symlink will be removed.
The dbus interface and service names are unchanged, so no migration needed for that.
## Change Log
See [Releases](https://github.com/yshui/compton/releases)

View File

@ -1,28 +1,32 @@
#!/bin/sh
#
# compton-trans
# picom-trans
# transset in a bash script
# Copyright (c) 2011-2012, Christopher Jeffrey
#
# Usage:
# $ compton-trans [options] [+|-]opacity
# $ picom-trans [options] [+|-]opacity
# By window id
# $ compton-trans -w "$WINDOWID" 75
# $ picom-trans -w "$WINDOWID" 75
# By name
# $ compton-trans -n "urxvt" 75
# $ picom-trans -n "urxvt" 75
# By current window
# $ compton-trans -c 75
# $ picom-trans -c 75
# By selection
# $ compton-trans 75
# $ compton-trans -s 75
# $ picom-trans 75
# $ picom-trans -s 75
# Increment current window 5%
# $ compton-trans -c +5
# $ picom-trans -c +5
# Delete current window's opacity
# $ compton-trans -c --delete
# $ picom-trans -c --delete
# Reset all windows
# $ compton-trans --reset
# $ picom-trans --reset
case "$0" in
*compton-trans*) echo "Warning: compton has been renamed, please use picom-trans instead" >& 2;;
esac
# "command" is a shell built-in, faster than "which"
if test -z "$(command -v xprop)" -o -z "$(command -v xwininfo)"; then
@ -51,8 +55,8 @@ done
# This takes into account the fact that getopts stops on
# any argument it doesn't recognize or errors on. This
# allows for things like `compton-trans -5` as well
# as `compton-trans -c +5 -s` (contrived example).
# allows for things like `picom-trans -5` as well
# as `picom-trans -c +5 -s` (contrived example).
while test $# -gt 0; do
# Reset option index
OPTIND=1

View File

@ -1,10 +1,10 @@
mans = ['compton.1', 'compton-trans.1']
mans = ['picom.1', 'picom-trans.1']
if get_option('with_docs')
a2x = find_program('a2x')
foreach m : mans
custom_target(m, output: [m], input: [m+'.asciidoc'],
command: [a2x, '-a',
'compton-version='+version,
'picom-version='+version,
'--format', 'manpage', '@INPUT@', '-D',
meson.current_build_dir()],
install: true, install_dir: 'share/man/man1/')

View File

@ -1,23 +1,23 @@
compton-trans(1)
picom-trans(1)
================
:doctype: manpage
:man source: compton
:man version: {compton-version}
:man source: picom
:man version: {picom-version}
:man manual: User Commands
NAME
----
compton-trans - an opacity setter tool
picom-trans - an opacity setter tool
SYNOPSIS
--------
*compton-trans* [-w 'WINDOW_ID'] [-n 'WINDOW_NAME'] [-c] [-s] 'OPACITY'
*picom-trans* [-w 'WINDOW_ID'] [-n 'WINDOW_NAME'] [-c] [-s] 'OPACITY'
DESCRIPTION
-----------
*compton-trans* is a bash script that sets '_NET_WM_WINDOW_OPACITY' attribute of a window using standard X11 command-line utilities, including *xprop*(1) and *xwininfo*(1). It is similar to *transset*(1) or *transset-df*(1).
*picom-trans* is a bash script that sets '_NET_WM_WINDOW_OPACITY' attribute of a window using standard X11 command-line utilities, including *xprop*(1) and *xwininfo*(1). It is similar to *transset*(1) or *transset-df*(1).
OPTIONS
-------
@ -42,37 +42,37 @@ EXAMPLES
* Set the opacity of the window with specific window ID to 75%:
+
------------
compton-trans -w "$WINDOWID" 75
picom-trans -w "$WINDOWID" 75
------------
* Set the opacity of the window with the name "urxvt" to 75%:
+
------------
compton-trans -n "urxvt" 75
picom-trans -n "urxvt" 75
------------
* Set current window to opacity of 75%:
+
------------
compton-trans -c 75
picom-trans -c 75
------------
* Select target window and set opacity to 75%:
+
------------
compton-trans -s 75
picom-trans -s 75
------------
* Increment opacity of current active window by 5%:
+
------------
compton-trans -c +5
picom-trans -c +5
------------
* Decrement opacity of current active window by 5%:
+
------------
compton-trans -c -- -5
picom-trans -c -- -5
------------
BUGS
@ -81,4 +81,4 @@ Please submit bug reports to <https://github.com/yshui/compton>.
SEE ALSO
--------
link:compton.1.html[*compton*(1)], *xprop*(1), *xwininfo*(1)
link:picom.1.html[*picom*(1)], *xprop*(1), *xwininfo*(1)

View File

@ -1,21 +1,21 @@
compton(1)
picom(1)
==========
:doctype: manpage
:man source: compton
:man version: {compton-version}
:man source: picom
:man version: {picom-version}
:man manual: User Commands
NAME
----
compton - a compositor for X11
picom - a compositor for X11
SYNOPSIS
--------
*compton* ['OPTIONS']
*picom* ['OPTIONS']
DESCRIPTION
-----------
compton is a compositor based on Dana Jansens' version of xcompmgr (which itself was written by Keith Packard). It includes some improvements over the original xcompmgr, like window frame opacity and inactive window transparency.
picom is a compositor based on Dana Jansens' version of xcompmgr (which itself was written by Keith Packard). It includes some improvements over the original xcompmgr, like window frame opacity and inactive window transparency.
OPTIONS
-------
@ -83,7 +83,7 @@ OPTIONS
Show all X errors (for debugging).
*--config* 'PATH'::
Look for configuration file at the path. See *CONFIGURATION FILES* section below for where compton looks for a configuration file by default. Use `/dev/null` to avoid loading configuration file.
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.
*--write-pid-path* 'PATH'::
Write process ID to a file.
@ -128,13 +128,13 @@ OPTIONS
Detect '_NET_WM_OPACITY' on client windows, useful for window managers not passing '_NET_WM_OPACITY' of client windows to frame windows.
*--refresh-rate* 'REFRESH_RATE'::
Specify refresh rate of the screen. If not specified or 0, compton will try detecting this with X RandR extension.
Specify refresh rate of the screen. If not specified or 0, picom will try detecting this with X RandR extension.
*--vsync*, *--no-vsync*::
Enable/disable VSync.
*--sw-opti*::
Limit compton to repaint at most once every 1 / 'refresh_rate' second to boost performance. This should not be used with *--vsync* drm/opengl/opengl-oml as they essentially does *--sw-opti*'s job already, unless you wish to specify a lower refresh rate than the actual value.
Limit picom to repaint at most once every 1 / 'refresh_rate' second to boost performance. This should not be used with *--vsync* drm/opengl/opengl-oml as they essentially does *--sw-opti*'s job already, unless you wish to specify a lower refresh rate than the actual value.
*--use-ewmh-active-win*::
Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, provided that the WM supports it.
@ -209,7 +209,7 @@ May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box
Specify a list of conditions of windows that should be painted with inverted color. Resource-hogging, and is not well tested.
*--opacity-rule* 'OPACITY':'CONDITION'::
Specify a list of opacity rules, in the format `PERCENT:PATTERN`, like `50:name *= "Firefox"`. compton-trans is recommended over this. Note we don't make any guarantee about possible conflicts with other programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
Specify a list of opacity rules, in the format `PERCENT:PATTERN`, like `50:name *= "Firefox"`. picom-trans is recommended over this. Note we don't make any guarantee about possible conflicts with other programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
*--shadow-exclude-reg* 'GEOMETRY'::
Specify a X geometry that describes the region in which shadow should not be painted in, such as a dock window region. Use `--shadow-exclude-reg x10+0-0`, for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
@ -236,7 +236,7 @@ May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box
Disable the use of damage information. This cause the whole screen to be redrawn everytime, instead of the part of the screen has actually changed. Potentially degrades the performance, but might fix some artifacts.
*--xrender-sync-fence*::
Use X Sync fence to sync clients' draw calls, to make sure all draw calls are finished before compton starts drawing. Needed on nvidia-drivers with GLX backend for some users.
Use X Sync fence to sync clients' draw calls, to make sure all draw calls are finished before picom starts drawing. Needed on nvidia-drivers with GLX backend for some users.
*--glx-fshader-win* 'SHADER'::
GLX backend: Use specified GLSL fragment shader for rendering window contents. See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl` in the source tree for examples.
@ -342,9 +342,9 @@ This is the old condition format we once used. Support of this format might be r
CONFIGURATION FILES
-------------------
compton could read from a configuration file if libconfig support is compiled in. If *--config* is not used, compton will seek for a configuration file in `$XDG_CONFIG_HOME/compton.conf` (`~/.config/compton.conf`, usually), then `~/.compton.conf`, then `compton.conf` under `$XDG_CONFIG_DIRS` (often `/etc/xdg/compton.conf`).
picom could read from a configuration file if libconfig support is compiled in. If *--config* is not used, picom will seek for a configuration file in `$XDG_CONFIG_HOME/compton.conf` (`~/.config/compton.conf`, usually), then `~/.compton.conf`, then `compton.conf` under `$XDG_CONFIG_DIRS` (often `/etc/xdg/compton.conf`).
compton uses general libconfig configuration file format. A sample configuration file is available as `compton.sample.conf` in the source tree. Most of commandline switches can be used as options in configuration file as well. For example, *--vsync* option documented above can be set in the configuration file using `vsync = `. Command line options will always overwrite the settings in the configuration file.
picom uses general libconfig configuration file format. A sample configuration file is available as `compton.sample.conf` in the source tree. Most of commandline switches can be used as options in configuration file as well. For example, *--vsync* option documented above can be set in the configuration file using `vsync = `. Command line options will always overwrite the settings in the configuration file.
Window-type-specific settings are exposed only in configuration file and has the following format:
@ -406,12 +406,12 @@ Available options of the 'blur' section are: ::
SIGNALS
-------
* compton reinitializes itself upon receiving `SIGUSR1`.
* picom reinitializes itself upon receiving `SIGUSR1`.
D-BUS API
---------
It's possible to control compton via D-Bus messages, by running compton with *--dbus* and send messages to `com.github.chjj.compton.<DISPLAY>`. `<DISPLAY>` is the display used by compton, with all non-alphanumeric characters transformed to underscores. For `DISPLAY=:0.0` you should use `com.github.chjj.compton._0_0`, for example.
It's possible to control picom via D-Bus messages, by running picom with *--dbus* and send messages to `com.github.chjj.compton.<DISPLAY>`. `<DISPLAY>` is the display used by picom, with all non-alphanumeric characters transformed to underscores. For `DISPLAY=:0.0` you should use `com.github.chjj.compton._0_0`, for example.
The D-Bus methods and signals are not yet stable, thus undocumented right now.
@ -421,37 +421,37 @@ EXAMPLES
* Disable configuration file parsing:
+
------------
$ compton --config /dev/null
$ picom --config /dev/null
------------
* Run compton with client-side shadow and fading, disable shadow on dock windows and drag-and-drop windows:
* Run picom with client-side shadow and fading, disable shadow on dock windows and drag-and-drop windows:
+
------------
$ compton -cCGf
$ picom -cCGf
------------
* Same thing as above, plus making inactive windows 80% transparent, making frame 80% transparent, don't fade on window open/close, enable software optimization, and fork to background:
+
------------
$ compton -bcCGf -i 0.8 -e 0.8 --no-fading-openclose --sw-opti
$ picom -bcCGf -i 0.8 -e 0.8 --no-fading-openclose --sw-opti
------------
* Draw white shadows:
+
------------
$ compton -c --shadow-red 1 --shadow-green 1 --shadow-blue 1
$ picom -c --shadow-red 1 --shadow-green 1 --shadow-blue 1
------------
* Avoid drawing shadows on wbar window:
+
------------
$ compton -c --shadow-exclude 'class_g = "wbar"'
$ picom -c --shadow-exclude 'class_g = "wbar"'
------------
* Enable VSync with GLX backend:
+
------------
$ compton --backend glx --vsync
$ picom --backend glx --vsync
------------
BUGS
@ -466,4 +466,4 @@ Homepage: <https://github.com/yshui/compton>
SEE ALSO
--------
*xcompmgr*(1), link:compton-trans.html[*compton-trans*(1)]
*xcompmgr*(1), link:picom-trans.html[*picom-trans*(1)]

View File

@ -1,4 +1,4 @@
project('compton', 'c', version: '7',
project('picom', 'c', version: '7',
default_options: ['c_std=c11'])
cc = meson.get_compiler('c')
@ -43,7 +43,7 @@ if get_option('modularize')
add_global_arguments(['-fmodules',
'-fmodule-map-file='+
meson.current_source_dir()+
'/src/compton.modulemap'],
'/src/picom.modulemap'],
language: 'c')
endif
@ -69,9 +69,12 @@ test_h_dep = subproject('test.h').get_variable('test_h_dep')
subdir('src')
subdir('man')
install_data('bin/compton-trans', install_dir: get_option('bindir'))
install_data('bin/picom-trans', install_dir: get_option('bindir'))
install_data('compton.desktop', install_dir: 'share/applications')
install_data('picom.desktop', install_dir: 'share/applications')
install_data('media/icons/48x48/compton.png',
install_dir: 'share/icons/hicolor/48x48/apps')
install_data('media/compton.svg',
install_dir: 'share/icons/hicolor/scalable/apps')
meson.add_install_script('meson/install.sh')

11
meson/install.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
if [ ! -e "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton" ]; then
echo "Linking picom to ${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton"
ln -s picom "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton"
fi
if [ ! -e "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans" ]; then
echo "Linking picom-trans to ${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans"
ln -s picom-trans "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans"
fi

View File

@ -1,4 +1,4 @@
option('sanitize', type: 'boolean', value: false, description: 'Compile compton with sanitizers')
option('sanitize', type: 'boolean', value: false, description: 'Build with sanitizers enabled (deprecated)')
option('config_file', type: 'boolean', value: true, description: 'Enable config file support')
option('regex', type: 'boolean', value: true, description: 'Enable regex support in window conditions')

11
picom.desktop Normal file
View File

@ -0,0 +1,11 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=picom
GenericName=X compositor
Comment=A X compositor
Categories=Utility;
Keywords=compositor;composite manager;window effects;transparency;opacity;
TryExec=picom
Exec=picom
# Thanks to quequotion for providing this file!

View File

@ -220,7 +220,7 @@ struct backend_operations {
/// Let the backend hook into the event handling queue
/// Not implemented yet
void (*set_ready_callback)(backend_t *, backend_ready_callback_t cb);
/// Called right after compton has handled its events.
/// Called right after the core has handled its events.
/// Not implemented yet
void (*handle_events)(backend_t *);
// =========== Misc ============

View File

@ -50,7 +50,7 @@ struct gl_blur_context {
static GLint glGetUniformLocationChecked(GLuint p, const char *name) {
auto ret = glGetUniformLocation(p, name);
if (ret < 0) {
log_error("Failed to get location of uniform '%s'. compton might not "
log_error("Failed to get location of uniform '%s'. the compositor might not "
"work correctly.",
name);
}

View File

@ -26,7 +26,7 @@
#include "backend/gl/glx.h"
#include "common.h"
#include "compiler.h"
#include "compton.h"
#include "picom.h"
#include "config.h"
#include "log.h"
#include "region.h"
@ -109,7 +109,7 @@ struct glx_fbconfig_info *glx_find_fbconfig(Display *dpy, int screen, struct xvi
glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BIND_TO_TEXTURE_RGB_EXT, &rgb);
glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BIND_TO_TEXTURE_RGBA_EXT, &rgba);
if (!rgb && !rgba) {
log_info("FBConfig is neither RGBA nor RGB, compton cannot "
log_info("FBConfig is neither RGBA nor RGB, we cannot "
"handle this setup.");
continue;
}
@ -466,7 +466,7 @@ static void glx_present(backend_t *base, const region_t *region attr_unused) {
struct _glx_data *gd = (void *)base;
gl_present(base, region);
glXSwapBuffers(gd->display, gd->target_win);
// XXX there should be no need to block compton will wait for render to finish
// XXX there should be no need to block, the core should wait for render to finish
if (!gd->gl.is_nvidia) {
glFinish();
}

View File

@ -14,7 +14,7 @@
#include "backend/backend.h"
#include "backend/backend_common.h"
#include "common.h"
#include "compton.h"
#include "picom.h"
#include "config.h"
#include "kernel.h"
#include "log.h"

View File

@ -1028,7 +1028,7 @@ static bool c2_l_postprocess(session_t *ps, c2_l_t *pleaf) {
}
}
// Enable specific tracking options in compton if needed by the condition
// Enable specific tracking options, if needed by the condition
// TODO: Add track_leader
switch (pleaf->predef) {
// case C2_L_PROUNDED: ps->o.detect_rounded_corners = true; break;

View File

@ -125,7 +125,7 @@ typedef struct _latom {
struct _latom *next;
} latom_t;
/// Structure containing all necessary data for a compton session.
/// Structure containing all necessary data for a session.
typedef struct session {
// === Event handlers ===
/// ev_io for X connection
@ -184,7 +184,7 @@ typedef struct session {
xcb_window_t overlay;
/// The target window for debug mode
xcb_window_t debug_window;
/// Whether the root tile is filled by compton.
/// Whether the root tile is filled by us.
bool root_tile_fill;
/// Picture of the root window background.
paint_t root_tile_paint;
@ -241,7 +241,7 @@ typedef struct session {
ignore_t **ignore_tail;
// Cached blur convolution kernels.
struct x_convolution_kernel **blur_kerns_cache;
/// If compton should quit
/// If we should quit
bool quit:1;
/// Whether there are pending updates, like window creation, etc.
/// TODO use separate flags for dfferent kinds of updates so we don't

View File

@ -20,8 +20,8 @@ module utils {
module region {
header "region.h"
}
module compton {
header "compton.h"
module picom {
header "picom.h"
}
module types {
header "types.h"

View File

@ -28,7 +28,7 @@
typedef struct session session_t;
/// @brief Possible backends of compton.
/// @brief Possible backends
enum backend {
BKEND_XRENDER,
BKEND_GLX,
@ -226,9 +226,9 @@ typedef struct options {
bool detect_client_leader;
// === Calculated ===
/// Whether compton needs to track window name and class.
/// Whether we need to track window name and class.
bool track_wdata;
/// Whether compton needs to track window leaders.
/// Whether we need to track window leaders.
bool track_leader;
// Don't use EWMH to detect fullscreen applications

View File

@ -39,7 +39,8 @@ static inline int lcfg_lookup_bool(const config_t *config, const char *path, boo
/// Search for config file under a base directory
FILE *open_config_file_at(const char *base, char **out_path) {
static const char *config_paths[] = {"/compton.conf", "/compton/compton.conf"};
static const char *config_paths[] = {"/picom.conf", "/picom/picom.conf",
"/compton.conf", "/compton/compton.conf"};
for (size_t i = 0; i < ARR_SIZE(config_paths); i++) {
char *path = mstrjoin(base, config_paths[i]);
FILE *ret = fopen(path, "r");
@ -49,6 +50,12 @@ FILE *open_config_file_at(const char *base, char **out_path) {
free(path);
}
if (ret) {
if (strstr(config_paths[i], "compton")) {
log_warn("This compositor has been renamed to \"picom\", "
"the old config file paths is deprecated. "
"Please replace the \"compton\"s in the path "
"with \"picom\"");
}
return ret;
}
}

View File

@ -1228,7 +1228,7 @@ cdbus_process(DBusConnection *c attr_unused, DBusMessage *msg, void *ud) {
dbus_message_is_method_call(msg, CDBUS_INTERFACE_NAME, method)
if (cdbus_m_ismethod("reset")) {
log_info("compton is resetting...");
log_info("picom is resetting...");
ev_break(ps->loop, EVBREAK_ALL);
if (!dbus_message_get_no_reply(msg))
cdbus_reply_bool(ps, msg, true);

View File

@ -11,7 +11,7 @@
#include "atom.h"
#include "common.h"
#include "compiler.h"
#include "compton.h"
#include "picom.h"
#include "config.h"
#include "event.h"
#include "log.h"
@ -633,7 +633,7 @@ ev_selection_clear(session_t *ps, xcb_selection_clear_event_t attr_unused *ev) {
// If we lose that one, we should exit.
log_fatal("Another composite manager started and took the _NET_WM_CM_Sn "
"selection.");
quit_compton(ps);
quit(ps);
}
void ev_handle(session_t *ps, xcb_generic_event_t *ev) {

View File

@ -7,10 +7,10 @@ base_deps = [
libev
]
srcs = [ files('compton.c', 'win.c', 'c2.c', 'x.c', 'config.c', 'vsync.c', 'utils.c',
srcs = [ files('picom.c', 'win.c', 'c2.c', 'x.c', 'config.c', 'vsync.c', 'utils.c',
'diagnostic.c', 'string_utils.c', 'render.c', 'kernel.c', 'log.c',
'options.c', 'event.c', 'cache.c', 'atom.c') ]
compton_inc = include_directories('.')
picom_inc = include_directories('.')
cflags = []
@ -80,10 +80,10 @@ endif
subdir('backend')
compton = executable('compton', srcs, c_args: cflags,
picom = executable('picom', srcs, c_args: cflags,
dependencies: [ base_deps, deps, test_h_dep ],
install: true, include_directories: compton_inc)
install: true, include_directories: picom_inc)
if get_option('unittest')
test('compton unittest', compton, args: [ '--unittest' ])
test('picom unittest', picom, args: [ '--unittest' ])
endif

View File

@ -40,7 +40,7 @@ typedef struct {
GLint unifm_factor_center;
} glx_blur_pass_t;
/// Structure containing GLX-dependent data for a compton session.
/// Structure containing GLX-dependent data for a session.
typedef struct glx_session {
// === OpenGL related ===
/// GLX context.

View File

@ -22,13 +22,12 @@
/**
* Print usage text.
*/
static void usage(int ret) {
static void usage(const char *argv0, int ret) {
#define WARNING_DISABLED " (DISABLED AT COMPILE TIME)"
static const char *usage_text =
"compton (" COMPTON_VERSION ")\n"
"This is the maintenance fork of compton, please report\n"
"bugs to https://github.com/yshui/compton\n\n"
"usage: compton [options]\n"
"picom (" COMPTON_VERSION ")\n"
"Please report bugs to https://github.com/yshui/picom\n\n"
"usage: %s [options]\n"
"Options:\n"
"\n"
"-r radius\n"
@ -151,7 +150,7 @@ static void usage(int ret) {
" windows.\n"
"\n"
"--refresh-rate val\n"
" Specify refresh rate of the screen. If not specified or 0, compton\n"
" Specify refresh rate of the screen. If not specified or 0, we\n"
" will try detecting this with X RandR extension.\n"
"\n"
"--vsync\n"
@ -161,8 +160,7 @@ static void usage(int ret) {
" Painting on X Composite overlay window.\n"
"\n"
"--sw-opti\n"
" Limit compton to repaint at most once every 1 / refresh_rate\n"
" second to boost performance.\n"
" Limit repaint to at most once every 1 / refresh_rate second.\n"
"\n"
"--use-ewmh-active-win\n"
" Use _NET_WM_ACTIVE_WINDOW on the root window to determine which\n"
@ -246,7 +244,7 @@ static void usage(int ret) {
"\n"
"--opacity-rule opacity:condition\n"
" Specify a list of opacity rules, in the format \"PERCENT:PATTERN\",\n"
" like \'50:name *= \"Firefox\"'. compton-trans is recommended over\n"
" like \'50:name *= \"Firefox\"'. picom-trans is recommended over\n"
" this. Note we do not distinguish 100% and unset, and we don't make\n"
" any guarantee about possible conflicts with other programs that set\n"
" _NET_WM_WINDOW_OPACITY on frame or client windows.\n"
@ -313,13 +311,13 @@ static void usage(int ret) {
"\n"
"--debug-mode\n"
" Render into a separate window, and don't take over the screen. Useful\n"
" when you want to attach a debugger to compton\n"
" when you want to attach a debugger to picom\n"
"\n"
"--no-ewmh-fullscreen\n"
" Do not use EWMH to detect fullscreen windows. Reverts to checking\n"
" if a window is fullscreen based only on its size and coordinates.\n";
FILE *f = (ret ? stderr : stdout);
fputs(usage_text, f);
fprintf(f, usage_text, argv0);
#undef WARNING_DISABLED
}
@ -438,7 +436,7 @@ bool get_early_config(int argc, char *const *argv, char **config_file, bool *all
if (o == 256) {
*config_file = strdup(optarg);
} else if (o == 'h') {
usage(0);
usage(argv[0], 0);
return true;
} else if (o == 'b') {
@ -456,7 +454,7 @@ bool get_early_config(int argc, char *const *argv, char **config_file, bool *all
} else if (o == 320) {
log_warn("--no-name-pixmap will be ignored");
} else if (o == '?' || o == ':') {
usage(1);
usage(argv[0], 1);
*exit_code = 1;
return true;
}
@ -465,7 +463,7 @@ bool get_early_config(int argc, char *const *argv, char **config_file, bool *all
// Check for abundant positional arguments
if (optind < argc) {
// log is not initialized here yet
fprintf(stderr, "compton doesn't accept positional arguments.\n");
fprintf(stderr, "picom doesn't accept positional arguments.\n");
*exit_code = 1;
return true;
}
@ -516,7 +514,7 @@ void get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
// Short options
case 318:
case 'h':
// These options should cause compton to exit early,
// These options should cause us to exit early,
// so assert(false) here
assert(false);
break;
@ -617,7 +615,7 @@ void get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
break;
case 271:
// --alpha-step
log_warn("--alpha-step has been removed, compton now tries to "
log_warn("--alpha-step has been removed, we now tries to "
"make use of all alpha values");
break;
case 272: log_warn("use of --dbe is deprecated"); break;
@ -798,7 +796,7 @@ void get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
case 801: opt->print_diagnostics = true; break;
P_CASEBOOL(802, debug_mode);
P_CASEBOOL(803, no_ewmh_fullscreen);
default: usage(1); break;
default: usage(argv[0], 1); break;
#undef P_CASEBOOL
}
// clang-format on

View File

@ -31,10 +31,10 @@
#include "common.h"
#include "compiler.h"
#include "compton.h"
#include "config.h"
#include "err.h"
#include "kernel.h"
#include "picom.h"
#ifdef CONFIG_OPENGL
#include "opengl.h"
#endif
@ -98,7 +98,7 @@ void set_root_flags(session_t *ps, uint64_t flags) {
ps->root_flags |= flags;
}
void quit_compton(session_t *ps) {
void quit(session_t *ps) {
ps->quit = true;
ev_break(ps->loop, EVBREAK_ALL);
}
@ -731,7 +731,7 @@ static bool initialize_backend(session_t *ps) {
}
if (!ps->backend_data) {
log_fatal("Failed to initialize backend, aborting...");
quit_compton(ps);
quit(ps);
return false;
}
ps->backend_data->ops = backend_list[ps->o.backend];
@ -740,7 +740,7 @@ static bool initialize_backend(session_t *ps) {
log_fatal("Failed to prepare for background blur, aborting...");
ps->backend_data->ops->deinit(ps->backend_data);
ps->backend_data = NULL;
quit_compton(ps);
quit(ps);
return false;
}
@ -937,10 +937,10 @@ static bool register_cm(session_t *ps) {
{
XClassHint *h = XAllocClassHint();
if (h) {
h->res_name = "compton";
h->res_class = "compton";
h->res_name = "picom";
h->res_class = "picom";
}
Xutf8SetWMProperties(ps->dpy, ps->reg_win, "compton", "compton", NULL, 0,
Xutf8SetWMProperties(ps->dpy, ps->reg_win, "picom", "picom", NULL, 0,
NULL, NULL, h);
XFree(h);
}
@ -1334,7 +1334,7 @@ static void handle_pending_updates(EV_P_ struct session *ps) {
log_fatal("failed to grab x server");
x_print_error(e->full_sequence, e->major_code, e->minor_code,
e->error_code);
return quit_compton(ps);
return quit(ps);
}
ps->server_grabbed = true;
@ -1349,7 +1349,8 @@ static void handle_pending_updates(EV_P_ struct session *ps) {
refresh_windows(ps);
{
auto r = xcb_get_input_focus_reply(ps->c, xcb_get_input_focus(ps->c), NULL);
auto r = xcb_get_input_focus_reply(
ps->c, xcb_get_input_focus(ps->c), NULL);
if (!ps->active_win || (r && r->focus != ps->active_win->base.id)) {
recheck_focus(ps);
}
@ -1367,7 +1368,7 @@ static void handle_pending_updates(EV_P_ struct session *ps) {
log_fatal("failed to ungrab x server");
x_print_error(e->full_sequence, e->major_code, e->minor_code,
e->error_code);
return quit_compton(ps);
return quit(ps);
}
ps->server_grabbed = false;
@ -1521,17 +1522,17 @@ static void x_event_callback(EV_P attr_unused, ev_io *w, int revents attr_unused
/**
* Turn on the program reset flag.
*
* This will result in compton resetting itself after next paint.
* This will result in the compostior resetting itself after next paint.
*/
static void reset_enable(EV_P_ ev_signal *w attr_unused, int revents attr_unused) {
log_info("compton is resetting...");
log_info("picom is resetting...");
ev_break(EV_A_ EVBREAK_ALL);
}
static void exit_enable(EV_P attr_unused, ev_signal *w, int revents attr_unused) {
session_t *ps = session_ptr(w, int_signal);
log_info("compton is quitting...");
quit_compton(ps);
log_info("picom is quitting...");
quit(ps);
}
/**
@ -1708,7 +1709,7 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
if (!reply || (reply->major_version == 0 && reply->minor_version < 2)) {
log_fatal("Your X server doesn't have Composite >= 0.2 support, "
"compton cannot run.");
"we cannot proceed.");
exit(1);
}
free(reply);
@ -1766,6 +1767,11 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
}
}
if (strstr(argv[0], "compton")) {
log_warn("This compositor has been renamed to \"picom\", the \"compton\" "
"binary will not be installed in the future.");
}
if (ps->o.debug_mode && !ps->o.experimental_backends) {
log_fatal("Debug mode only works with the experimental backends.");
return NULL;
@ -2322,7 +2328,7 @@ int main(int argc, char **argv) {
XSetEventQueueOwner(dpy, XCBOwnsEventQueue);
ps_g = session_init(argc, argv, dpy, config_file, all_xerrors, need_fork);
if (!ps_g) {
log_fatal("Failed to create new compton session.");
log_fatal("Failed to create new session.");
return 1;
}
if (need_fork) {

View File

@ -28,8 +28,8 @@
enum root_flags { ROOT_FLAGS_SCREEN_CHANGE = 1 };
// == Functions ==
// TODO move static inline functions that are only used in compton.c, into
// compton.c
// TODO move static inline functions that are only used in picom.c, into
// picom.c
// inline functions must be made static to compile correctly under clang:
// http://clang.llvm.org/compatibility.html#inline
@ -57,7 +57,7 @@ void discard_ignore(session_t *ps, unsigned long sequence);
void set_root_flags(session_t *ps, uint64_t flags);
void quit_compton(session_t *ps);
void quit(session_t *ps);
xcb_window_t session_get_target_window(session_t *);

View File

@ -78,7 +78,7 @@ safe_isnan(double a) {
// Some macros for checked cast
// Note these macros are not complete, as in, they won't work for every integer types. But
// they are good enough for compton.
// they are good enough for our use cases.
#define to_int_checked(val) \
({ \

View File

@ -20,7 +20,7 @@
#include "c2.h"
#include "common.h"
#include "compiler.h"
#include "compton.h"
#include "picom.h"
#include "config.h"
#include "list.h"
#include "log.h"
@ -2053,7 +2053,7 @@ void map_win_start(session_t *ps, struct managed_win *w) {
ps->c, w->base.id, XCB_CW_EVENT_MASK,
(const uint32_t[]){determine_evmask(ps, w->base.id, WIN_EVMODE_FRAME)});
// Notify compton when the shape of a window changes
// Get notification when the shape of a window changes
if (ps->shape_exists) {
xcb_shape_select_input(ps->c, w->base.id, 1);
}
@ -2193,7 +2193,7 @@ struct managed_win *find_toplevel2(session_t *ps, xcb_window_t wid) {
// Using find_win here because if we found a unmanaged window we know about, we
// can stop early.
while (wid && wid != ps->root && !(w = find_win(ps, wid))) {
// xcb_query_tree probably fails if you run compton when X is somehow
// xcb_query_tree probably fails if you run picom when X is somehow
// initializing (like add it in .xinitrc). In this case
// just leave it alone.
auto reply = xcb_query_tree_reply(ps->c, xcb_query_tree(ps->c, wid), NULL);

View File

@ -73,7 +73,7 @@ struct window_stack_entry {
* considered part of the window.
*/
/// Structure representing a top-level window compton manages.
/// Structure representing a top-level managed window.
typedef struct win win;
struct win {
UT_hash_handle hh;

View File

@ -111,7 +111,7 @@ bool wid_get_text_prop(session_t *ps, xcb_window_t wid, xcb_atom_t prop, char **
}
// A cache of pict formats. We assume they don't change during the lifetime
// of compton
// of this program
static thread_local xcb_render_query_pict_formats_reply_t *g_pictfmts = NULL;
static inline void x_get_server_pictfmts(xcb_connection_t *c) {
@ -576,7 +576,7 @@ struct xvisual_info x_get_visual_info(xcb_connection_t *c, xcb_visualid_t visual
return (struct xvisual_info){-1, -1, -1, -1, -1, 0};
}
if (pictfmt->type != XCB_RENDER_PICT_TYPE_DIRECT) {
log_error("compton cannot handle non-DirectColor visuals. Report an "
log_error("We cannot handle non-DirectColor visuals. Report an "
"issue if you see this error message.");
return (struct xvisual_info){-1, -1, -1, -1, -1, 0};
}

View File

@ -78,8 +78,8 @@ static inline uint32_t x_new_id(xcb_connection_t *c) {
auto ret = xcb_generate_id(c);
if (ret == (uint32_t)-1) {
log_fatal("We seems to have run of XIDs. This is either a bug in the X "
"server, or a resource leakage in compton. Please open an "
"issue about this problem. compton will die.");
"server, or a resource leakage in the compositor. Please open an "
"issue about this problem. The compositor will die.");
abort();
}
return ret;

View File

@ -8,12 +8,12 @@ echo "Running test $2"
# TODO keep the log file, and parse it to see if test is successful
($1 --experimental-backends --backend dummy --log-level=debug --log-file=$PWD/log --config=$2) &
compton_pid=$!
main_pid=$!
$3
kill -INT $compton_pid || true
kill -INT $main_pid || true
cat log
rm log
wait $compton_pid
wait $main_pid

View File

@ -1,8 +1,8 @@
#!/bin/sh
set -e
compton=$(realpath $1)
exe=$(realpath $1)
cd $(dirname $0)
./run_one_test.sh $compton configs/empty.conf testcases/basic.py
./run_one_test.sh $compton configs/issue239.conf testcases/issue239.py
./run_one_test.sh $compton configs/issue239_2.conf testcases/issue239_2.py
./run_one_test.sh $exe configs/empty.conf testcases/basic.py
./run_one_test.sh $exe configs/issue239.conf testcases/issue239.py
./run_one_test.sh $exe configs/issue239_2.conf testcases/issue239_2.py