picom
picom copied to clipboard
fix shadow for rounded window
Sorry for the mess, it took me a whole branch to figure out how to properly squash and merge my commits.
I've combined all my changes into this pull request, hope it helps.
I’m not sure why (perhaps tabbing / alignment) but your commit wishes to replace lines 191-254 instead of just adding the lines at ~200, don’t worry about fixing it I’ll just add it manually.
I’m not sure why (perhaps tabbing / alignment) but your commit wishes to replace lines 191-254 instead of just adding the lines at ~200, don’t worry about fixing it I’ll just add it manually.
Guess it's because I changed the painting process, the shadow painting part is moved before the blur part. (to deal with the sharp corner generated by blurring)
I did clone this fix, and for me, it did not work with transparent windows. You can see the red shadow behind the transparent windows.
shadow = true;
shadow-red = 80;

I don't get it. This fix is for filling the gap between rounded window corner and squared shadow, since the original version generates the shadow for rectangle shape, which does not match the rounded window.
I don't think it has something to do with shadow under the window, could you please explain the problem in details?
btw. Nice look. I didn't know the color of the shadow can be changed like that.

Works for me! I can't tell whether the shadow bleeds underneath the window so it's not a big issue for me. Thanks for your PR, I hope this can be merged soon!
I'm still a bit weary of making changes to this fork since it's used by so many and who knows what kind of other issues this might cause, maybe it's better I just create a feature branch and people can test it out?
![]()
Works for me! I can't tell whether the shadow bleeds underneath the window so it's not a big issue for me. Thanks for your PR, I hope this can be merged soon!
wait.... how did you make the shadow come out from all sides ?
I'm wondering what this PR fixes after all -- the shadows are rounded on the main branch iirc already?!
wait.... how did you make the shadow come out from all sides ?
@Tanishq-Banyal it took a bit of trial and error getting the positioning right. here's the relevant section of my picom.conf:
shadow = true;
shadow-radius = 17;
shadow-offset-x = -17;
shadow-offset-y = -12;
shadow-opacity = 0.25;
I'm wondering what this PR fixes after all -- the shadows are rounded on the main branch iirc already?!
@scrouthtv see #3.
I'm still a bit weary of making changes to this fork since it's used by so many and who knows what kind of other issues this might cause, maybe it's better I just create a feature branch and people can test it out?
I agree 👍. I would like this to be merged into the new branch with the latest picom upstream commits as well. And this is the only thing stopping me from using shadows.
Does this fork actually make the shadows rounded? If so, am I missing something? I installed it and nothing seemed to have changed.
It does make the shadows rounded but you need to turn on the rounded window option in your config
It does make the shadows rounded but you need to turn on the rounded window option in your config
Was there a specific option for that other than corner-radius? I re-built and installed this fork and my shadows are still rectangular. Here is my config
#################################
# Corners #
#################################
corner-radius = 10.0;
rounded-corners-exclude = [
#"window_type = 'normal'",
"class_g = 'awesome'",
"class_g *?= 'eww'"
];
round-borders = 1;
#################################
# Shadows #
#################################
shadow = true;
shadow-radius = 0;
shadow-opacity = 1.0;
shadow-offset-x = 8;
shadow-offset-y = 8;
#################################
# Fading #
#################################
fading = true;
fade-in-step = 0.09;
fade-out-step = 0.09;
fade-exclude = [
"class_g = 'slop'"
]
no-fading-openclose = false
#################################
# Transparency / Opacity #
#################################
inactive-opacity = 0.8;
frame-opacity = 0.7;
popup_menu = { opacity = 0.8; }
dropdown_menu = { opacity = 0.8; }
inactive-opacity-override = false;
active-opacity = 1.0;
focus-exclude = [
"class_g = 'Cairo-clock'",
"class_g = 'Bar'",
"class_g = 'slop'"
];
opacity-rule = [
"80:class_g = 'Bar'",
"100:class_g = 'slop'",
"100:class_g = 'XTerm'",
"100:class_g = 'URxvt'",
"100:class_g = 'kitty'",
"100:class_g = 'Alacritty'",
"100:class_g = 'code-oss'",
"100:class_g = 'Meld'",
"70:class_g = 'TelegramDesktop'",
"90:class_g = 'Joplin'",
"100:class_g = 'firefox'",
"100:class_g = 'Thunderbird'",
#"90:class_g = 'Thunar'",
#"50:class_g = 'Bspwm' && class_i = 'presel_feedback'"
];
#################################
# Background-Blurring #
#################################
blur: {
method = "dual_kawase";
strength = 3;
background = false;
background-frame = false;
background-fixed = false;
kern = "3x3box";
}
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'widget'",
"class_g = 'slop'",
"class_g = 'polybar'",
"class_g *?= 'eww'",
"class_g *?= 'firefox'",
"_GTK_FRAME_EXTENTS@:c"
];
#################################
# General Settings #
#################################
experimental-backends = true;
backend = "glx";
vsync = true
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0
detect-transient = true
detect-client-leader = true
use-damage = false
log-level = "info";
wintypes:
{
normal = { fade = true; shadow = true; }
tooltip = { fade = false; shadow = false; opacity = 0.75; focus = true; full-shadow = false; };
dock = { shadow = false; }
dnd = { shadow = false; }
popup_menu = { opacity = 0.9; }
dropdown_menu = { opacity = 0.8; }
};
It does make the shadows rounded but you need to turn on the rounded window option in your config
Was there a specific option for that other than corner-radius? I re-built and installed this fork and my shadows are still rectangular. Here is my config
################################# # Corners # ################################# corner-radius = 10.0; rounded-corners-exclude = [ #"window_type = 'normal'", "class_g = 'awesome'", "class_g *?= 'eww'" ]; round-borders = 1; ################################# # Shadows # ################################# shadow = true; shadow-radius = 0; shadow-opacity = 1.0; shadow-offset-x = 8; shadow-offset-y = 8; ################################# # Fading # ################################# fading = true; fade-in-step = 0.09; fade-out-step = 0.09; fade-exclude = [ "class_g = 'slop'" ] no-fading-openclose = false ################################# # Transparency / Opacity # ################################# inactive-opacity = 0.8; frame-opacity = 0.7; popup_menu = { opacity = 0.8; } dropdown_menu = { opacity = 0.8; } inactive-opacity-override = false; active-opacity = 1.0; focus-exclude = [ "class_g = 'Cairo-clock'", "class_g = 'Bar'", "class_g = 'slop'" ]; opacity-rule = [ "80:class_g = 'Bar'", "100:class_g = 'slop'", "100:class_g = 'XTerm'", "100:class_g = 'URxvt'", "100:class_g = 'kitty'", "100:class_g = 'Alacritty'", "100:class_g = 'code-oss'", "100:class_g = 'Meld'", "70:class_g = 'TelegramDesktop'", "90:class_g = 'Joplin'", "100:class_g = 'firefox'", "100:class_g = 'Thunderbird'", #"90:class_g = 'Thunar'", #"50:class_g = 'Bspwm' && class_i = 'presel_feedback'" ]; ################################# # Background-Blurring # ################################# blur: { method = "dual_kawase"; strength = 3; background = false; background-frame = false; background-fixed = false; kern = "3x3box"; } blur-background-exclude = [ "window_type = 'dock'", "window_type = 'widget'", "class_g = 'slop'", "class_g = 'polybar'", "class_g *?= 'eww'", "class_g *?= 'firefox'", "_GTK_FRAME_EXTENTS@:c" ]; ################################# # General Settings # ################################# experimental-backends = true; backend = "glx"; vsync = true mark-wmwin-focused = true; mark-ovredir-focused = true; detect-rounded-corners = true; detect-client-opacity = true; refresh-rate = 0 detect-transient = true detect-client-leader = true use-damage = false log-level = "info"; wintypes: { normal = { fade = true; shadow = true; } tooltip = { fade = false; shadow = false; opacity = 0.75; focus = true; full-shadow = false; }; dock = { shadow = false; } dnd = { shadow = false; } popup_menu = { opacity = 0.9; } dropdown_menu = { opacity = 0.8; } };
Unsure, you've set all the potions I had in my config when I used picom. Are your window corners rounded or are they rectangular?
Unsure, you've set all the potions I had in my config when I used picom. Are your window corners rounded or are they rectangular?
Yeah. Window corners are rounded. The shadows are not.

I really don't know why it wouldn't work. Could you possibly plug my config in and see if you still have rounded corners?
EDIT: when I change my backend to xrender the shadows become rounded. However, the window corners are not rounded on every window. Additionally, it cuts off the border around the rounded corners so it kind of looks bad. Not really sure if this is normal or not.
Unsure, you've set all the potions I had in my config when I used picom. Are your window corners rounded or are they rectangular?
Yeah. Window corners are rounded. The shadows are not.
I really don't know why it wouldn't work. Could you possibly plug my config in and see if you still have rounded corners?
EDIT: when I change my backend to xrender the shadows become rounded. However, the window corners are not rounded on every window. Additionally, it cuts off the border around the rounded corners so it kind of looks bad. Not really sure if this is normal or not.
xrender backend has the same effect for me, not really usable. The one that works sort of better is glx but has an inverse square on semi transparent windows or when windows are fading in/out.