Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 367139 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/compositor/meta-window-actor.c (-19 / +24 lines)
Lines 706-711 meta_window_actor_get_shadow_bounds (MetaWindowActor *self, Link Here
706
}
706
}
707
#endif
707
#endif
708
708
709
/* If we have an ARGB32 window that we decorate with a frame, it's
710
 * probably something like a translucent terminal - something where
711
 * the alpha channel represents transparency rather than a shape.  We
712
 * don't want to show the shadow through the translucent areas since
713
 * the shadow is wrong for translucent windows (it should be
714
 * translucent itself and colored), and not only that, will /look/
715
 * horribly wrong - a misplaced big black blob. As a hack, what we
716
 * want to do is just draw the shadow as normal outside the frame, and
717
 * inside the frame draw no shadow.  This is also not even close to
718
 * the right result, but looks OK. We also apply this approach to
719
 * windows set to be partially translucent with _NET_WM_WINDOW_OPACITY.
720
 */
721
static gboolean
722
clip_shadow_under_window (MetaWindowActor *self)
723
{
724
  MetaWindowActorPrivate *priv = self->priv;
725
726
  return (priv->argb32 || priv->opacity != 0xff) && priv->window->frame;
727
}
728
709
static void
729
static void
710
meta_window_actor_paint (ClutterActor *actor)
730
meta_window_actor_paint (ClutterActor *actor)
711
{
731
{
Lines 723-745 meta_window_actor_paint (ClutterActor *actor) Link Here
723
      meta_window_actor_get_shape_bounds (self, &shape_bounds);
743
      meta_window_actor_get_shape_bounds (self, &shape_bounds);
724
      meta_window_actor_get_shadow_params (self, appears_focused, &params);
744
      meta_window_actor_get_shadow_params (self, appears_focused, &params);
725
745
726
      /* If we have an ARGB32 window that we decorate with a
746
      /* The frame bounds are already subtracted from priv->shadow_clip
727
       * frame, it's probably something like a translucent
728
       * terminal - something where the alpha channel represents
729
       * transparency rather than a shape.  We don't want to show
730
       * the shadow through the translucent areas since the shadow
731
       * is wrong for translucent windows (it should be
732
       * translucent itself and colored), and not only that will
733
       * look horribly wrong - a misplaced big black blob. As a
734
       * hack, what we want to do is just draw the shadow as
735
       * normal outside the frame, and inside the frame draw no
736
       * shadow.  This is also not even close to the right result,
737
       * but looks OK.
738
       *
739
       * The frame bounds are already subtracted from priv->shadow_clip
740
       * if that exists.
747
       * if that exists.
741
       */
748
       */
742
      if (!clip && priv->argb32 && priv->window->frame)
749
      if (!clip && clip_shadow_under_window (self))
743
        {
750
        {
744
          cairo_region_t *frame_bounds = meta_window_get_frame_bounds (priv->window);
751
          cairo_region_t *frame_bounds = meta_window_get_frame_bounds (priv->window);
745
          cairo_rectangle_int_t bounds;
752
          cairo_rectangle_int_t bounds;
Lines 757-763 meta_window_actor_paint (ClutterActor *actor) Link Here
757
                         shape_bounds.height,
764
                         shape_bounds.height,
758
                         (clutter_actor_get_paint_opacity (actor) * params.opacity * priv->opacity) / (255 * 255),
765
                         (clutter_actor_get_paint_opacity (actor) * params.opacity * priv->opacity) / (255 * 255),
759
                         clip,
766
                         clip,
760
                         priv->argb32 && priv->window->frame);
767
                         clip_shadow_under_window (self)); /* clip_strictly - not just as an optimization */
761
768
762
      if (clip && clip != priv->shadow_clip)
769
      if (clip && clip != priv->shadow_clip)
763
        cairo_region_destroy (clip);
770
        cairo_region_destroy (clip);
Lines 1824-1831 meta_window_actor_set_visible_region_beneath (MetaWindowActor *self, Link Here
1824
      meta_window_actor_clear_shadow_clip (self);
1831
      meta_window_actor_clear_shadow_clip (self);
1825
      priv->shadow_clip = cairo_region_copy (beneath_region);
1832
      priv->shadow_clip = cairo_region_copy (beneath_region);
1826
1833
1827
      /* See comment in meta_window_actor_paint() */
1834
      if (clip_shadow_under_window (self))
1828
      if (priv->argb32 && priv->window->frame)
1829
        {
1835
        {
1830
          cairo_region_t *frame_bounds = meta_window_get_frame_bounds (priv->window);
1836
          cairo_region_t *frame_bounds = meta_window_get_frame_bounds (priv->window);
1831
          cairo_region_subtract (priv->shadow_clip, frame_bounds);
1837
          cairo_region_subtract (priv->shadow_clip, frame_bounds);
1832
- 

Return to bug 367139