Fix ripples/waves on xorg 1.4 when composite is active.
SVN revision: 34720
This commit is contained in:
parent
ef72f8eea1
commit
a8c44980f3
|
@ -473,12 +473,10 @@ DeskDestroy(Desk * dsk)
|
||||||
Efree(dsk);
|
Efree(dsk);
|
||||||
}
|
}
|
||||||
|
|
||||||
Win
|
EObj *
|
||||||
DeskGetBackgroundWin(const Desk * dsk)
|
DeskGetBackgroundObj(const Desk * dsk)
|
||||||
{
|
{
|
||||||
if (!dsk)
|
return (dsk) ? dsk->bg.o : NULL;
|
||||||
return VROOT;
|
|
||||||
return EobjGetWin(dsk->bg.o);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Pixmap
|
Pixmap
|
||||||
|
|
|
@ -69,7 +69,7 @@ void DeskSetDirtyStack(Desk * dsk, EObj * eo);
|
||||||
void DeskGoto(Desk * dsk);
|
void DeskGoto(Desk * dsk);
|
||||||
void DeskGotoNum(unsigned int desk);
|
void DeskGotoNum(unsigned int desk);
|
||||||
void DeskRestack(Desk * dsk);
|
void DeskRestack(Desk * dsk);
|
||||||
Win DeskGetBackgroundWin(const Desk * dsk);
|
EObj *DeskGetBackgroundObj(const Desk * dsk);
|
||||||
Pixmap DeskGetBackgroundPixmap(const Desk * dsk);
|
Pixmap DeskGetBackgroundPixmap(const Desk * dsk);
|
||||||
|
|
||||||
Background *DeskBackgroundGet(const Desk * dsk);
|
Background *DeskBackgroundGet(const Desk * dsk);
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/extensions/Xcomposite.h>
|
#include <X11/extensions/Xcomposite.h>
|
||||||
#include <X11/extensions/Xdamage.h>
|
#include <X11/extensions/Xdamage.h>
|
||||||
|
#include <X11/extensions/Xfixes.h>
|
||||||
#include <X11/extensions/Xrender.h>
|
#include <X11/extensions/Xrender.h>
|
||||||
|
|
||||||
#define ENABLE_SHADOWS 1
|
#define ENABLE_SHADOWS 1
|
||||||
|
@ -463,6 +464,19 @@ ERegionShow(const char *txt, XserverRegion rgn)
|
||||||
XFree(pr);
|
XFree(pr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ECompMgrWinClipToGC(EObj * eo, GC gc)
|
||||||
|
{
|
||||||
|
XserverRegion rgn = rgn_tmp2;
|
||||||
|
|
||||||
|
if (!eo || !eo->cmhook)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ERegionCopy(rgn, Mode_compmgr.rgn_screen);
|
||||||
|
ERegionSubtract(rgn, eo->cmhook->clip);
|
||||||
|
XFixesSetGCClipRegion(disp, gc, 0, 0, rgn);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pictures
|
* Pictures
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -58,6 +58,7 @@ void ECompMgrWinChangeShape(EObj * eo);
|
||||||
void ECompMgrWinChangeOpacity(EObj * eo, unsigned int opacity);
|
void ECompMgrWinChangeOpacity(EObj * eo, unsigned int opacity);
|
||||||
void ECompMgrWinChangeShadow(EObj * eo, int shadow);
|
void ECompMgrWinChangeShadow(EObj * eo, int shadow);
|
||||||
Pixmap ECompMgrWinGetPixmap(const EObj * eo);
|
Pixmap ECompMgrWinGetPixmap(const EObj * eo);
|
||||||
|
void ECompMgrWinClipToGC(EObj * eo, GC gc);
|
||||||
|
|
||||||
void ECompMgrConfigGet(cfg_composite * cfg);
|
void ECompMgrConfigGet(cfg_composite * cfg);
|
||||||
void ECompMgrConfigSet(const cfg_composite * cfg);
|
void ECompMgrConfigSet(const cfg_composite * cfg);
|
||||||
|
|
52
src/fx.c
52
src/fx.c
|
@ -23,6 +23,7 @@
|
||||||
#include "E.h"
|
#include "E.h"
|
||||||
#include "desktops.h"
|
#include "desktops.h"
|
||||||
#include "dialog.h"
|
#include "dialog.h"
|
||||||
|
#include "ecompmgr.h"
|
||||||
#include "eimage.h"
|
#include "eimage.h"
|
||||||
#include "emodule.h"
|
#include "emodule.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
@ -53,6 +54,13 @@ typedef struct {
|
||||||
char paused;
|
char paused;
|
||||||
} FXHandler;
|
} FXHandler;
|
||||||
|
|
||||||
|
#if USE_COMPOSITE
|
||||||
|
/* As of composite 0.4 we need to set the clip region */
|
||||||
|
#define SET_GC_CLIP(eo, gc) ECompMgrWinClipToGC(eo, gc)
|
||||||
|
#else
|
||||||
|
#define SET_GC_CLIP(eo, gc)
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************** RIPPLES *************************************/
|
/****************************** RIPPLES *************************************/
|
||||||
|
|
||||||
#define fx_ripple_waterh 64
|
#define fx_ripple_waterh 64
|
||||||
|
@ -67,12 +75,15 @@ FX_ripple_timeout(void *data __UNUSED__)
|
||||||
static double incv = 0, inch = 0;
|
static double incv = 0, inch = 0;
|
||||||
static GC gc1 = 0, gc = 0;
|
static GC gc1 = 0, gc = 0;
|
||||||
int y;
|
int y;
|
||||||
|
EObj *bgeo;
|
||||||
|
|
||||||
|
bgeo = DeskGetBackgroundObj(DesksGetCurrent());
|
||||||
|
|
||||||
if (fx_ripple_above == None)
|
if (fx_ripple_above == None)
|
||||||
{
|
{
|
||||||
XGCValues gcv;
|
XGCValues gcv;
|
||||||
|
|
||||||
fx_ripple_win = DeskGetBackgroundWin(DesksGetCurrent());
|
fx_ripple_win = EobjGetWin(bgeo);
|
||||||
|
|
||||||
fx_ripple_above =
|
fx_ripple_above =
|
||||||
ECreatePixmap(fx_ripple_win, WinGetW(VROOT),
|
ECreatePixmap(fx_ripple_win, WinGetW(VROOT),
|
||||||
|
@ -87,23 +98,23 @@ FX_ripple_timeout(void *data __UNUSED__)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fx_ripple_count == 0)
|
if (fx_ripple_count == 0)
|
||||||
XCopyArea(disp, EoGetXwin(DesksGetCurrent()), fx_ripple_above, gc, 0,
|
XCopyArea(disp, WinGetXwin(fx_ripple_win), fx_ripple_above, gc, 0,
|
||||||
WinGetH(VROOT) - (fx_ripple_waterh * 3), WinGetW(VROOT),
|
WinGetH(VROOT) - (fx_ripple_waterh * 3), WinGetW(VROOT),
|
||||||
fx_ripple_waterh * 2, 0, 0);
|
fx_ripple_waterh * 2, 0, 0);
|
||||||
|
|
||||||
fx_ripple_count++;
|
fx_ripple_count++;
|
||||||
if (fx_ripple_count > 32)
|
if (fx_ripple_count > 32)
|
||||||
fx_ripple_count = 0;
|
fx_ripple_count = 0;
|
||||||
|
|
||||||
incv += 0.40;
|
incv += 0.40;
|
||||||
if (incv > (M_PI_2 * 4))
|
if (incv > (M_PI_2 * 4))
|
||||||
{
|
incv = 0;
|
||||||
incv = 0;
|
|
||||||
}
|
|
||||||
inch += 0.32;
|
inch += 0.32;
|
||||||
if (inch > (M_PI_2 * 4))
|
if (inch > (M_PI_2 * 4))
|
||||||
{
|
inch = 0;
|
||||||
inch = 0;
|
|
||||||
}
|
SET_GC_CLIP(bgeo, gc1);
|
||||||
|
|
||||||
for (y = 0; y < fx_ripple_waterh; y++)
|
for (y = 0; y < fx_ripple_waterh; y++)
|
||||||
{
|
{
|
||||||
double aa, a, p;
|
double aa, a, p;
|
||||||
|
@ -196,6 +207,9 @@ FX_raindrops_timeout(void *data __UNUSED__)
|
||||||
static char first = 1;
|
static char first = 1;
|
||||||
static char sintab[256];
|
static char sintab[256];
|
||||||
static unsigned char disttab[fx_raindrop_size][fx_raindrop_size];
|
static unsigned char disttab[fx_raindrop_size][fx_raindrop_size];
|
||||||
|
EObj *bgeo;
|
||||||
|
|
||||||
|
bgeo = DeskGetBackgroundObj(DesksGetCurrent());
|
||||||
|
|
||||||
if (fx_raindrops_win == None)
|
if (fx_raindrops_win == None)
|
||||||
{
|
{
|
||||||
|
@ -221,7 +235,7 @@ FX_raindrops_timeout(void *data __UNUSED__)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fx_raindrops_win = DeskGetBackgroundWin(DesksGetCurrent());
|
fx_raindrops_win = EobjGetWin(bgeo);
|
||||||
|
|
||||||
if (gc)
|
if (gc)
|
||||||
EXFreeGC(gc);
|
EXFreeGC(gc);
|
||||||
|
@ -252,6 +266,8 @@ FX_raindrops_timeout(void *data __UNUSED__)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SET_GC_CLIP(bgeo, gc1);
|
||||||
|
|
||||||
for (i = 0; i < fx_raindrops_number; i++)
|
for (i = 0; i < fx_raindrops_number; i++)
|
||||||
{
|
{
|
||||||
fx_raindrops[i].count++;
|
fx_raindrops[i].count++;
|
||||||
|
@ -469,13 +485,16 @@ FX_Wave_timeout(void *data __UNUSED__)
|
||||||
double incx2;
|
double incx2;
|
||||||
static GC gc1 = 0, gc = 0;
|
static GC gc1 = 0, gc = 0;
|
||||||
int y;
|
int y;
|
||||||
|
EObj *bgeo;
|
||||||
|
|
||||||
|
bgeo = DeskGetBackgroundObj(DesksGetCurrent());
|
||||||
|
|
||||||
/* Check to see if we need to create stuff */
|
/* Check to see if we need to create stuff */
|
||||||
if (!fx_wave_above)
|
if (!fx_wave_above)
|
||||||
{
|
{
|
||||||
XGCValues gcv;
|
XGCValues gcv;
|
||||||
|
|
||||||
fx_wave_win = DeskGetBackgroundWin(DesksGetCurrent());
|
fx_wave_win = EobjGetWin(bgeo);
|
||||||
|
|
||||||
fx_wave_above =
|
fx_wave_above =
|
||||||
ECreatePixmap(fx_wave_win, WinGetW(VROOT), FX_WAVE_WATERH * 2, 0);
|
ECreatePixmap(fx_wave_win, WinGetW(VROOT), FX_WAVE_WATERH * 2, 0);
|
||||||
|
@ -491,7 +510,7 @@ FX_Wave_timeout(void *data __UNUSED__)
|
||||||
/* On the zero, grab the desktop again. */
|
/* On the zero, grab the desktop again. */
|
||||||
if (fx_wave_count == 0)
|
if (fx_wave_count == 0)
|
||||||
{
|
{
|
||||||
XCopyArea(disp, EoGetXwin(DesksGetCurrent()), fx_wave_above, gc, 0,
|
XCopyArea(disp, WinGetXwin(fx_wave_win), fx_wave_above, gc, 0,
|
||||||
WinGetH(VROOT) - (FX_WAVE_WATERH * 3), WinGetW(VROOT),
|
WinGetH(VROOT) - (FX_WAVE_WATERH * 3), WinGetW(VROOT),
|
||||||
FX_WAVE_WATERH * 2, 0, 0);
|
FX_WAVE_WATERH * 2, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -514,6 +533,8 @@ FX_Wave_timeout(void *data __UNUSED__)
|
||||||
if (incx > (M_PI_2 * 4))
|
if (incx > (M_PI_2 * 4))
|
||||||
incx = 0;
|
incx = 0;
|
||||||
|
|
||||||
|
SET_GC_CLIP(bgeo, gc1);
|
||||||
|
|
||||||
/* Copy the area to correct bugs */
|
/* Copy the area to correct bugs */
|
||||||
if (fx_wave_count == 0)
|
if (fx_wave_count == 0)
|
||||||
{
|
{
|
||||||
|
@ -620,10 +641,12 @@ static int
|
||||||
FX_imagespinner_timeout(void *data __UNUSED__)
|
FX_imagespinner_timeout(void *data __UNUSED__)
|
||||||
{
|
{
|
||||||
char *string = NULL;
|
char *string = NULL;
|
||||||
|
EObj *bgeo;
|
||||||
|
|
||||||
if (fx_imagespinner_win == None)
|
if (fx_imagespinner_win == None)
|
||||||
{
|
{
|
||||||
fx_imagespinner_win = DeskGetBackgroundWin(DesksGetCurrent());
|
bgeo = DeskGetBackgroundObj(DesksGetCurrent());
|
||||||
|
fx_imagespinner_win = EobjGetWin(bgeo);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* Don't use getword */
|
#if 0 /* Don't use getword */
|
||||||
|
@ -671,7 +694,10 @@ FX_ImageSpinner_Init(const char *name)
|
||||||
static void
|
static void
|
||||||
FX_ImageSpinner_Desk(void)
|
FX_ImageSpinner_Desk(void)
|
||||||
{
|
{
|
||||||
fx_imagespinner_win = DeskGetBackgroundWin(DesksGetCurrent());
|
EObj *bgeo;
|
||||||
|
|
||||||
|
bgeo = DeskGetBackgroundObj(DesksGetCurrent());
|
||||||
|
fx_imagespinner_win = EobjGetWin(bgeo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue