Add EwinIsOnDesktop().

SVN revision: 61447
This commit is contained in:
Kim Woelders 2011-07-17 18:43:23 +00:00
parent e3e17f2ff9
commit 9d2932a2a4
2 changed files with 28 additions and 0 deletions

View File

@ -1669,6 +1669,33 @@ EwinIsOnScreen(const EWin * ewin)
return 1;
}
int
EwinIsOnDesktop(const EWin * ewin)
{
int xd, yd, wd, hd;
wd = WinGetW(VROOT);
hd = WinGetH(VROOT);
if (EoIsSticky(ewin))
{
xd = yd = 0;
}
else
{
int ax, ay;
DeskGetArea(EoGetDesk(ewin), &ax, &ay);
xd = -ax * wd;
yd = -ay * hd;
wd *= Conf.desks.areas_nx;
hd *= Conf.desks.areas_ny;
}
return
EoGetX(ewin) + EoGetW(ewin) - 8 >= xd && EoGetX(ewin) + 8 <= xd + wd &&
EoGetY(ewin) + EoGetH(ewin) - 8 >= yd && EoGetY(ewin) + 8 <= yd + hd;
}
/*
* Save current position in absolute viewport coordinates
*/

View File

@ -368,6 +368,7 @@ void EwinBorderGetSize(const EWin * ewin, int *bl, int *br,
int *bt, int *bb);
void EwinBorderUpdateState(EWin * ewin);
int EwinIsOnScreen(const EWin * ewin);
int EwinIsOnDesktop(const EWin * ewin);
void EwinRememberPositionSet(EWin * ewin);
void EwinRememberPositionGet(EWin * ewin, Desk * dsk,
int *px, int *py);