From aef884b09a97073fb0de94df776c309f495575ca Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sun, 20 Mar 2011 21:53:59 +0000 Subject: [PATCH] Move duplicated stuff to function. Cleanups. SVN revision: 57923 --- src/dialog.c | 3 ++- src/size.c | 34 +++++++++++++++------------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/dialog.c b/src/dialog.c index e8911f24..f6ea6b18 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -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); } diff --git a/src/size.c b/src/size.c index 753a5a9f..dd6fba57 100644 --- a/src/size.c +++ b/src/size.c @@ -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;