forked from e16/e16
1
0
Fork 0

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.
This commit is contained in:
Kim Woelders 2022-04-29 19:34:46 +02:00
parent 5b071a0e26
commit dc5db9e4a1
3 changed files with 15 additions and 10 deletions

View File

@ -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)

View File

@ -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

View File

@ -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);