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

Add clip-shadow-above configuration and wintype option #656

Merged
merged 1 commit into from
Jul 14, 2021

Conversation

tryone144
Copy link
Collaborator

@tryone144 tryone144 commented Jul 9, 2021

Added the new shadow-crop-window configuration option and crop-shadow wintype option. These allow the user to select windows to crop from the shadow region of other windows, i.e. don't paint shadows on top of them.

This should provide a more useful and user friendly alternative to the deprecated shadow-exclude-reg option.
See #494 and #582 (comment).


The name of this new option is up for debate. My rationale behind not calling it shadow-exclude-window was to avoid confusion with the similarly named shadow-exclude option that disables the shadow that a window casts. In contrast, the new option prevents shadows from being cast onto the target window.
I am not a native speaker, so if crop does not intuitively convey they right meaning, clip might work as well (or trim, truncate, …).

EDIT: Renamed the options to clip-shadow-above.

@codecov
Copy link

codecov bot commented Jul 9, 2021

Codecov Report

Merging #656 (4b5cc05) into next (98fe899) will decrease coverage by 0.10%.
The diff coverage is 58.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next     #656      +/-   ##
==========================================
- Coverage   39.33%   39.23%   -0.11%     
==========================================
  Files          46       46              
  Lines        9581     9612      +31     
==========================================
+ Hits         3769     3771       +2     
- Misses       5812     5841      +29     
Impacted Files Coverage Δ
src/config.h 23.52% <ø> (ø)
src/options.c 21.34% <0.00%> (-0.19%) ⬇️
src/render.c 4.09% <0.00%> (-0.05%) ⬇️
src/win.h 78.12% <ø> (ø)
src/backend/backend.c 63.35% <71.42%> (+0.36%) ⬆️
src/config.c 42.74% <100.00%> (+0.70%) ⬆️
src/config_libconfig.c 58.47% <100.00%> (+0.49%) ⬆️
src/picom.c 67.80% <100.00%> (-0.58%) ⬇️
src/win.c 68.13% <100.00%> (-0.73%) ⬇️
... and 1 more

@yshui
Copy link
Owner

yshui commented Jul 10, 2021

Thanks for implementing this!

As for the name, I am not sure either. I am thinking about something like above-shadow, meaning the window will be above shadows, what do you think? Otherwise I think clip-shadow is probably better.

@tryone144
Copy link
Collaborator Author

After giving this some more thought, I think clip-shadow-above for the rules and wintype option might be a more descriptive name. Would you be fine with this?
I am not too keen on implying the window is actually above the shadow, as it technically isn't which becomes obvious for transparent windows.

Apart from the name change, I am probably going to rebase this on top of the changes in #657.

@yshui
Copy link
Owner

yshui commented Jul 13, 2021

@tryone144 Yeah, that sounds good 👍

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.
@tryone144 tryone144 changed the title Add shadow-crop-window configuration and crop-shadow wintype options Add clip-shadow-above configuration and wintype option Jul 14, 2021
@tryone144
Copy link
Collaborator Author

Renamed to clip-shadow-above and rebased.
Merging this should provide a solution to #494 and (possibly) #4.

@yshui
Copy link
Owner

yshui commented Jul 14, 2021

Thank you!

@yshui yshui merged commit 057a939 into yshui:next Jul 14, 2021
@tryone144 tryone144 deleted the shadow-crop-window branch July 15, 2021 11:19
@joaopauloalbq
Copy link

Any possibility to clip shadow above shadow and thus avoid overlapping shadows?

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.

3 participants