Skip to content

fix shadow for rounded window#34

Open
s0nny7 wants to merge 1 commit into
ibhagwan:next-rebasefrom
s0nny7:fix-shadow-clean
Open

fix shadow for rounded window#34
s0nny7 wants to merge 1 commit into
ibhagwan:next-rebasefrom
s0nny7:fix-shadow-clean

Conversation

@s0nny7

@s0nny7 s0nny7 commented Jun 9, 2021

Copy link
Copy Markdown

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.

@ibhagwan

ibhagwan commented Jun 9, 2021

Copy link
Copy Markdown
Owner

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.

@s0nny7

s0nny7 commented Jun 10, 2021

Copy link
Copy Markdown
Author

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)

@victor-timofei

Copy link
Copy Markdown

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;

image

@s0nny7

s0nny7 commented Jul 1, 2021

Copy link
Copy Markdown
Author

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.

@reeseovine

reeseovine commented Sep 3, 2021

Copy link
Copy Markdown

image image

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!

@ibhagwan

ibhagwan commented Sep 3, 2021

Copy link
Copy Markdown
Owner

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?

@frak0d

frak0d commented Sep 23, 2021

Copy link
Copy Markdown

image image

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 ?

@scrouthtv

This comment has been minimized.

@reeseovine

Copy link
Copy Markdown

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;

@reeseovine

Copy link
Copy Markdown

I'm wondering what this PR fixes after all -- the shadows are rounded on the main branch iirc already?!

@scrouthtv see #3.

@godalming123

Copy link
Copy Markdown

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.

@ljmill

ljmill commented Aug 20, 2022

Copy link
Copy Markdown

Does this fork actually make the shadows rounded? If so, am I missing something? I installed it and nothing seemed to have changed.

@godalming123

Copy link
Copy Markdown

It does make the shadows rounded but you need to turn on the rounded window option in your config

@ljmill

ljmill commented Aug 20, 2022

Copy link
Copy Markdown

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; }
};

@godalming123

Copy link
Copy Markdown

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?

@ljmill

ljmill commented Aug 20, 2022

Copy link
Copy Markdown

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.

window-corner

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.

@aalvarado

Copy link
Copy Markdown

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.

window-corner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants