Make shadow on/off change effectve immediately.
SVN revision: 28281
This commit is contained in:
parent
928e8aeaf6
commit
3648a92524
|
@ -1275,6 +1275,9 @@ ECompMgrWinFade(EObj * eo, unsigned int op_from, unsigned int op_to)
|
||||||
{
|
{
|
||||||
ECmWinInfo *cw = eo->cmhook;
|
ECmWinInfo *cw = eo->cmhook;
|
||||||
|
|
||||||
|
if (op_from == op_to && op_from == eo->opacity)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!cw->anim_fade)
|
if (!cw->anim_fade)
|
||||||
cw->anim_fade = AnimatorAdd(doECompMgrWinFade, eo);
|
cw->anim_fade = AnimatorAdd(doECompMgrWinFade, eo);
|
||||||
cw->opacity_to = op_to;
|
cw->opacity_to = op_to;
|
||||||
|
@ -1558,6 +1561,33 @@ ECompMgrWinDamageArea(EObj * eo, int x __UNUSED__, int y __UNUSED__,
|
||||||
ECompMgrDamageMergeObject(eo, cw->shape, 0);
|
ECompMgrDamageMergeObject(eo, cw->shape, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ECompMgrWinChangeShadow(EObj * eo, int shadow)
|
||||||
|
{
|
||||||
|
ECmWinInfo *cw = eo->cmhook;
|
||||||
|
|
||||||
|
if (!cw || !eo->shown)
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
if (!shadow && eo->shadow)
|
||||||
|
{
|
||||||
|
/* Disable shadow */
|
||||||
|
ECompMgrDamageMergeObject(eo, cw->extents, 1);
|
||||||
|
cw->extents = None;
|
||||||
|
ECompMgrWinInvalidate(eo, INV_SHADOW);
|
||||||
|
}
|
||||||
|
else if (shadow && !eo->shadow)
|
||||||
|
{
|
||||||
|
/* Enable shadow */
|
||||||
|
ECompMgrWinInvalidate(eo, INV_SHADOW);
|
||||||
|
eo->shadow = shadow;
|
||||||
|
cw->extents = win_extents(eo);
|
||||||
|
ECompMgrDamageMergeObject(eo, cw->extents, 0);
|
||||||
|
}
|
||||||
|
done:
|
||||||
|
eo->shadow = shadow;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ECompMgrWinConfigure(EObj * eo, XEvent * ev)
|
ECompMgrWinConfigure(EObj * eo, XEvent * ev)
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,6 +52,7 @@ void ECompMgrWinReparent(EObj * eo, Desk * dsk, int change_xy);
|
||||||
void ECompMgrWinRaiseLower(EObj * eo, int delta);
|
void ECompMgrWinRaiseLower(EObj * eo, int delta);
|
||||||
void ECompMgrWinChangeShape(EObj * eo);
|
void ECompMgrWinChangeShape(EObj * eo);
|
||||||
void ECompMgrWinChangeOpacity(EObj * eo, unsigned int opacity);
|
void ECompMgrWinChangeOpacity(EObj * eo, unsigned int opacity);
|
||||||
|
void ECompMgrWinChangeShadow(EObj * eo, int shadow);
|
||||||
Pixmap ECompMgrWinGetPixmap(const EObj * eo);
|
Pixmap ECompMgrWinGetPixmap(const EObj * eo);
|
||||||
|
|
||||||
void ECompMgrConfigGet(cfg_composite * cfg);
|
void ECompMgrConfigGet(cfg_composite * cfg);
|
||||||
|
|
|
@ -557,6 +557,14 @@ EobjChangeOpacity(EObj * eo, unsigned int opacity)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if USE_COMPOSITE
|
||||||
|
void
|
||||||
|
EobjChangeShadow(EObj * eo, int shadow)
|
||||||
|
{
|
||||||
|
ECompMgrWinChangeShadow(eo, shadow);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
EobjSlideTo(EObj * eo, int fx, int fy, int tx, int ty, int speed)
|
EobjSlideTo(EObj * eo, int fx, int fy, int tx, int ty, int speed)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,13 +44,13 @@ struct _eobj
|
||||||
char sticky;
|
char sticky;
|
||||||
char floating;
|
char floating;
|
||||||
unsigned external:1;
|
unsigned external:1;
|
||||||
|
unsigned argb:1;
|
||||||
unsigned inputonly:1;
|
unsigned inputonly:1;
|
||||||
unsigned shown:1;
|
unsigned shown:1;
|
||||||
unsigned gone:1;
|
unsigned gone:1;
|
||||||
unsigned noredir:1; /* Do not redirect */
|
unsigned noredir:1; /* Do not redirect */
|
||||||
unsigned shadow:1; /* Enable shadows */
|
unsigned shadow:1; /* Enable shadows */
|
||||||
unsigned fade:1;
|
unsigned fade:1; /* Enable fading */
|
||||||
unsigned argb:1;
|
|
||||||
#if USE_COMPOSITE
|
#if USE_COMPOSITE
|
||||||
unsigned int opacity;
|
unsigned int opacity;
|
||||||
ECmWinInfo *cmhook;
|
ECmWinInfo *cmhook;
|
||||||
|
@ -114,16 +114,16 @@ struct _eobj
|
||||||
#define EoChangeOpacity(eo, _o) EobjChangeOpacity(EoObj(eo), _o)
|
#define EoChangeOpacity(eo, _o) EobjChangeOpacity(EoObj(eo), _o)
|
||||||
#define EoSetFade(eo, _x) EoObj(eo)->fade = (_x)
|
#define EoSetFade(eo, _x) EoObj(eo)->fade = (_x)
|
||||||
#define EoSetNoRedirect(eo, _x) EoObj(eo)->noredir = (_x)
|
#define EoSetNoRedirect(eo, _x) EoObj(eo)->noredir = (_x)
|
||||||
|
#define EoSetOpacity(eo, _o) EoObj(eo)->opacity = (_o)
|
||||||
#define EoSetShadow(eo, _x) EoObj(eo)->shadow = (_x)
|
#define EoSetShadow(eo, _x) EoObj(eo)->shadow = (_x)
|
||||||
#if USE_COMPOSITE
|
#if USE_COMPOSITE
|
||||||
#define EoSetOpacity(eo, _o) EoObj(eo)->opacity = (_o)
|
|
||||||
#define EoGetOpacity(eo) (EoObj(eo)->opacity)
|
#define EoGetOpacity(eo) (EoObj(eo)->opacity)
|
||||||
#define EoGetFade(eo) (EoObj(eo)->fade)
|
#define EoGetFade(eo) (EoObj(eo)->fade)
|
||||||
|
#define EoChangeShadow(eo, _x) EobjChangeShadow(EoObj(eo), _x)
|
||||||
#define EoGetShadow(eo) (EoObj(eo)->shadow)
|
#define EoGetShadow(eo) (EoObj(eo)->shadow)
|
||||||
#define EoGetNoRedirect(eo) (EoObj(eo)->noredir)
|
#define EoGetNoRedirect(eo) (EoObj(eo)->noredir)
|
||||||
#define EoGetSerial(eo) (EoObj(eo)->serial)
|
#define EoGetSerial(eo) (EoObj(eo)->serial)
|
||||||
#else
|
#else
|
||||||
#define EoSetOpacity(eo, _o)
|
|
||||||
#define EoGetSerial(eo) 0
|
#define EoGetSerial(eo) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -166,6 +166,7 @@ void EobjShapeUpdate(EObj * eo, int propagate);
|
||||||
void EobjsRepaint(void);
|
void EobjsRepaint(void);
|
||||||
Pixmap EobjGetPixmap(const EObj * eo);
|
Pixmap EobjGetPixmap(const EObj * eo);
|
||||||
void EobjChangeOpacity(EObj * eo, unsigned int opacity);
|
void EobjChangeOpacity(EObj * eo, unsigned int opacity);
|
||||||
|
void EobjChangeShadow(EObj * eo, int shadow);
|
||||||
void EobjSetLayer(EObj * eo, int layer);
|
void EobjSetLayer(EObj * eo, int layer);
|
||||||
void EobjSetFloating(EObj * eo, int floating);
|
void EobjSetFloating(EObj * eo, int floating);
|
||||||
int EobjIsShaped(const EObj * eo);
|
int EobjIsShaped(const EObj * eo);
|
||||||
|
|
|
@ -923,7 +923,7 @@ IpcWinop(const WinOp * wop, EWin * ewin, const char *prm)
|
||||||
case EWIN_OP_SHADOW:
|
case EWIN_OP_SHADOW:
|
||||||
on = EoGetShadow(ewin);
|
on = EoGetShadow(ewin);
|
||||||
if (SetEwinBoolean(wop->name, &on, param1, 1))
|
if (SetEwinBoolean(wop->name, &on, param1, 1))
|
||||||
EoSetShadow(ewin, on);
|
EoChangeShadow(ewin, on);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EWIN_OP_NO_REDIRECT:
|
case EWIN_OP_NO_REDIRECT:
|
||||||
|
|
Loading…
Reference in New Issue