[mutter] Omit shadows for fullscreen and maximized windows



commit 8b24711bba86305ba579fee0cc476bd3ea4e5dfb
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Nov 11 18:43:35 2010 -0500

    Omit shadows for fullscreen and maximized windows
    
    Fullscreen and maximized windows never have visible shadows - the only
    case where we would ever see them is if they bleed onto an adjacent
    monitor and that looks bad.
    
    It's small performance win to avoid computing them, and this also avoids
    painting the top shadow for all maximized windows in GNOME Shell - since
    the top panel isn't a X window, it doesn't factor into the computation
    of what parts of windows are visible and maximized windows are computed
    as having a top shadow.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=592382

 src/compositor/meta-window-actor.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 53bbc99..f08f043 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -762,6 +762,13 @@ meta_window_actor_has_shadow (MetaWindowActor *self)
   if (priv->no_shadow)
     return FALSE;
 
+  /* Leaving out shadows for maximized and fullscreen windows is an effeciency
+   * win and also prevents the unsightly effect of the shadow of maximized
+   * window appearing on an adjacent window */
+  if ((meta_window_get_maximized (priv->window) == (META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL)) ||
+      meta_window_is_fullscreen (priv->window))
+    return FALSE;
+
   /*
    * Always put a shadow around windows with a frame - This should override
    * the restriction about not putting a shadow around ARGB windows.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]