Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
yshui committed Mar 23, 2019
2 parents 0202981 + b0820d8 commit 3bf86b3
Show file tree
Hide file tree
Showing 58 changed files with 12,282 additions and 12,735 deletions.
29 changes: 8 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,57 +43,46 @@ jobs:
<<: *defaults
steps:
- build:
build-config: -Dbuild_docs=true -Dnew_backends=true
build-config: -Dbuild_docs=true
minimal:
<<: *defaults
steps:
- build:
build-config: -Dopengl=false -Ddbus=false -Dregex=false -Dconfig_file=false -Dnew_backends=true
build-config: -Dopengl=false -Ddbus=false -Dregex=false -Dconfig_file=false
nogl:
<<: *defaults
steps:
- build:
build-config: -Dopengl=false -Dnew_backends=true
build-config: -Dopengl=false
noregex:
<<: *defaults
steps:
- build:
build-config: -Dregex=false -Dnew_backends=true
build-config: -Dregex=false
clang_basic:
<<: *defaults
steps:
- build:
cc: clang-6.0
build-config: -Dnew_backends=true
build-config:
clang_minimal:
<<: *defaults
steps:
- build:
cc: clang-6.0
build-config: -Dopengl=false -Ddbus=false -Dregex=false -Dconfig_file=false -Dnew_backends=true
build-config: -Dopengl=false -Ddbus=false -Dregex=false -Dconfig_file=false
clang_nogl:
<<: *defaults
steps:
- build:
cc: clang-6.0
build-config: -Dopengl=false -Dnew_backends=true
build-config: -Dopengl=false
clang_noregex:
<<: *defaults
steps:
- build:
cc: clang-6.0
build-config: -Dregex=false -Dnew_backends=true
clang_basic_nonew:
<<: *defaults
steps:
- build:
cc: clang-6.0
build-config:
basic_nonew:
<<: *defaults
steps:
- build:
build-config:
build-config: -Dregex=false

workflows:
all_builds:
Expand All @@ -104,8 +93,6 @@ workflows:
- clang_minimal
- nogl
- clang_nogl
- clang_basic_nonew
- basic_nonew
# - test-xvfb

# vim: set sw=2 ts=8 et:
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ PenaltyReturnTypeOnItsOwnLine: 0
PenaltyBreakAssignment: 0
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 1
PenaltyBreakString: 5
PenaltyExcessCharacter: 1
PenaltyBreakString: 36
PenaltyExcessCharacter: 3
PenaltyBreakFirstLessLess: 0
PenaltyBreakTemplateDeclaration: 0
BreakBeforeBinaryOperators: None
Expand Down
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
root = true
[*.{c,h}]
indent_style = space
indent_size = 2
indent_style = tab
indent_size = 8
max_line_length = 90
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Sorted in alphabetical order

Adam Jackson <[email protected]>
Antonin Dé[email protected]>
Avi-D-coder <[email protected]>
Brottweiler <[email protected]>
Carl Worth <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,7 @@ UML_LOOK = NO
# the class node. If there are many fields or methods and many nodes the
# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
# threshold limits the number of items for each type to make the size more
# managable. Set this to 0 for no limit. Note that the threshold may be
# manageable. Set this to 0 for no limit. Note that the threshold may be
# exceeded by 50% before the limit is enforced.

