When removing shadow behind a window with rounded corners, keep the
corner part - those parts will be removed using the mask instead.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
There are some complications, when sampling pixels outside a
xrender picture, xrender doesn't support a behaviour similar to OpenGL's
clamp to border. So we give the masks an extra 1-pixel outer rim, so
we can control what color the outside pixels would be, by using the
"Pad" repeat mode.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This is used to create image masks that can be used to mask out
`compose` regions. For example, this can be used to mask out window body
so shadow won't be painted on them.
This could be more efficient than using rectangular regions for masking,
when there are a large number of rectangles; or more flexible, in the
case of window with rounded corners.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This does not ever happen in practice. But conceptually, the GL backend
holds 2 kinds of images: those in GL coordinate system, and those in X
coordinate system. They are differentiated by the `y_inverted` variable,
and applying alpha to them needs differs in whether y needs to be
inverted. Right now we never invert y, because we only ever call apply
alpha on images in the X coordinate system.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Previously postprocessing is omitted when estimating the color of the
border (e.g. dimming, opacity, inversion, etc.), causing the border to
be drawn with the wrong color.
Related: #770
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
The outer pixels of the corner are drawn with antialiasing, but it color
used for antialiasing is wrong. The estimated border color is used when
there is actually no border.
Related: #770
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
If a window's border_width is bigger than its corner_radius, the inner
radius of the border become less than 0, causing the entire window to be
filled.
Fixes#778
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This is meant to be used to detect GPU resets.
Implemented in the glx backend using the GL_ARB_robustness extension.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
There were a few improper uses of %ld for 64 bit numbers, as well as
some other 32 bit related warnings that I've fixed.
Signed-off-by: ktprograms <ktprograms@gmail.com>
We were using default_clone_image, but:
1) it's copying the wrong type, xrender_image has an extra member.
2) it doesn't clone the rounded corner cache properly, that has to be
separately reference counted.
Reported-in: #728
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
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
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.
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
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
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`.