-
-
Notifications
You must be signed in to change notification settings - Fork 588
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
Experimental backends: fade/hide blur-texture for transparent windows #364
Conversation
Codecov Report
@@ Coverage Diff @@
## next #364 +/- ##
==========================================
+ Coverage 32.35% 33.93% +1.57%
==========================================
Files 46 45 -1
Lines 8526 8552 +26
==========================================
+ Hits 2759 2902 +143
+ Misses 5767 5650 -117
|
@tryone144 the only concern i have is: does this transitions smoothly when window is fading? |
In fact, the current experimental backend behavior is not "blur-background-fixed: true", as during fading, the blur opacity would transition smoothly. I think blur should always transition smoothly during fading, regardless what the "blur-background-fixed" setting is. This kind of makes this option awkwardly named. |
Also I want to explain the rational behind the current behavior a bit: I consider the opacity as part of the "intrinsic" property of the window. And when a window is displayed in its "natural" state, its background should be fully blurred. Consider this: a window could itself have a transparent background (e.g. transparent terminals), or it could have an opacity value set. Visually, these two cases are barely distinguishable, however, they will get very different blur if But I do agree this should be configurable (probably with a better named option). |
Yes, it is as smooth as window opacity itself is.
Totally agree on that. Fading should always be smooth. Another solution would be to explicitly check if the window is fading from/to fully transparent which could be always on like the current behavior for mapping/unmapping . Naming was just taken from the legacy backend, but can be changed accordingly.
The last part has bugged me already while testing. I have tried making the blur fully opaque if the window is in its
What about |
5316a81
to
7c1e6d1
Compare
--blur-background-fixed
Based on your thoughts I have reverted the initial proposal of honoring Instead, the blur-texture for fully transparent windows (i.e. While testing I found the blur-texture to be alpha-clipping for On further examination I am not sure if a feature like the legacy |
7c1e6d1
to
f02c261
Compare
|
Let me make sure I understand your intention correctly: You want to make ~0% opacity windows to be treated like an unmapped window blur-wise. i.e. blur won't be shown if a window has ~0% opacity, and when transitioning to/from 0% opacity, blur will be faded as well. I like this idea. Also, do you think we should add an option for enabling/disabling this? I think we don't need to, unless someone complains. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some small things.
BTW, can you list the steps to reproduce this problem? I intend to write a test case for it. Edit: never mind, I figured it out |
This should be fixed by merging #364. Thanks @tryone144 for pointing out the root cause. Signed-off-by: Yuxuan Shui <[email protected]>
f02c261
to
c0eccdb
Compare
Exactly. This should feel more intuitive to users as well.
I don't think we need an option just for the sake of having one. A quick workaround would be to set the Regarding #314 / #318: |
More regarding the new testcase: You can still trigger the I haven't managed to trigger it while in I will run some more tests with // Gradually increase the blur intensity during
// fading in.
if (w->opacity < w->opacity_target) {
blur_opacity = w->opacity / w->opacity_target;
} else if (w->opacity_target < (1.0 / MAX_ALPHA)) {
// `opacity_target` changed during fade in.
// Fade out if suitable or leave at 1.
blur_opacity = w->opacity / w->opacity_target_old;
} for the |
I think we could maybe set the window state to FADING when opacity target changed in MAPPING state? |
Changed that with some additional logic to only change to FADING if new target is already reached. Also reduced the tracking of old I will play around with it a bit and write a second testcase for repeatedly updating the opacity. |
👍 Let me know when this is ready to be merged. |
These two flags are intended for subtly different things. I can probably justify the distinction, but it's definitely difficult to explain. And there is no obvious benefits to keep them separate. Signed-off-by: Yuxuan Shui <[email protected]>
c0eccdb
to
96addb4
Compare
I've expanded the logic around tracking changes of
The updated testcases should check for correct handling of all three cases and as well as the destruction/unmap of a window that is currently fading out. |
96addb4
to
d390631
Compare
* Add new field `opacity_target_old` to `struct managed_win` for tracking relevant `opacity_target` changes. * Smoothly fade blur-texture opacity on window opacity changes (based on window opacity), when the window was or will be fully transparent (`w->opacity ~< 0.004`). * Fixed alpha-clipping of the blur-texture when using `inactive-opacity` or repeatedly setting window opacity with large fade intervals (should fix yshui#314).
remove unrequired parameter `ignore_state` of `win_calc_opacity_target()` that was always `false` now.
Handle more (hopefully all) edge-cases when updating `opacity_target_old`: * `MAPPING` transitions to `FADING` if new target is reached. Otherwise no update. * `FADING` clamps to current `opacity` if old target is too small. * `UNMAPPING`/`DESTROYING` clamps to current `opacity` if old target is too small.
d390631
to
c1d985e
Compare
@tryone144 I made a small change to make sure Otherwise everything looks good. This is a really well thought out change, good job. |
The new experimental backends did not honor the
--blur-background-fixed
option. This implements handling of said option in the new backends.If set to
false
, the (premultiplied) opacity of the blur-texture is dependent on the window opacity preventing awkward-looking blurred rectangles behind transparent windows especially with low--inactive-opacity
values.Example: https://imgur.com/a/sCDVqAI
In-depth discussion in tryone144/compton#2
Stuff for further discussion:
The current (longtime) default of
false
did irritate some users who used a strong blur withactive-opacity
andopacity-rule
: tryone144/compton#25, tryone144/compton#33