Commit Graph

1815 Commits

Author SHA1 Message Date
Yuxuan Shui
ba2e24af3e core: detect screen off
Use the DPMS extension to detect if screen is turned off, and unredirect
if it is. This also helps working around the problem where OpenGL
buffers lose data when screen is turned off, causing screen to flicker
later when it turns back on if use-damage is enabled.

Unfortunately the DPMS extension doesn't define an event, so we have to
periodically poll the screen state.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
0278a1fb0b backend: xrender: fix using of invalid picture when vsync is disabled
Fixes #974

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
931c1b8bf6 x: fix missing _checked
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
6906e6694a core: add set_cant_fail_cookie
Enables picom to abort when certain requests fail.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
f1bff49b1c core: expand X error handling
We used to have a list of X errors we should ignore in case they do
occur. This commit expands that functionality to also allow us aborting
on certain errors.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
fe3f53f3a4 x: fix CI build failure
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
57956fb219 general: fix compiler warning about unused results
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
c51020aef7 event: restore event sequence number after passing it to Xlib handlers
We set event sequence number to the last sequence xlib knows about to
silence its complaint about missing sequence numbers, but we forgot to
restore it back afterwards.

This used to break error ignoring mechanism in `should_ignore`. In the
last commit we updated it to use full_sequence which incidently fixed
this problem. But let's restore the sequence number anyway for good
measure.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
eec8bf79d2 core: print error with full_sequence
ev->sequence was just the lower 16 bits of the sequence number.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
227cb55ca5 backend: xrender: set update region for PresentPixmap request
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
e9ff18e1bd x: add x_{create,destroy}_region
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
43d8d3ed5d backend: add a comment
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
bf0832cd4c utils: add rolling_avg
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
9c3204cc72 utils: add rolling_max
For tracking rolling max of a stream of integers.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
bc1f99f2ae backend: gl: fix use-after-scope
'format' was pointing to an array with a shorter lifetime

suggested by @tryone144

Co-authored-by: Bernd Busse <bernd@busse-net.de>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
d21fb34e55 backend: gl: try different back buffer formats
Prefer RGB formats first, because they use less memory; but fallback to
RGBA formats, as they are formats required by OpenGL.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
7f18e74b8f backend: gl: don't add dither where it's not needed
If a pixel is perfectly representable as an 8-bit number, don't add
dither. Reduce artifacts where dither is unnecessary.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
2173654fbd options: add dithered-present option
See also 0a2cd0f14e

Related: #602

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
123ef51210 backend: gl: add dither
Add bayer ordered dithering when presenting to screen. Reduce banding
when using a strong blur. Also use 16-bit intermediary textures to
preserve precision in the rendering pipeline.

Related: #602

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
4ecc3e65a9 man: fix typo
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
4a7a9e8079 Update README.md
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Maxim Solovyov
dacadb9fc3 README: fix meson's warnings about setup commands
this fixes `WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.` warning while setting up the project
2023-01-23 07:34:35 +03:00
Jake
144e78fd5d Change dreaw -> draw 2023-01-23 07:34:35 +03:00
Yuxuan Shui
d647ccca16 README: update pcre requirements
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
9fe7e65e3e c2: replace pcre with pcre2
Because pcre has been deprecated.[1]

There are subtle changes from pcre to pcre2, so this could be a breaking
change.

Closes #895

[1]: https://www.pcre.org/original/changelog.txt

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Evgeniy Baskov
ad5a042803 win: consider border when creating the mask image
With rounded corners, X11 native border and blur enabled, left and
bottom 2*border_width pixels were not blurred, since mask did not
include border_width, only content width and height.

Create mask image with dimensions that include border width.

Signed-off-by: Evgeniy Baskov <j-basevgser@yandex.ru>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
0a82f460e0 backend: egl: fix warning 2023-01-23 07:34:35 +03:00
Yuxuan Shui
49490ab99f backend: egl: fix undefined symbols on old systems
Users with an old EGL version won't be able to use the egl backend. OTOH
we shouldn't prevent them from running picom because of a feature they
won't even use.

Don't assume the existence of EGL 1.5 symbols.

Fixes #945

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
h7x4
9bf39b8d1d picom.sample.conf: Add egl to backend option doc 2023-01-23 07:34:35 +03:00
Omar Polo
11a195747a backend: egl: don't assume glEGLImageTargetTexStorage exists
Use eglGetProcAddress instead.

Fixes #932
2023-01-23 07:34:35 +03:00
Yuxuan Shui
89690c9843 win: fix leaking of the mask image
destroy_win_finish doesn't call win_release_images to free the images,
so we need to add a release_mask call there.

Related: #892

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Omar Polo
935885d396 fix log_debug call 2023-01-23 07:34:35 +03:00
Yuxuan Shui
611f8b80c2 backend: gl: handle blur context creation failure
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
8f848c2b1d backend: gl: fix crash when shadow radius is 0
Fixes #927

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
a10a64f984 Fix typo
Fixes #922

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
1434881567 win: assert we won't clobber existing mask
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
fa21c44ee7 backend: gl: fix shadow from mask
The intermediate texture used for shadow from mask calculation did not
properly set the min/mag filter to linear, which is required by the blur
methods. Because they use texture interpolation to accelerate
the convolution calculation.

Fixes #916

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
dbb81b5116 doc: remove mention of raw string pattern
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Alp
f7596fd43a rounded corner delay fix 2023-01-23 07:34:35 +03:00
Yuxuan Shui
f7a950a638 Bump version number
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
fbe7ed5699 options: improve usage message printing
Laying the usage message out by hand is tedious, also error prone
because the option names are duplicated at 2 places and have to be
consistent.

Create a struct to hold the option names and help messages, and
do layout programmatically.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
0004173ecd Rename COMPTON_VERSION to PICOM_VERSION
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Stefan Radziuk
1e5de4067b picom upto date sync with yshui, full anim support 2023-01-23 07:34:35 +03:00
Yuxuan Shui
04b80760d8 win: fix leak in win_bind_mask
Related: #905

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:33:56 +03:00
Arda Atci
f6b0b04f5b picom upto date sync with yshui, full anim support 2022-10-04 00:24:05 +03:00
Yuxuan Shui
7107241519 meson.build: no -Wimplicit-fallthrough when building with clang
clang does not recognize the fallthrough annotation used in uthash.h, so we
change -Wimplicit-fallthrough to the single argument form currently only
supported by GCC.

We are still detecting implicit fallthroughs with GCC in CI.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-09-30 11:26:50 +01:00
Yuxuan Shui
c1dc11f59c backend: egl: fix resource leak
Destroy context and surface as well in egl_deinit.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-09-29 19:09:59 +01:00
Yuxuan Shui
0fe4e0a1d4 Merge pull request #878 from yshui/egl
Add an experimental egl backend
2022-09-29 08:06:36 +01:00
Yuxuan Shui
b71a8420ca options: add warning for using the egl backend 2022-09-29 08:03:21 +01:00
Yuxuan Shui
94183c8e03 README: add libEGL dependency
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-09-29 08:03:20 +01:00