-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
Feature Request: support window vibrancy and blur #1113
Comments
This would be for background blur: extern CGError SLSSetWindowBackgroundBlurRadius(int cid, uint32_t wid, uint32_t radius); and the other things needed for vibrancy effects I think are listed in the bottom of this file: https://github.com/NUIKit/CGSInternal/blob/master/CGSWindow.h |
where the hell is the Core Graphics Skylight framework documented? |
I looked at blur a long time ago and did not like the result: #493 |
I don't think #1115 is the way to go about this. Windows with modified alpha will deactivate the background blur. I have quickly hacked together something with limelight: The way my quick and dirty hack works is by creating a new transparent window behind the actual window where I set |
Window ordering groups work fine on Monterey, it is the movement group that causes the issues as far as I remember, so I do believe your version for enabling window blurs could work. |
@FelixKratz @koekeishiya any way I can help ship this to yabai or will this only be possible with limelight? |
Any update on this? |
It is a fairly minor change that can be incorporated the exact same way current window borders are implemented. This is exactly what I have done in my above screenshots. |
It can be done even easier than described above: When doing it this way it is as simple as giving the border a fill color and a background blur. |
I see that a previous pull request #1115 was made for window blurring, but it was closed. But has this new solution been made into a pull request yet? Would love to see @FelixKratz 's solution come to fruition! :) |
I think I have read somewhere that pull requests are generally not welcome on this project. Just create a fork and patch these changes in, thats why I have linked my fork for most of the changes I have made (e.g. the mach ipc for the scripting addition). This being said, I noticed some people are actually using my fork. Please don't, it is full of things I have changed only for my personal preference and for experimenting. It is only linked so you can cherry-pick changes you like to your own fork. |
what do you use for desktop customization? It looks amazing |
Thanks. Do you consider adding a rounded corners on the border? |
This will be fixed with the changes being made for #1430 |
how do I install my own fork of yabai? |
It is possible to bind a |
If it can be added to an arbitrary window using the scripting-addition, yes. If it is going to work in the same way as the current version that relies on the borders, then I'm not particularly interested in making adjustments at this time. |
Yeah, that is possible -- I just tried it and I am able to add arbitrary surfaces to arbitrary windows. The surface moves and orders with the window fully automatically. This could also be used to make a more robust border system. But it has to be handled with caution, because these surfaces will continue to exist even after yabai exits. |
Maybe it is time to work on having fully persistent state, which would also solve this new issue. |
I assume this works more or less in the following way?
|
Yes, this is what I was testing with: [CATransaction begin];
CAContext* context = [CAContext contextWithCGSConnection:_connection options:nil];
CABackdropLayer* layer = [[CABackdropLayer alloc] init];
layer.frame = bounds;
layer.windowServerAware = true;
layer.cornerRadius = 10;
layer.borderWidth = 2;
layer.borderColor = CGColorCreateGenericRGB(1, 1, 1, 1);
CAFilter* blur = [[CAFilter alloc] init];
[blur initWithType:kCAFilterGaussianBlur];
NSNumber *normalize = [NSNumber numberWithBool:true];
[blur setValue:normalize forKey:@"inputNormalizeEdges"];
NSNumber *radius = [NSNumber numberWithFloat:100.0f];
[blur setValue:radius forKey:@"inputRadius"];
CAFilter* saturate = [[CAFilter alloc] init];
[saturate initWithType:kCAFilterColorSaturate];
NSNumber *saturation = [NSNumber numberWithFloat:1.2f];
[saturate setValue:saturation forKey:@"inputAmount"];
NSArray* filters = @[saturate, blur];
[layer setFilters:filters];
context.layer = layer;
uint32_t sid = 0;
SLSAddSurface(_connection, wid, &sid);
SLSSetSurfaceBounds(_connection, wid, sid, bounds);
SLSSetSurfaceResolution(_connection, wid, sid, 2.0);
SLSSetSurfaceColorSpace(_connection, wid, sid, context.colorSpace);
SLSBindSurface(_connection, wid, sid, 4, 0, context.contextId);
SLSOrderSurface(_connection, wid, sid, 1, 0);
[CATransaction commit]; |
Can we at least get rid of the gray(alpha channel) background appearing while animations are on? |
@FelixKratz after #1889 what has been your solution for this? I'd completely forgotten to update for a while and missed that announcement much to my surprsie. Does your Janky Borders project facilitate blurred windows? |
This is a feature in other window manager ecosystems
https://www.reddit.com/r/unixporn/comments/rqjrls/i3gaps_local_man_install_arch_tells_no_one/
https://www.reddit.com/r/unixporn/comments/nkxagu/bspwm_i_quite_like_blur/
It looks like this can be implemented in macos fairly easily?
https://developer.apple.com/documentation/uikit/uivibrancyeffect?language=objc
https://developer.apple.com/documentation/appkit/nsvisualeffectview?language=objc
I would love to contribute this feature but not sure how feasible and I couldn't find much useful documentation. It seems like the Core Graphics API in use does not match what I found in Apple's docs.
yabai/src/osax/payload.m
Line 654 in 846723a
versus
https://developer.apple.com/documentation/coregraphics/1456404-cgcontextsetalpha?language=objc
What are your thoughts @koekeishiya
The text was updated successfully, but these errors were encountered: