Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadows do not respect rounded corners #783

Closed
noctuid opened this issue Feb 15, 2022 · 14 comments · Fixed by #880
Closed

Shadows do not respect rounded corners #783

noctuid opened this issue Feb 15, 2022 · 14 comments · Fixed by #880
Labels
enhancement help wanted SOMEBODY PLEASE HELP

Comments

@noctuid
Copy link

noctuid commented Feb 15, 2022

In #770, yes I was talking about how the shadow is still as if there are not rounded corners with --experimental-backends:

2022-02-14T19:44:32_-_picomconf

@yshui yshui added enhancement help wanted SOMEBODY PLEASE HELP labels Feb 15, 2022
@wimstefan
Copy link

I can confirm the same behaviour with latest git commit.

Platform

Gentoo ~amd64

GPU, drivers, and screen setup

glxinfo -B direct rendering: Yes Memory info (GL_NVX_gpu_memory_info): Dedicated video memory: 6144 MB Total available memory: 6144 MB Currently available dedicated video memory: 3947 MB OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2 OpenGL core profile version string: 4.6.0 NVIDIA 510.54 OpenGL core profile shading language version string: 4.60 NVIDIA OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 510.54
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 510.54
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

picom details

Diagnostics **Version:** vgit-aa316
Extensions:
  • Shape: Yes
  • XRandR: Yes
  • Present: Present
Misc:
  • Use Overlay: No
    (Another compositor is already running)
  • Config file used: /home/swimmer/.config/picom/picom.conf
Drivers (inaccurate):

NVIDIA

Backend: glx
  • Driver vendors:
  • GLX: NVIDIA Corporation
  • GL: NVIDIA Corporation
  • GL renderer: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2
Configuration

backend = "glx";
vsync = true;
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
detect-transient = true;
detect-client-leader = true;
xrender-sync-fence = true;
use-ewmh-active-win = true;
log-level = "warn";

shadow = true;
shadow-radius = 24;
shadow-opacity = 0.80
shadow-offset-x = -8;
shadow-offset-y = -8;
shadow-exclude = [
"class_g = 'scribus'"
];

corner-radius = 24;
detect-rounded-corners = true;
rounded-corners-exclude = [
"window_type = 'dock'",
"class_g = 'Polybar'",
"class_g = 'Mixxx'",
];

fading = true;
fade-in-step = 0.80;
fade-out-step = 0.80;
fade-delta = 10

active-opacity = 0.90;
inactive-opacity = 0.90;
inactive-dim = 0.20;
transparent-clipping = true;
detect-client-opacity = true;
focus-exclude = [
"class_g = 'Gimp'",
"class_g = 'scribus'",
"class_g = 'Rofi'",
"name = 'Calendar'"
]

blur-method = "dual_kawase";
blur-strength = 4;
blur-background-exclude = [
"class_g = 'scribus'",
];

wintypes:
{
tooltip = { fade = true; shadow = true; opacity = 1.0; focus = true; full-shadow = true; };
dock = { shadow = true; full-shadow = false; clip-shadow-above = true; }
dnd = { shadow = false; }
notification = { full-shadow = true; }
popup_menu = { opacity = 0.8; }
dropdown_menu = { opacity = 0.8; }
};

@jarrard
Copy link

jarrard commented Mar 10, 2022

Think this could similar to my issue posted here #794

@akshat157
Copy link

akshat157 commented Mar 21, 2022

I am facing the same issue on Arch Linux with AwesomeWM.

The issue as been discussed at jonaburg#62 as well.

And there is a mention of a commit by @s0nny7 in yet another picom fork which apparently solves the problem -
ibhagwan@d74c099

I have tried the patched fork by @Arian8j2 mentioned in the former discussion but it did not work for me.

Perhaps, if someone can take inspiration from the mentioned commit and write a solution for this fork, it would be great!

@Failrule
Copy link

I have the same issue as @akshat157 I just compiled @Arian8j2 fork but corner shadows issue remains.

In this post some one mentioned ibhagwan's fork works if the @Arian8j2's fork doesn't, but it only have Archilinux and Void Linux support to compile [sad emoji here].

@aleksfadini
Copy link

aleksfadini commented Apr 24, 2022

I have the same issue, had to revert to jonaburg fork because rounded borders + shadows essentially do not work with picom in arch (meaning you'll get square after the rounded borders).
Found a fix for arch here:
jonaburg#62

(packaged for arch at https://aur.archlinux.org/packages/picom-jonaburg-fix/ )

@SaphiraKai
Copy link

The original commit that fixes this problem is here.

I would modify it and make a PR myself, but unfortunately I'm just not familiar at all with the picom codebase. It would be excellent if someone with more knowledge could take a look at this and make an implementation for this fork!

@jarrard
Copy link

jarrard commented May 14, 2022

I had a crack at it. Here is what I came up with. This isn't a patch but a replacement backend.c file. (which you can generate a patch from and edit the buildpkg file to apply said patch to test it)

backend.c.rounded.txt

@SaphiraKai
Copy link

What branch is that file for? I tried plunking it into the next branch, but I got a bunch of undeclared errors for:

  • store_back_texture
  • backend_round_context
  • reg_bound_local

@jarrard
Copy link

jarrard commented May 15, 2022

Yeah probably need change those variables.. Sorry busy until late tomorrow, can't look now.

@jarrard
Copy link

jarrard commented May 17, 2022

Ok well the below segment of codes probably can be deleted as I think picom has a new way of storing and handling this. And I brought it over from the original as it seemed important to rounded corners.

Remove this below and test again, see what happens. LOL


		// Store the window background for rounded corners
		// If rounded corners backup the region first
		if (w->corner_radius > 0) {
			const int16_t x = w->g.x;
			const int16_t y = w->g.y;
			const auto wid = to_u16_checked(w->widthb);
			const auto hei = to_u16_checked(w->heightb);
			ps->backend_data->ops->store_back_texture(ps->backend_data, w,
							ps->backend_round_context, &reg_bound, x, y, wid, hei);
		}

AND probably this below also


		// Round the corners as last step after blur/shadow/dim/etc
		if (w->corner_radius > 0.0) {
			ps->backend_data->ops->round(ps->backend_data, w,
						ps->backend_round_context, w->win_image,
						&reg_bound, &reg_visible);
		}

PS. Sorry for late reply, had allot going on.

@SaphiraKai
Copy link

SaphiraKai commented May 17, 2022

No dice. Still have this error during compilation:

../src/backend/backend.c: In function ‘paint_all_new’:
../src/backend/backend.c:468:47: error: ‘reg_bound_local’ undeclared (first use in this function)
  468 |                         pixman_region32_fini(&reg_bound_local);
      |                                               ^~~~~~~~~~~~~~~

@jarrard
Copy link

jarrard commented May 17, 2022

Yeah so basically its saying we have not declared what reg_bound_local is/does. Not sure why yet.

You might have made mistake during editing because it shouldn't be at line 468 but ~456! (or maybe you had 10 more spaces somewhere)

(think I uploaded right one)
backend.c.original.rounded.txt

@SaphiraKai
Copy link

SaphiraKai commented May 18, 2022 via email

@fuegoio
Copy link

fuegoio commented Jun 19, 2022

@SaphiraKai I just created a PR inspired by the commit you linked to. It works on my setup, could you check it works on your too ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted SOMEBODY PLEASE HELP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants