Skip to content

Commit 7417f0d

Browse files
committed
Misc: stoppaint_force & Documentation update
- Add stoppaint_force option, controlled via D-Bus, to stop painting completely, which may look better than unredirecting the screen, sometimes. (#41) - Add x2, y2 matching targets. - Update documentation.
1 parent b46deb5 commit 7417f0d

File tree

7 files changed

+103
-36
lines changed

7 files changed

+103
-36
lines changed

compton.sample.conf

+13-7
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ shadow-offset-y = -7;
1010
# shadow-red = 0.0;
1111
# shadow-green = 0.0;
1212
# shadow-blue = 0.0;
13-
shadow-exclude = [ "name = 'Notification'", "class_g = 'Conky'", "class_g ?= 'Notify-osd'" ];
13+
shadow-exclude = [ "name = 'Notification'", "class_g = 'Conky'", "class_g ?= 'Notify-osd'", "class_g = 'Cairo-clock'" ];
1414
# shadow-exclude = "n:e:Notification";
1515
shadow-ignore-shaped = false;
16+
# shadow-exclude-reg = "x10+0+0"
1617

1718
# Opacity
1819
menu-opacity = 0.8;
@@ -25,8 +26,11 @@ alpha-step = 0.06;
2526
# inactive-dim-fixed = true;
2627
# blur-background = true;
2728
# blur-background-frame = true;
28-
blur-background-fixed = false;
29+
blur-kern = "3x3box"
30+
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
31+
# blur-background-fixed = true;
2932
blur-background-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ];
33+
opacity-rule = [ ]
3034

3135
# Fading
3236
fading = true;
@@ -40,26 +44,28 @@ fade-exclude = [ ];
4044
backend = "xrender"
4145
mark-wmwin-focused = true;
4246
mark-ovredir-focused = true;
43-
use-ewmh-active-win = false;
47+
# use-ewmh-active-win = true;
4448
detect-rounded-corners = true;
4549
detect-client-opacity = true;
4650
refresh-rate = 0;
4751
vsync = "none";
4852
dbe = false;
49-
paint-on-overlay = false;
50-
sw-opti = false;
51-
unredir-if-possible = false;
52-
focus-exclude = [ ];
53+
paint-on-overlay = true;
54+
# sw-opti = true;
55+
# unredir-if-possible = true;
56+
focus-exclude = [ "class_g = 'Cairo-clock'" ];
5357
detect-transient = true;
5458
detect-client-leader = true;
5559
invert-color-include = [ ];
60+
# resize-damage = 1;
5661

5762
# GLX backend
5863
# glx-no-stencil = true;
5964
glx-copy-from-front = false;
6065
# glx-use-copysubbuffermesa = true;
6166
# glx-no-rebind-pixmap = true;
6267
glx-swap-method = "undefined";
68+
# glx-use-gpushader4 = true;
6369

6470
# Window type settings
6571
wintypes:

man/compton.1.asciidoc

+50-20
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,17 @@ OPTIONS
9898
*--inactive-opacity-override*::
9999
Let inactive opacity set by *-i* overrides the windows' '_NET_WM_OPACITY' values.
100100

101-
*--inactive-dim* value::
101+
*--active-opacity* 'OPACITY'::
102+
Default opacity for active windows. (0.0 - 1.0)
103+
104+
*--inactive-dim* 'VALUE'::
102105
Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
103106

104107
*--mark-wmwin-focused*::
105-
Try to detect WM windows and mark them as active.
108+
Try to detect WM windows (a non-override-redirect window with no child that has `WM_STATE`) and mark them as active.
109+
110+
*--mark-ovredir-focused*::
111+
Mark override-redirect windows that doesn't have a child window with `WM_STATE` focused.
106112

107113
*--no-fading-openclose*::
108114
Do not fade on window open/close.
@@ -124,17 +130,20 @@ OPTIONS
124130
+
125131
--
126132
* 'none': No VSync
127-
* 'drm': VSync with 'DRM_IOCTL_WAIT_VBLANK'. May only work on some drivers. Experimental.
128-
* 'opengl': Try to VSync with 'SGI_video_sync' OpenGL extension. Only work on some drivers. Experimental.
129-
* 'opengl-oml': Try to VSync with 'OML_sync_control' OpenGL extension. Only work on some drivers. Experimental.
133+
* 'drm': VSync with 'DRM_IOCTL_WAIT_VBLANK'. May only work on some drivers.
134+
* 'opengl': Try to VSync with 'SGI_video_sync' OpenGL extension. Only work on some drivers.
135+
* 'opengl-oml': Try to VSync with 'OML_sync_control' OpenGL extension. Only work on some drivers.
130136
* 'opengl-swc': Try to VSync with 'SGI_swap_control' OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesn't have the effect of *--sw-opti* unlike other methods. Experimental.
131137
* 'opengl-mswc': Try to VSync with 'MESA_swap_control' OpenGL extension. Basically the same as 'opengl-swc' above, except the extension we use.
132138

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

142+
*--vsync-aggressive*::
143+
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.
144+
136145
*--alpha-step* 'VALUE'::
137-
Step for pregenerating alpha pictures. (0.01 - 1.0, defaults to 0.03)
146+
X Render backend: Step for pregenerating alpha pictures. (0.01 - 1.0, defaults to 0.03)
138147

139148
*--dbe*::
140149
Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing. Reported to have no effect, though.
@@ -143,13 +152,16 @@ OPTIONS
143152
Painting on X Composite overlay window instead of on root window.
144153

145154
*--sw-opti*::
146-
Limit compton to repaint at most once every 1 / 'refresh_rate' second to boost performance. Experimental. This should not be used with *--vsync* as *--vsync* essentially does *--sw-opti*'s job already, unless you wish to specify a lower refresh rate than the actual value.
155+
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.
147156
148157
*--use-ewmh-active-win*::
149-
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. Experimental.
158+
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.
159+
160+
*--respect-prop-shadow*::
161+
Respect '_COMPTON_SHADOW'. This a prototype-level feature, which you must not rely on.
150162

151163
*--unredir-if-possible*::
152-
Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows. Known to cause flickering when redirecting/unredirecting windows. *--paint-on-overlay* may make the flickering less obvious. Experimental.
164+
Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows. Known to cause flickering when redirecting/unredirecting windows. *--paint-on-overlay* may make the flickering less obvious.
153165

154166
*--shadow-exclude* 'CONDITION'::
155167
Specify a list of conditions of windows that should have no shadow.
@@ -178,7 +190,7 @@ OPTIONS
178190
*--blur-background-fixed*::
179191
Use fixed blur strength rather than adjusting according to window opacity.
180192

181-
*--blur-kern* matrix::
193+
*--blur-kern* 'MATRIX'::
182194
Specify the blur convolution kernel, with the following format:
183195
+
184196
----
@@ -195,33 +207,51 @@ A 7x7 Guassian blur kernel (sigma = 0.84089642) looks like:
195207
+
196208
May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box`, `3x3gaussian`, `5x5gaussian`, `7x7gaussian`, `9x9gaussian`, `11x11gaussian`. All Guassian kernels are generated with sigma = 0.84089642 . You may use the accompanied `compton-convgen.py` to generate blur kernels.
197209

198-
*--resize-damage* integer::
210+
*--blur-background-exclude* 'CONDITION'::
211+
Exclude conditions for background blur.
212+
213+
*--resize-damage* 'INTEGER'::
199214
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.
200215

201-
*--invert-color-include* condition::
216+
*--invert-color-include* 'CONDITION'::
202217
Specify a list of conditions of windows that should be painted with inverted color. Resource-hogging, and is not well tested.
203218

204-
*--backend* backend::
205-
Specify the backend to use: 'xrender` or 'glx'. GLX (OpenGL) backend generally has much superior performance as far as you have a graphic card/chip and driver.
219+
*--opacity-rule* 'OPACITY':'CONDITION'::
220+
Specify a list of opacity rules, in the format `PERCENT:PATTERN`, like `50:name *= "Firefox"`. compton-trans is recommended over this. Note we do not distinguish 100% and unset, and we don't make any guarantee about possible conflicts with other programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
221+
222+
*--shadow-exclude-reg* 'GEOMETRY'::
223+
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.
224+
225+
*--backend* 'BACKEND'::
226+
Specify the backend to use: `xrender` or `glx`. GLX (OpenGL) backend generally has much superior performance as far as you have a graphic card/chip and driver.
206227

207228
*--glx-no-stencil*::
208-
GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. Might cause incorrect opacity when rendering transparent content and cannot work with *--blur-background*. My tests show a 15% performance boost.
229+
GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. Might cause incorrect opacity when rendering transparent content (but never practically happened) and may not work with *--blur-background*. My tests show a 15% performance boost. Recommended.
209230

210231
*--glx-copy-from-front*::
211-
GLX backend: Copy unmodified regions from front buffer instead of redrawing them all. My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified, but a 20% increase when only 1/4 is. My tests on nouveau show terrible slowdown.
232+
GLX backend: Copy unmodified regions from front buffer instead of redrawing them all. My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified, but a 20% increase when only 1/4 is. My tests on nouveau show terrible slowdown. Useful with `--glx-swap-method`, as well.
212233

213234
*--glx-use-copysubbuffermesa*::
214-
GLX backend: Use MESA_copy_sub_buffer to do partial screen update. My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated. May break VSync and is not available on some drivers. Overrides *--glx-copy-from-front*.
235+
GLX backend: Use 'MESA_copy_sub_buffer' to do partial screen update. My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated. May break VSync and is not available on some drivers. Overrides *--glx-copy-from-front*.
215236

216237
*--glx-no-rebind-pixmap*::
217-
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).
238+
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). Recommended if it works.
218239

219-
*--glx-swap-method* undefined/exchange/copy/3/4/5/6::
240+
*--glx-swap-method* undefined/exchange/copy/3/4/5/6/buffer-age::
220241
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. Useless with *--glx-use-copysubbuffermesa*. Partially breaks `--resize-damage`. Defaults to `undefined`.
221242

243+
*--glx-use-gpushader4*::
244+
GLX backend: Use 'GL_EXT_gpu_shader4' for some optimization on blur GLSL code. My tests on GTX 670 show no noticeable effect.
245+
222246
*--dbus*::
223247
Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
224248

249+
*--benchmark* 'CYCLES'::
250+
Benchmark mode. Repeatedly paint until reaching the specified cycles.
251+
252+
*--benchmark-wid* 'WINDOW_ID'::
253+
Specify window ID to repaint in benchmark mode. If omitted or is 0, the whole screen is repainted.
254+
225255
FORMAT OF CONDITIONS
226256
--------------------
227257
Some options accept a condition string to match certain windows. A condition string is formed by one or more conditions, joined by logical operators.
@@ -240,7 +270,7 @@ With greater-than/less-than operators it looks like:
240270

241271
'NEGATION' (optional) is one or more exclamation marks;
242272

243-
'TARGET' is either a predefined target name, or the name of a window property to match. Supported predefined targets are `id`, `override_redirect`, `argb` (whether the window has an ARGB visual), `focused`, `wmwin` (whether the window looks like a WM window, i.e. has no child window with `WM_STATE` and is not override-redirected), `client` (ID of client window), `window_type` (window type in string), `leader` (ID of window leader), `name`, `class_g` (= `WM_CLASS[1]`), `class_i` (= `WM_CLASS[0]`), and `role`.
273+
'TARGET' is either a predefined target name, or the name of a window property to match. Supported predefined targets are `id`, `x`, `y`, `x2` (x + widthb), `y2`, `width`, `height`, `widthb` (width + 2 * border), `heightb`, `override_redirect`, `argb` (whether the window has an ARGB visual), `focused`, `wmwin` (whether the window looks like a WM window, i.e. has no child window with `WM_STATE` and is not override-redirected), `client` (ID of client window), `window_type` (window type in string), `leader` (ID of window leader), `name`, `class_g` (= `WM_CLASS[1]`), `class_i` (= `WM_CLASS[0]`), and `role`.
244274

245275
'CLIENT/FRAME' is a single `@` if the window attribute should be be looked up on client window, nothing if on frame window;
246276

src/c2.c

+2
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,8 @@ c2_match_once_leaf(session_t *ps, win *w, const c2_l_t *pleaf,
10451045
case C2_L_PID: tgt = wid; break;
10461046
case C2_L_PX: tgt = w->a.x; break;
10471047
case C2_L_PY: tgt = w->a.y; break;
1048+
case C2_L_PX2: tgt = w->a.x + w->widthb; break;
1049+
case C2_L_PY2: tgt = w->a.y + w->heightb; break;
10481050
case C2_L_PWIDTH: tgt = w->a.width; break;
10491051
case C2_L_PHEIGHT: tgt = w->a.height; break;
10501052
case C2_L_PWIDTHB: tgt = w->widthb; break;

src/c2.h

+4
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ struct _c2_l {
101101
C2_L_PID,
102102
C2_L_PX,
103103
C2_L_PY,
104+
C2_L_PX2,
105+
C2_L_PY2,
104106
C2_L_PWIDTH,
105107
C2_L_PHEIGHT,
106108
C2_L_PWIDTHB,
@@ -187,6 +189,8 @@ const static c2_predef_t C2_PREDEFS[] = {
187189
[C2_L_PID ] = { "id" , C2_L_TCARDINAL , 0 },
188190
[C2_L_PX ] = { "x" , C2_L_TCARDINAL , 0 },
189191
[C2_L_PY ] = { "y" , C2_L_TCARDINAL , 0 },
192+
[C2_L_PX2 ] = { "x2" , C2_L_TCARDINAL , 0 },
193+
[C2_L_PY2 ] = { "y2" , C2_L_TCARDINAL , 0 },
190194
[C2_L_PWIDTH ] = { "width" , C2_L_TCARDINAL , 0 },
191195
[C2_L_PHEIGHT ] = { "height" , C2_L_TCARDINAL , 0 },
192196
[C2_L_PWIDTHB ] = { "widthb" , C2_L_TCARDINAL , 0 },

src/common.h

+2
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ typedef struct {
462462
bool unredir_if_possible;
463463
/// Forced redirection setting through D-Bus.
464464
switch_t redirected_force;
465+
/// Whether to stop painting. Controlled through D-Bus.
466+
switch_t stoppaint_force;
465467
/// Whether to enable D-Bus support.
466468
bool dbus;
467469
/// Path to log file.

0 commit comments

Comments
 (0)