Move duplicated stuff to function. Cleanups.

SVN revision: 57923
This commit is contained in:
Kim Woelders 2011-03-20 21:53:59 +00:00
parent 318288c1c6
commit aef884b09a
2 changed files with 17 additions and 20 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2010 Kim Woelders
* Copyright (C) 2004-2011 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -363,6 +363,7 @@ _DialogEwinInit(EWin * ewin)
d->set_title = 0;
ewin->props.focus_when_mapped = 1;
ewin->props.ignorearrange = 1;
EoSetLayer(ewin, 10);
}

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2003-2008 Kim Woelders
* Copyright (C) 2003-2011 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -38,6 +38,16 @@
#define MAX_CONSERVATIVE 2 /* Expand until something */
#define MAX_XINERAMA 3 /* Fill Xinerama screen */
static int
_ignore(const EWin * ewin, int type)
{
if (ewin->state.iconified || EoIsFloating(ewin) ||
ewin->props.ignorearrange ||
(type == MAX_AVAILABLE && !ewin->props.never_use_area))
return 1;
return 0;
}
void
MaxSizeHV(EWin * ewin, const char *resize_type, int hor, int ver)
{
@ -181,7 +191,7 @@ MaxSizeHV(EWin * ewin, const char *resize_type, int hor, int ver)
}
else
{
lst = EwinListGetAll(&num);
lst = EwinListGetForDesk(&num, EoGetDesk(ewin));
}
if (ver && hor && !old_ver && !old_hor)
@ -210,11 +220,7 @@ MaxSizeHV(EWin * ewin, const char *resize_type, int hor, int ver)
i, EoGetName(pe), left, right, top, bottom,
x1, x2, y1, y2);
if (pe == ewin || pe->state.iconified || EoIsFloating(pe) ||
pe->props.ignorearrange ||
(EoGetDesk(ewin) != EoGetDesk(pe) && !EoIsSticky(pe)) ||
(pe->type & (EWIN_TYPE_DIALOG | EWIN_TYPE_MENU)) ||
(type == MAX_AVAILABLE && !pe->props.never_use_area) ||
if (pe == ewin || _ignore(pe, type) ||
/* ignore windws that do not overlap with current search area */
!(SPANS_COMMON(x1, x2 - x1, EoGetX(pe), EoGetW(pe)) &&
SPANS_COMMON(y1, y2 - y1, EoGetY(pe), EoGetH(pe))) ||
@ -295,12 +301,7 @@ MaxSizeHV(EWin * ewin, const char *resize_type, int hor, int ver)
for (i = 0; i < num; i++)
{
pe = lst[i];
if (pe == ewin ||
pe->state.iconified || EoIsFloating(pe) ||
pe->props.ignorearrange ||
(EoGetDesk(ewin) != EoGetDesk(pe) && !EoIsSticky(pe)) ||
(pe->type & (EWIN_TYPE_DIALOG | EWIN_TYPE_MENU)) ||
(type == MAX_AVAILABLE && !pe->props.never_use_area) ||
if (pe == ewin || _ignore(pe, type) ||
!SPANS_COMMON(x, w, EoGetX(pe), EoGetW(pe)))
continue;
@ -319,12 +320,7 @@ MaxSizeHV(EWin * ewin, const char *resize_type, int hor, int ver)
for (i = 0; i < num; i++)
{
pe = lst[i];
if (pe == ewin ||
pe->state.iconified || EoIsFloating(pe) ||
pe->props.ignorearrange ||
(EoGetDesk(ewin) != EoGetDesk(pe) && !EoIsSticky(pe)) ||
(pe->type & (EWIN_TYPE_DIALOG | EWIN_TYPE_MENU)) ||
(type == MAX_AVAILABLE && !pe->props.never_use_area) ||
if (pe == ewin || _ignore(pe, type) ||
!SPANS_COMMON(y, h, EoGetY(pe), EoGetH(pe)))
continue;