kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=a41b22090412616fed647350126c69bd1e012f01

commit a41b22090412616fed647350126c69bd1e012f01
Author: Kim Woelders <[email protected]>
Date:   Wed Mar 30 22:11:58 2022 +0200

    CM: Adjust shadowing conditions
    
    Treat all (non-off) shadow modes alike
    Disable if shaped (OR too)
    Disable if fullscreen (regular clients)
---
 src/ecompmgr.c | 11 ++++++-----
 src/eobj.c     | 16 +++++++++++-----
 src/eobj.h     |  4 ++--
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/src/ecompmgr.c b/src/ecompmgr.c
index 7fd6d13d..f4efff5c 100644
--- a/src/ecompmgr.c
+++ b/src/ecompmgr.c
@@ -745,10 +745,7 @@ ECompMgrWinSetExtents(EObj * eo)
       cw->extents = ERegionCreate();
 
 #if ENABLE_SHADOWS
-   cw->has_shadow = (Mode_compmgr.shadow_mode != ECM_SHADOWS_OFF) &&
-      eo->shadow && (EShapeCheck(EobjGetWin(eo)) >= 0);
-   if (!cw->has_shadow)
-      goto skip_shadow;
+   cw->has_shadow = 0;
 
    switch (Mode_compmgr.shadow_mode)
      {
@@ -757,6 +754,9 @@ ECompMgrWinSetExtents(EObj * eo)
 
      case ECM_SHADOWS_SHARP:
      case ECM_SHADOWS_ECHO:
+       if (!EobjShadowOk(eo))
+          goto skip_shadow;
+
        cw->shadow_dx = Conf_compmgr.shadows.offset_x;
        cw->shadow_dy = Conf_compmgr.shadows.offset_y;
        cw->shadow_width = cw->rcw;
@@ -764,7 +764,7 @@ ECompMgrWinSetExtents(EObj * eo)
        break;
 
      case ECM_SHADOWS_BLURRED:
-       if (EobjIsShaped(eo) /* || cw->mode == WINDOW_ARGB */ )
+       if (!EobjShadowOk(eo))
           goto skip_shadow;
 
        if (!gaussianMap)
@@ -802,6 +802,7 @@ ECompMgrWinSetExtents(EObj * eo)
    if (sr.y + sr.height > r.y + r.height)
       r.height = sr.y + sr.height - r.y;
 
+   cw->has_shadow = 1;
    ERegionSetRect(cw->extents, r.x, r.y, r.width, r.height);
    goto done;
 
diff --git a/src/eobj.c b/src/eobj.c
index ff8b322d..dd17d31e 100644
--- a/src/eobj.c
+++ b/src/eobj.c
@@ -163,19 +163,25 @@ EobjSetFloating(EObj * eo, int floating)
    EobjSetLayer(eo, eo->layer);
 }
 
-#if 1                          /* FIXME - Remove */
 int
-EobjIsShaped(const EObj * eo)
+EobjShadowOk(const EObj * eo)
 {
+   if (!eo->shadow)
+      return 0;                        /* Shadow disabled by configuration */
+   if (eo->shaped)
+      return 0;                        /* Shadow disabled if shaped */
+
    switch (eo->type)
      {
      default:
-       return 0;               /* FIXME */
+       break;
      case EOBJ_TYPE_EWIN:
-       return ((EWin *) eo)->state.shaped;
+       if (((EWin *) eo)->state.fullscreen)
+          return 0;            /* Shadow disabled if fullscreen */
      }
+
+   return 1;
 }
-#endif
 
 #if USE_GLX
 #define WINTYPE(t) ((t == EOBJ_TYPE_GLX) ? WIN_TYPE_GLX : WIN_TYPE_INTERNAL)
diff --git a/src/eobj.h b/src/eobj.h
index 59041fc6..62f6038c 100644
--- a/src/eobj.h
+++ b/src/eobj.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2021 Kim Woelders
+ * Copyright (C) 2004-2022 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -186,7 +186,7 @@ void                EobjChangeOpacity(EObj * eo, unsigned 
int opacity);
 void                EobjChangeShadow(EObj * eo, int shadow);
 void                EobjSetLayer(EObj * eo, int layer);
 void                EobjSetFloating(EObj * eo, int floating);
-int                 EobjIsShaped(const EObj * eo);
+int                 EobjShadowOk(const EObj * eo);
 
 void                EobjsOpacityUpdate(int op_or);
 

-- 


Reply via email to