X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=ioncore%2Fstacking.c;h=0c6480d7b5331ecc7479ca59b16dd6a22f1a6360;hp=c96c5387c1a914980754302389f66d95cd6259b6;hb=e3aec18706513a87eaa7839dfdaf7e0fcd0d8d2a;hpb=1cd244db6df1337d594b9e2456c735cbc28aea6c diff --git a/ioncore/stacking.c b/ioncore/stacking.c index c96c538..0c6480d 100644 --- a/ioncore/stacking.c +++ b/ioncore/stacking.c @@ -1,7 +1,7 @@ /* * ion/ioncore/stacking.c * - * Copyright (c) Tuomo Valkonen 1999-2007. + * Copyright (c) Tuomo Valkonen 1999-2009. * * See the included file LICENSE for details. */ @@ -596,6 +596,12 @@ static bool mapped_filt(WStacking *st, void *unused) } +static bool mapped_filt_neq(WStacking *st, void *st_neq) +{ + return (st!=(WStacking*)st_neq && mapped_filt(st, NULL)); +} + + static bool mgr_filt(WStacking *st, void *mgr_) { return (st->reg!=NULL && REGION_MANAGER(st->reg)==(WRegion*)mgr_); @@ -622,5 +628,16 @@ uint stacking_min_level_mapped(WStacking *stacking) } +bool stacking_must_focus(WStacking *stacking, WStacking *st) +{ + WStacking *stf=stacking_find_to_focus(stacking, NULL, + mapped_filt_neq, NULL, st); + + return (stf==NULL || + (st->level>stf->level && + st->level>=STACKING_LEVEL_MODAL1)); +} + + /*}}}*/