Better Shadows

I looked into the order in which we are drawing windows and the effect that it is having on shadows today, and after a while it can start to look pretty horrible as the shadows stack up.

Old Shadows

In this situation, the menus are actually stacked on top of the panel (as transients), the panel is also stacked on top of the file browser window. This makes sense from a programmatic point of view (eg, the order of visibility), but it has a horrible effect on the shadows. Namely, a shadow is drawn around all sides of each menu and it casts on to the parent menu on the tree. With slight shadows this is not noticable, but with large shadows it looks ugly.

In addition, a panel shadow is great for when the panel is over the desktop, but it obstructs the window title for maximized windows. Thus it is not desirable in this case.

New Shadows

I am finishing a patch which will allow us to clip these shadows in cases where they are not appropriate. The result is this:

This will probably make it into the next release.

13 thoughts on “Better Shadows

  1. This is truly awesome. Really happy to see innovations like this get into Compiz. It hasn’t changed much for a while visually.

    Some day I’ll get back involved and maybe write a plugin or two.

  2. Good work. Glad to see this getting attention. Something else I’ve wanted to see for a while is a difference in shadowing of inactive and active windows, and panels and menus having smaller shadows than those on the windows. OS X does great with this. You get the feeling that the shadows on OS X serve to guide the users attention to where it should be.

  3. Nice.

    I think the in-focus window should generally have bigger shadows than the out-of-focus windows. Does Mac OS X not do this?

    1. It does. There isn’t really any way to define this in the normal decorators (maybe it is worth looking into though), but unity-window-decorator does it.

        1. The shadow clipping is in the decor plugin. There is no differentiation of active and inactive shadows in the decor plugin, but I might consider adding it to the shadow specification if I get time to.

  4. I love what this does to menus 🙂 I admit, i still hack it so the panel casts a shadow on regular windows though. It looks weird to me otherwise.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s