Commit Graph

1627 Commits

Author SHA1 Message Date
Yuxuan Shui
ad18d129cc docs: explain the detect-client-leader option better
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-09-22 15:44:33 +01:00
yshui
4f817c452d Merge pull request #694 from jpribyl/patch-1
Don't set `detect-client-leader` in sample conf
2021-09-22 15:39:45 +01:00
Istvan Petres
de959f910b Fixed ugly dark shadows in case of smaller window than shadow radius. (#695) 2021-09-21 18:01:18 +02:00
Johnny Pribyl
bcb815d877 Use default detect-client-leader in sample conf 2021-09-19 18:30:57 -06:00
yshui
ee7d96101d Merge pull request #674 from tryone144/blur-textures
Experimental GL backend: Do not use larger-than-screen textures for blur buffers
2021-08-24 15:19:24 +01:00
Bernd Busse
1dbffec3ae backend: gl: do not use larger-than-screen textures for blur buffers
Blur-texture sampling has been changed to `CLAMP_TO_EDGE` in commit
4b0ff37b36 and to using the buffer
textures at screen position instead of texture origin in commit
89c18afac6.

When using the above approach, expanding the buffer textures by the same
amount as the damage region is not needed anymore, as we cannot render
more than the screen region anyways. Having larger-than-screen buffer
textures might lead to a slight darkening at the upper and right edges
since we don't necessarily trigger the `CLAMP_TO_EDGE` condition in the
intermediate steps. This becomes apparent when using dual-kawase at large
blur-strengths with light backgrounds.

These changes do not affect the general approach of rendering a
larger-than-window region with the blur to accommodate the necessary
increase in damage region.

Related: 6d646b543f
2021-08-16 17:34:19 +02:00
Bernd Busse
78e8666498 core: fix rare double-free when xinerama update fails
Explicitly set `xinerama_scr_regs` to `NULL` after calling free() to
avoid freeing them again.

Under normal operation we free the old xinerama screen region list on
root screen changes and allocate a new one with the updated regions.
On rare occasions — mainly reproducable by changing monitors while DPMS
is in standby — updating the region list might fail as for whatever
reason the xinerama extension is marked as inactive. This would leave
us with an invalid pointer to the already freed region list we would
then attempt to free again on the next root screen change.
2021-08-04 17:32:44 +02:00
Subhaditya Nath
24b4450726 picom-trans: Added SPDX-License-Identifier 2021-07-23 21:15:53 +01:00
Subhaditya Nath
084b670f6a Rewrite picom-trans
Rewrite picom-trans (#634)

Notable changes:

* Support arguments like `--arg=val`
* Allow trailing %-signs in opacity
* Improve error message
* Improve compatibility across different shells
2021-07-22 21:26:17 +01:00
yshui
057a939431 Merge pull request #656 from tryone144/shadow-crop-window
Add `clip-shadow-above` configuration and wintype option
2021-07-14 14:47:32 +01:00
Bernd Busse
4b5cc050d5 Add clip-shadow-above configuration and wintype option
Added the new `clip-shadow-above` configuration and wintype option.
These allow the user to select windows to clip from the shadow region of
other windows, i.e. don't paint shadows on top of them.

This should provide a more useful and userfriendly alternative to the
deprecated `shadow-exclude-reg` option — especially for docks and bars.
2021-07-14 14:43:28 +02:00
yshui
98fe8998c7 Merge pull request #657 from yshui/backend-improvements
Backend improvements
2021-07-14 10:46:52 +01:00
Yuxuan Shui
73c35c20f3 backend: remove unnecessary clone_image calls
No need to clone image to set_image_property, they are only needed for
image_op.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-07-13 22:14:30 +01:00
yshui
fd381dacff Merge pull request #641 from kwand/__GL_MaxFramesAllowed
Set GL_MaxFramesAllowed=1 instead of GL_YIELD=usleep
2021-07-11 14:16:59 +01:00
Daniel Kwan
976d0740fd Partially revert commit 0efdb6c; use glFinish only for non-NVIDIA 2021-07-10 18:14:20 -04:00
Daniel Kwan
e8147e0658 Set GL_MaxFramesAllowed=1 instead of GL_YIELD=usleep 2021-07-10 18:14:20 -04:00
yshui
e92403bd67 Merge pull request #655 from tryone144/frame-extents-fixed
Fix incorrect frame region in new backends
2021-07-10 14:06:00 +01:00
Yuxuan Shui
d9836a6751 backend: fix NULL dereference when rendering inverted windows
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-07-09 19:15:16 +01:00
Yuxuan Shui
f44d6cd7c1 backend: remove a redundant if
set_image_property is a cheap operation.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-07-09 19:01:31 +01:00
Bernd Busse
b5ce81aa47 event: never ignore changed frame extents
Changes to frame extents were only tracked if the frame was visible, but
we have to keep this information current even for invisible frames to
(not) render the correct area.
2021-07-09 19:27:42 +02:00
Bernd Busse
83c19491b8 win: use correct geometry in calculation of window frame region
Use window geometry (width, height) including border-width as the base
for frame region calculation with `_NET_FRAME_EXTENTS`, instead of
including the extents themselves.
Fixes issues where the frame would get incorrectly blurred *outside* the
window area.

fixes: #413 #590

related: fb3305fb9b
2021-07-09 19:27:37 +02:00
yshui
5388ba0946 Merge pull request #649 from tryone144/xerror-handling
Do not try to filter X errors before session is initialized
2021-07-06 19:18:12 +01:00
Bernd Busse
c2aea1803e core: do not try to ignore xerrors before session is initialized
If the user has no access to the GPU, initialization of the GLX context
fails. In the legacy backend, this occurs BEFORE the session has been
successfully initialized.
At this point we cannot meaningfully filter xerrors as the session
hasn't been initialized yet. So we don't try to.
2021-07-06 16:26:37 +02:00
yshui
049d347f52 Merge pull request #648 from tryone144/fix-pixmap-texture-nvidia
nvidia driver does not support attaching pixmap texture to fbo
2021-07-06 12:44:20 +01:00
yshui
c26fad80f7 Merge pull request #650 from tryone144/xrender-frame-opacity
Fix non-transparent frames for opaque windows in experimental xrender backend
2021-07-06 12:37:41 +01:00
Bernd Busse
0c7e237a75 backend: xrender: Force 32-bit ARGB visual for alpha target pixmaps
Force a 32-bit ARGB visual when cloning pixmaps for
`IMAGE_OP_APPLY_ALPHA`.
Fixes non-transparent frames for 24-bit windows (without alpha-channel)
even when using `frame-opacity != 1`.

fixes: #342
2021-06-24 21:49:38 +02:00
Bernd Busse
bf79653fa2 backend: gl_common: Copy texture by explict rendering to framebuffer
At least on nvidia, binding the textures from a glx pixmap to a
framebuffer results in `GL_FRAMEBUFFER_UNSUPPORTED`. Instead of using
binding the source texture to a framebuffer and using `glCopyTexImage2D()`
to copy into a new texture, explicitly render the source texture to the
new texture attached to a framebuffer.

Fixes black/invisible windows on nvidia with `frame-opacity != 1`.

see: #647

related: 2a60836a9b
2021-06-24 18:59:34 +02:00
Bernd Busse
f11710a885 backend: gl_common: Add descriptive checks for framebuffer-completeness
Added more descriptive checks for framebuffer-completeness after adding
attaching textures (for the first time).
Also check for GL errors after `IMAGE_OP_APPLY_ALPHA`.
2021-06-24 18:59:24 +02:00
Bernd Busse
e09679c7cf backend: glx: Fix texture access in max-brightness calculation
Correctly unpack the inner `gl_texture` from the backend image.

related: 2a60836a9b
2021-06-22 22:00:23 +02:00
yshui
2a23c24585 Merge pull request #638 from yshui/backend-image-api-change
Tweaking the image_op API interface.
2021-06-20 07:05:04 +01:00
Yuxuan Shui
710e5fd7a0 backend: remove image operation BAKE
It's not used.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-20 06:59:55 +01:00
Yuxuan Shui
48b7d7c27d Update coding style workflow
Alpine stopped packaging git-clang-format in newer versions.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-20 06:56:53 +01:00
Yuxuan Shui
2a60836a9b backend: split image_op into image_op and set_image_property
Currently there is some inconsistency in how image_op is implemented
across backends. The glx backend applies some of the image operations
lazily, and not always in the order the operations were made; while the
xrender backend applies the operations eagerly. This can lead to
different render result in some cases.

Instead of trying to preserving the order of operations, which would be
unnecessary, we re-model the API to better reflect the implementation.
We make it clear that setting the property doesn't change the image
data, and properties are only applied during composition and in a
specific order.

This makes sure the render result looks consistent across backends.
Should also improve the performance of the xrender backend, even if only
slightly.

Also distill out the property management code so they can be shared.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-20 06:49:38 +01:00
Yuxuan Shui
21dfe20794 backend: rename copy -> clone_image
This feels more appropriate as this operation doesn't necessarily copy
data.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-14 01:58:30 +01:00
Yuxuan Shui
d9c9742132 backend: xrender: implement read_pixel
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-09 01:51:33 +01:00
Yuxuan Shui
1ada765436 backend: xrender: make backend functions static
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-09 01:36:09 +01:00
yshui
be24c0d980 Merge pull request #631 from subnut/subnut/posix-sed
Improve POSIX-compatibility of picom-trans
2021-06-06 15:59:24 +01:00
Yuxuan Shui
86c54cc376 picom.sample.conf: fix comment about focus-exclude
Closes #594

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-04 20:01:34 +01:00
Yuxuan Shui
eaaef440a4 man: make it clear that --daemon can't be set from the config file
Closes #621

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-04 19:49:30 +01:00
yshui
27459907ca Merge pull request #591 from scrouthtv/patch-1
Minor fixes to the issue template
2021-06-04 19:13:52 +01:00
Subhaditya Nath
5394b2c2bc picom-trans: remove a no-longer-needed workaround 2021-05-31 12:32:15 +05:30
Subhaditya Nath
df1c6159fc picom-trans: Use POSIX-compatible getopts 2021-05-31 12:27:20 +05:30
Subhaditya Nath
7b4af3aef6 picom-trans: Use POSIX-compatible sed, grep
\b \? \+ \| are GNU extensions to sed

In BRE (Basic Regular Expressions) there is no \? \+ or \|
In ERE (Extended Regular Expressions) there is ? + and |
To specify sed to use ERE, specify the -E flag.

GNU grep does not distinguish between BRE and ERE, but other
implementations do. To make grep use ERE instead of BRE, specify
the -E flag.

The GNU extension \b has no equivalent in either BRE or ERE.
So, in line number 216, I used the whole initial expected output.

For quick reference (n/a means 'not available') -

 GNU BRE | POSIX BRE | POSIX ERE
 -------------------------------
    \(   |    \(     |    (
    \)   |    \)     |    )
    \?   |  \{0,1\}  |    ?  or {0,1}
    \+   |  \{1,\}   |    +  or {1,}
    \|   |    n/a    |    |
    \b   |    n/a    |   n/a
2021-05-31 12:14:19 +05:30
Yuxuan Shui
7ba87598c1 backend: gl_common: implement read_pixel
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-04-13 14:58:48 +01:00
Yuxuan Shui
6faafa95bf backend: add new API: read_pixel
Potential use: to read the border color of a window, so we could draw
rounded border when we round the corners of the window.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-04-13 14:53:57 +01:00
yshui
468d8a0879 Merge pull request #614 from yshui/rounded-border
Rounded border
2021-04-12 09:32:28 +01:00
Yuxuan Shui
b2f9f80a28 legacy glx: store tex_scr location for round corner shader
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-04-12 01:54:07 +01:00
bhagwan
d9bfd0192d legacy glx: extend the border into the corners when they are rounded
Authored-By: bhagwan <bhagwan@disroot.org>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-04-12 01:54:00 +01:00
yshui
9cb552ecd9 Merge pull request #598 from enigma9o7/next
Enable Menu Icon
2021-03-28 23:55:21 +01:00
Bodhi
8c26f2df46 Support Menu Icon 2021-03-03 00:01:55 -08:00