UML_LIMIT_NUM_FIELDS = 10
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Assuming you already have all the usual building tools installed (e.g. gcc, meso

To build the documents, you need `asciidoc`

### How to build
### To build

```bash
$ meson --buildtype=release . build
Expand All @@ -53,6 +53,14 @@ $ ninja -C build

Built binary can be found in `build/src`

### To install

``` bash
$ ninja -C build install
```

Default install prefix is `/usr/local`, you can change it with `meson configure -Dprefix=<path> build`

## How to Contribute

### Code
Expand Down
2 changes: 1 addition & 1 deletion bin/compton-trans
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ for v in "$@"; do
done

# This takes into account the fact that getopts stops on
# any argument it doesn't recongize or errors on. This
# 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).
while test $# -gt 0; do
Expand Down
6 changes: 2 additions & 4 deletions compton.sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0;
vsync = "none";
vsync = true;
# sw-opti = true;
# unredir-if-possible = true;
# unredir-if-possible-delay = 5000;
Expand All @@ -70,10 +70,8 @@ invert-color-include = [ ];
# GLX backend
# glx-no-stencil = true;
# glx-no-rebind-pixmap = true;
glx-swap-method = "undefined";
# glx-use-gpushader4 = true;
# xrender-sync = true;
# xrender-sync-fence = true;
use-damage = true;

# Window type settings
wintypes:
Expand Down
56 changes: 21 additions & 35 deletions man/compton.1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ OPTIONS
Enabled client-side shadows on windows. Note desktop windows (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, unless explicitly requested using the wintypes option.

*-C*, *--no-dock-shadow*::
Avoid drawing shadows on dock/panel windows.
Avoid drawing shadows on dock/panel windows. This option is deprecated, you should use the *wintypes* option in your config file instead.

*-f*, *--fading*::
Fade windows in/out when opening/closing and when opacity changes, unless *--no-fading-openclose* is used.
Expand All @@ -65,7 +65,7 @@ OPTIONS
Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)

*-G*, *--no-dnd-shadow*::
Don't draw shadows on drag-and-drop windows.
Don't draw shadows on drag-and-drop windows. This option is deprecated, you should use the *wintypes* option in your config file instead.

*-b*, *--daemon*::
Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
Expand All @@ -74,7 +74,10 @@ OPTIONS
Set the log level. Possible values are "TRACE", "DEBUG", "INFO", "WARN", "ERROR", in increasing level of importance. Case doesn't matter.

*--log-file*::
Set the log file. If *--log-file* is never specified, logs will be written to stderr. Otherwise, logs will to writeen 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.
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.

*--experimental-backends*::
Use the new, reimplemented version of the backends. The new backends are HIGHLY UNSTABLE at this point, you have been warned. This option is not available in the config file.

*--show-all-xerrors*::
Show all X errors (for debugging).
Expand Down Expand Up @@ -127,28 +130,8 @@ OPTIONS
*--refresh-rate* 'REFRESH_RATE'::
Specify refresh rate of the screen. If not specified or 0, compton will try detecting this with X RandR extension.

*--vsync* 'VSYNC_METHOD'::
Set VSync method. VSync methods currently available:
+
--
* 'none': No VSync
* 'drm': VSync with 'DRM_IOCTL_WAIT_VBLANK'. May only work on some (DRI-based) drivers.
* 'opengl': Try to VSync with 'SGI_video_sync' OpenGL extension. Only work on some drivers.
* 'opengl-oml': Try to VSync with 'OML_sync_control' OpenGL extension. Only work on some drivers.
* 'opengl-swc': Try to VSync with 'MESA_swap_control' or 'SGI_swap_control' (in order of preference) OpenGL extension. Works only with GLX backend. Known to be most effective on many drivers. Does not guarantee to control paint timing.
* 'opengl-mswc': Deprecated, use 'opengl-swc' instead.

(Note some VSync methods may not be enabled at compile time.)
--

*--vsync-aggressive*::
Attempt to send painting request before VBlank and do XFlush() during VBlank. Reported to work pretty terribly. This switch may be lifted out at any moment.

*--dbe*::
Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing. Reported to have no effect, though.

*--paint-on-overlay*::
Painting on X Composite overlay window instead of on root window.
*--vsync*::
Enable 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.
Expand Down Expand Up @@ -202,7 +185,11 @@ OPTIONS
WIDTH,HEIGHT,ELE1,ELE2,ELE3,ELE4,ELE5...
----
+
The element in the center must not be included, it will be forever 1.0 or changing based on opacity, depending on whether you have `--blur-background-fixed`. Yet the automatic adjustment of blur factor may not work well with a custom blur kernel.
In other words, the matrix is formatted as a list of comma separated numbers. The first two numbers must be integers, which specify the width and height of the matrix. They must be odd numbers. Then, the following 'width * height - 1' numbers specifies the numbers in the matrix, row by row, excluding the center element.
+
The elements are finite floating point numbers. The decimal pointer has to be '.' (a period), and scientific notation is not supported.
+
The element in the center will either be 1.0 or changing based on opacity, depending on whether you have `--blur-background-fixed`. Yet the automatic adjustment of blur factor may not work well with a custom blur kernel.
+
A 7x7 Gaussian blur kernel (sigma = 0.84089642) looks like:
+
Expand All @@ -216,7 +203,7 @@ May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box
Exclude conditions for background blur.

*--resize-damage* 'INTEGER'::
Resize damaged region by a specific number of pixels. A positive value enlarges it while a negative one shrinks it. If the value is positive, those additional pixels will not be actually painted to screen, only used in blur calculation, and such. (Due to technical limitations, with *--dbe* or *--glx-swap-method*, those pixels will still be incorrectly painted to screen.) Primarily used to fix the line corruption issues of blur, in which case you should use the blur radius value here (e.g. with a 3x3 kernel, you should use *--resize-damage* 1, with a 5x5 one you use *--resize-damage* 2, and so on). May or may not work with `--glx-no-stencil`. Shrinking doesn't function correctly.
Resize damaged region by a specific number of pixels. A positive value enlarges it while a negative one shrinks it. If the value is positive, those additional pixels will not be actually painted to screen, only used in blur calculation, and such. (Due to technical limitations, with *--use-damage*, those pixels will still be incorrectly painted to screen.) Primarily used to fix the line corruption issues of blur, in which case you should use the blur radius value here (e.g. with a 3x3 kernel, you should use *--resize-damage* 1, with a 5x5 one you use *--resize-damage* 2, and so on). May or may not work with `--glx-no-stencil`. Shrinking doesn't function correctly.

*--invert-color-include* 'CONDITION'::
Specify a list of conditions of windows that should be painted with inverted color. Resource-hogging, and is not well tested.
Expand Down Expand Up @@ -245,11 +232,8 @@ May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box
*--glx-no-rebind-pixmap*::
GLX backend: Avoid rebinding pixmap on window damage. Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). Recommended if it works.

*--glx-swap-method* undefined/exchange/copy/3/4/5/6/buffer-age::
GLX backend: GLX buffer swap method we assume. Could be `undefined` (0), `copy` (1), `exchange` (2), 3-6, or `buffer-age` (-1). `undefined` is the slowest and the safest, and the default value. `copy` is fastest, but may fail on some drivers, 2-6 are gradually slower but safer (6 is still faster than 0). Usually, double buffer means 2, triple buffer means 3. `buffer-age` means auto-detect using 'GLX_EXT_buffer_age', supported by some drivers. Partially breaks `--resize-damage`. Defaults to `undefined`.

*--glx-use-gpushader4*::
GLX backend: Use 'GL_EXT_gpu_shader4' for some optimization on blur GLSL code. My tests on GTX 670 show no noticeable effect.
*-use-damage*::
Use the damage information to limit rendering to parts of the screen that has actually changed. Potentially improves the performance.

*--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.
Expand Down Expand Up @@ -357,7 +341,9 @@ 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`).

