kwo pushed a commit to branch master.

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

commit dc5db9e4a14476c3f6459da2b671ba616bed90c1
Author: Kim Woelders <[email protected]>
Date:   Fri Apr 29 19:34:46 2022 +0200

    CM: Adjust shadowing conditions some more
    
    Re-enable sharp shadows on shaped windows.
    Should be ok now that sharp shadowing shaped windows has been fixed.
---
 src/ecompmgr.c |  4 ++--
 src/eobj.c     | 18 +++++++++++-------
 src/eobj.h     |  3 ++-
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/ecompmgr.c b/src/ecompmgr.c
index 38525925..09094e09 100644
--- a/src/ecompmgr.c
+++ b/src/ecompmgr.c
@@ -754,7 +754,7 @@ ECompMgrWinSetExtents(EObj * eo)
 
      case ECM_SHADOWS_SHARP:
      case ECM_SHADOWS_ECHO:
-       if (!EobjShadowOk(eo))
+       if (!EobjShadowOk(eo, true))
           goto skip_shadow;
 
        cw->shadow_dx = Conf_compmgr.shadows.offset_x;
@@ -764,7 +764,7 @@ ECompMgrWinSetExtents(EObj * eo)
        break;
 
      case ECM_SHADOWS_BLURRED:
-       if (!EobjShadowOk(eo))
+       if (!EobjShadowOk(eo, false))
           goto skip_shadow;
 
        if (!gaussianMap)
diff --git a/src/eobj.c b/src/eobj.c
index 4b3d8a5f..eed59f17 100644
--- a/src/eobj.c
+++ b/src/eobj.c
@@ -163,26 +163,30 @@ EobjSetFloating(EObj * eo, int floating)
    EobjSetLayer(eo, eo->layer);
 }
 
-int
-EobjShadowOk(const EObj * eo)
+bool
+EobjShadowOk(const EObj * eo, bool sharp)
 {
    if (!eo->shadow)
-      return 0;                        /* Shadow disabled by configuration */
+      return false;            /* Disabled by configuration */
 
    switch (eo->type)
      {
      default:
+       if (sharp)
+          return true;         /* Enabled if sharp */
        if (eo->shaped)
-          return 0;            /* Shadow disabled if shaped */
+          return false;        /* Disabled if shaped */
        break;
      case EOBJ_TYPE_EWIN:
        if (((EWin *) eo)->state.fullscreen)
-          return 0;            /* Shadow disabled if fullscreen */
+          return false;        /* Disabled if fullscreen */
+       if (sharp)
+          return true;         /* Enabled if sharp */
        if (((EWin *) eo)->state.shaped)
-          return 0;            /* Shadow disabled if client is shaped */
+          return false;        /* Disabled if client is shaped */
      }
 
-   return 1;
+   return true;
 }
 
 #if USE_GLX
diff --git a/src/eobj.h b/src/eobj.h
index 8d8a04b4..c3ec75a3 100644
--- a/src/eobj.h
+++ b/src/eobj.h
@@ -23,6 +23,7 @@
 #ifndef _EOBJ_H_
 #define _EOBJ_H_
 
+#include <stdbool.h>
 #include "etypes.h"
 #include "xwin.h"
 
@@ -186,7 +187,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                 EobjShadowOk(const EObj * eo);
+bool                EobjShadowOk(const EObj * eo, bool sharp);
 
 void                EobjsOpacityUpdate(int op_or);
 

-- 


Reply via email to