Commit Graph

1609 Commits

Author SHA1 Message Date
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
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
scrouthtv
d25a6e4831 Minor fixes to the issue template 2021-02-07 22:42:38 +01:00
yshui
3680d323f5 Merge pull request #579 from lschmelzeisen/next
Add packages needed for building on Fedora to README.
2021-01-24 20:59:20 +00:00
yshui
1d6a014e26 Merge pull request #581 from thiagokokada/fix-meson-flag-in-circleci
circleci: rename "-Dbuild_docs" -> "-Dwith_docs"
2021-01-24 20:58:52 +00:00
Thiago Kenji Okada
acadafb073 circleci: rename "-Dbuild_docs" -> "-Dwith_docs"
This was renamed in commit 3f2a671, but I think it was simply forgotten
in CI.
2021-01-06 00:08:21 -03:00
Lukas Schmelzeisen
3d4f9f925f Add packages needed for building on Fedora to README. 2021-01-04 22:52:43 +01:00
Yuxuan Shui
d974367a04 backend: xrender: remove root_pict from _xrender_data
It's unused in the backend.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-26 07:53:03 +00:00
Yuxuan Shui
f5fb2648fd x: remove more of session_t parameters
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-26 07:51:03 +00:00
Yuxuan Shui
d61fa6eb0c x: restrict the scope of arguments taken by x_get_prop*
They only need a xcb_connection_t, don't need to pass the whole
session_t.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-26 07:39:21 +00:00
Yuxuan Shui
e3d4ce6612 cache: add cache_set for testing
Also add documentation for the cache functions.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-26 07:25:34 +00:00
Yuxuan Shui
1df3360989 diagnostic: warn the user if they are using a software GL renderer
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-23 03:11:25 +00:00
Yuxuan Shui
b66e5fd422 win: sanitize _NET_FRAME_EXTENTS values
Shouldn't crash picom for window manager bugs.

Related: https://github.com/yshui/picom/issues/270#issuecomment-748210643

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-18 23:45:11 +00:00
Bernd Busse
cce531a5ed opengl: fix warning about unused variable 2020-12-17 23:19:53 +01:00
Bernd Busse
a335eed0b5 c2: Fix scope of predefined target in leaf-matching
Keeping pointers to variables with smaller scope is unsafe as the
compiler might choose to optimize them out.
2020-12-17 11:37:19 +01:00
yshui
2e2b1eeeb1 Update README.md 2020-12-17 00:25:57 +00:00
Yuxuan Shui
896c1a7702 render: restrict painting region of glx_round_corners_dst
Mistake during rebase.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-16 23:34:53 +00:00
Yuxuan Shui
06c58d0b8e render: avoid left shifting negative values
It's undefined behavior.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-16 22:55:33 +00:00
yshui
79f1d4e79d Merge pull request #558 from yshui/rounded-corners-legacy-glx2
Rounded corners for legacy glx backend
2020-12-16 21:22:15 +00:00
Yuxuan Shui
0f5f013b96 Rounded corners for legacy glx backend
Authored-by: bhagwan <bhagwan@disroot.org>
Authored-by: Samuel Hand <samuel.d.hand@gmail.com>
2020-12-16 18:10:36 +00:00