GNOME Bugzilla – Bug 695998
csd: enable shadows in the outer border
Last modified: 2013-04-09 19:06:11 UTC
Benjamin said the css shadow code can be reused for this. It would be nice if we can use css for specifying the shadow.
Created attachment 240075 [details] [review] sketch of how to render outset shadows This is obviously a very crude hack, but it shows what to change to get outset shadows. We still need to distinguish between inset and outset and do the right thing depending on which shadow it is in or out. For window drop shadows, this depends on the invisible border to be big enough to hold the shadows. Increasing the invisible border means that the resize region now is much too big, so we need to set the input region.
Created attachment 240076 [details] CSD windows with drop shadow on wayland This relies on a small patch to Adwaita to add box-shadow: 10px 10px 10px 2px alpha(black, 0.6); to .window-border, add .window-border:backdrop { box-shadow: 7px 7px 7px 1px alpha(black, 0.6); } and increse .window-outer-border border-radius to 22px to be big enough to hold the drop shadow.
Created attachment 240711 [details] [review] Proposed outset shadows implementation This adds outset shadow rendering based on Kristian's previous sketch, and allows drop shadows in Wayland providing you make the aforementioned changes to Adwaita (note I had to change .window-outer-border border-width as well as border-radius to 22px to prevent the shadow being clipped). --Chris
Created attachment 240717 [details] [review] Adwaita/Weston drop shadows css This is the modification to gnome-themes-standard required to demo drop shadows in Wayland/Weston, a la Kristian's screenshot (id=240076).
Review of attachment 240711 [details] [review]: LGTM. Would like to see feedback from a GTK+ maintainer too.
Created attachment 240741 [details] [review] Drop shadows for CSD windows in Awaita This makes the necessary changes to gnome-themes-standard to display drop shadows behind Gtk windows with Wayland backend.
Review of attachment 240711 [details] [review]: This looks good to me as well; only a little stylistic comment below. ::: gtk/gtkcssshadowvalueprivate.h @@ +35,3 @@ GtkCssValue * _gtk_css_shadow_value_parse (GtkCssParser *parser); +gboolean _gtk_css_shadow_value_is_inset (const GtkCssValue *shadow); I'd call this _gtk_css_shadow_value_get_inset()
Review of attachment 240711 [details] [review]: GTK+ patch committed. Cosimo can you go ahead and apply the Adwaita change
Yes, I pushed an implementation of this to Adwaita master (slightly different from the patch attached here). Some more fixes will be needed in GtkWindow to make the size of the outer window border (where we draw the outset shadow) independent from the size of the resize invisible border, but I think this can be closed for now.