Open danirabbit opened 4 years ago
I made you a dumb example doing this with 2 shadows and simple blending modes in CSS. Not sure you really need a custom shader. Its definitely not flawless but it might be a simple place to start.
I don't think this is a feasible thing to do in gala at least partially. Shadows in Gtk3 are being drawn by the client itself, not the WM. If we were to do it just here in gala we would need to:
Both methods assume a lot about how a window looks like but this cannot be fixed either in mutter, because of the chosen architecture by Gtk.
I don't think this is a feasible thing to do in gala at least partially. Shadows in Gtk3 are being drawn by the client itself, not the WM. If we were to do it just here in gala we would need to:
1. Render the window to some offscreen framebuffer first. 2. Either: * Render our own shadow first. Then render just the window area of the offscreen buffer to the screen (if rectangular it would leave artrifacts on windows with rounded edges). * Apply & composite a shader to the buffer with a mask, which still has the same issue with rounded corners, unless we specifically make the assumption that the rounded corners are always present in all windows.
Both methods assume a lot about how a window looks like but this cannot be fixed either in mutter, because of the chosen architecture by Gtk.
I thought Gala used it's own shadows anyway, hence the odd incompatabilites of the stylesheet with other WMs. (I haven't tried it with the new stylesheet though)
I thought Gala used it's own shadows anyway
No, shadows are client-side in the GTK stylesheet, and rendered by GTK.
Problem
Currently shadows overlay black. This only affects value but does not affect saturation as shadows in real life would:
Proposal
It would be pretty sweet if we could increase saturation under shadows so that they would be tinted with the color of what's beneath them and look more true to life: