After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 695998 - csd: enable shadows in the outer border
csd: enable shadows in the outer border
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-03-17 16:37 UTC by Matthias Clasen
Modified: 2013-04-09 19:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sketch of how to render outset shadows (2.07 KB, patch)
2013-03-28 17:30 UTC, Kristian Høgsberg
none Details | Review
CSD windows with drop shadow on wayland (133.54 KB, image/png)
2013-03-28 17:35 UTC, Kristian Høgsberg
  Details
Proposed outset shadows implementation (6.56 KB, patch)
2013-04-05 10:43 UTC, Chris Cummins
committed Details | Review
Adwaita/Weston drop shadows css (1.06 KB, patch)
2013-04-05 11:10 UTC, Chris Cummins
none Details | Review
Drop shadows for CSD windows in Awaita (1.08 KB, patch)
2013-04-05 13:12 UTC, Chris Cummins
none Details | Review

Description Matthias Clasen 2013-03-17 16:37:40 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.
Comment 1 Kristian Høgsberg 2013-03-28 17:30:52 UTC
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.
Comment 2 Kristian Høgsberg 2013-03-28 17:35:39 UTC
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.
Comment 3 Chris Cummins 2013-04-05 10:43:41 UTC
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
Comment 4 Chris Cummins 2013-04-05 11:10:11 UTC
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).
Comment 5 Rob Bradford 2013-04-05 12:50:54 UTC
Review of attachment 240711 [details] [review]:

LGTM. Would like to see feedback from a GTK+ maintainer too.
Comment 6 Chris Cummins 2013-04-05 13:12:32 UTC
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.
Comment 7 Cosimo Cecchi 2013-04-08 18:37:56 UTC
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()
Comment 8 Rob Bradford 2013-04-09 12:06:32 UTC
Review of attachment 240711 [details] [review]:

GTK+ patch committed. Cosimo can you go ahead and apply the Adwaita change
Comment 9 Cosimo Cecchi 2013-04-09 19:06:11 UTC
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.