compton uses general libconfig configuration file format. A sample configuration file is available as `compton.sample.conf` in the source tree. Most commandline switches each could be replaced with an option in configuration file, thus documented above. Window-type-specific settings are exposed only in configuration file and has the following format:
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.

Window-type-specific settings are exposed only in configuration file and has the following format:

------------
wintypes:
Expand Down Expand Up @@ -430,10 +416,10 @@ $ compton -c --shadow-red 1 --shadow-green 1 --shadow-blue 1
$ compton -c --shadow-exclude 'class_g = "wbar"'
------------
* Enable OpenGL SGI_swap_control VSync with GLX backend:
* Enable VSync with GLX backend:
+
------------
$ compton --backend glx --vsync opengl-swc
$ compton --backend glx --vsync
------------
BUGS
Expand Down
5 changes: 3 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('compton', 'c', version: '5',
project('compton', 'c', version: '6',
default_options: ['c_std=c11'])

cc = meson.get_compiler('c')
Expand Down Expand Up @@ -46,7 +46,8 @@ endif

add_global_arguments('-D_GNU_SOURCE', language: 'c')

warns = [ 'all', 'extra', 'no-unused-parameter', 'nonnull', 'shadow', 'implicit-fallthrough' ]
warns = [ 'all', 'extra', 'no-unused-parameter', 'nonnull', 'shadow',
'implicit-fallthrough', 'no-unknown-warning-option', 'no-missing-braces' ]
foreach w : warns
if cc.has_argument('-W'+w)
add_global_arguments('-W'+w, language: 'c')
Expand Down
5 changes: 1 addition & 4 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
option('sanitize', type: 'boolean', value: false, description: 'Compile compton with sanitizers')
option('xinerama', type: 'boolean', value: true, description: 'Enable XINERAMA support')
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')

option('vsync_drm', type: 'boolean', value: false, description: 'Enable support for using drm for vsync')

option('opengl', type: 'boolean', value: true, description: 'Enable features that require opengl (opengl backend, and opengl vsync methods)')
option('dbus', type: 'boolean', value: true, description: 'Enable suport for D-Bus remote control')
option('dbus', type: 'boolean', value: true, description: 'Enable support for D-Bus remote control')

option('xrescheck', type: 'boolean', value: false, description: 'Enable X resource leak checker (for debug only)')

option('build_docs', type: 'boolean', value: false, description: 'Build documentation and man pages')

option('new_backends', type: 'boolean', value: false, description: 'Does not really do anything right now')

option('modularize', type: 'boolean', value: false, description: 'Build with clang\'s module system')
Loading

0 comments on commit 3bf86b3

Please sign in to comment.