Avoid area switch when activating window that is mostly offscreen (noted by Mike Frysinger).

SVN revision: 30119
This commit is contained in:
Kim Woelders 2007-05-27 21:23:55 +00:00
parent 591ca46201
commit e5cae2c734
1 changed files with 12 additions and 3 deletions

View File

@ -278,9 +278,18 @@ EwinDetermineArea(EWin * ewin)
ewin->vx = dsk->current_area_x * EoGetW(dsk) + EoGetX(ewin);
ewin->vy = dsk->current_area_y * EoGetH(dsk) + EoGetY(ewin);
ax = (ewin->vx + EoGetW(ewin) / 2) / EoGetW(dsk);
ay = (ewin->vy + EoGetH(ewin) / 2) / EoGetH(dsk);
DesksFixArea(&ax, &ay);
if (EwinIsOnScreen(ewin))
{
ax = dsk->current_area_x;
ay = dsk->current_area_y;
}
else
{
ax = (ewin->vx + EoGetW(ewin) / 2) / EoGetW(dsk);
ay = (ewin->vy + EoGetH(ewin) / 2) / EoGetH(dsk);
DesksFixArea(&ax, &ay);
}
if (ax != ewin->area_x || ay != ewin->area_y)
{
ewin->area_x = ax;