X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fdetach.c;h=89187a4a4d321f4ad8ab3f64d1208c41e5dbc82a;hb=562cb4d37ba7667ac846fc3d426b152d21ef2c22;hp=2d24fee42c70d7fc31db0200e30a6e01c5cbb717;hpb=a6561c9679cd701b0d50c3cfd44e4664f7df2b2f;p=ion3.git diff --git a/ioncore/detach.c b/ioncore/detach.c index 2d24fee..89187a4 100644 --- a/ioncore/detach.c +++ b/ioncore/detach.c @@ -1,11 +1,13 @@ /* * ion/ioncore/detach.c * - * Copyright (c) Tuomo Valkonen 1999-2007. + * Copyright (c) Tuomo Valkonen 1999-2008. * * See the included file LICENSE for details. */ +#include + #include #include #include @@ -61,6 +63,7 @@ static bool ioncore_do_detach(WRegion *reg, WGroup *grp, WFrameMode framemode, } if(framemode!=FRAME_MODE_UNKNOWN){ + /* TODO: remove/obsolete this special case */ WFramedParam fpa=FRAMEDPARAM_INIT; fpa.mode=framemode; @@ -81,12 +84,18 @@ static bool ioncore_do_detach(WRegion *reg, WGroup *grp, WFrameMode framemode, }else{ WStacking *st=ioncore_find_stacking(reg); + ap.level_set=TRUE; + ap.level=framelevel+1; + if(st!=NULL){ ap.szplcy=st->szplcy; ap.szplcy_set=TRUE; - ap.level_set=TRUE; - ap.level=maxof(st->level, STACKING_LEVEL_NORMAL); + /* Hack for modal detached queries, while transients become + * non-modal detached. + */ + if(st->level>STACKING_LEVEL_MODAL1) + ap.level=st->level; } ap.geom_set=TRUE; @@ -115,9 +124,10 @@ static WRegion *check_mplex(WRegion *reg, WFrameMode *mode) *mode=FRAME_MODE_FLOATING; - if(OBJ_IS(mplex, WFrame) - && frame_mode((WFrame*)mplex)==FRAME_MODE_TRANSIENT){ - *mode=FRAME_MODE_TRANSIENT; + if(OBJ_IS(mplex, WFrame)){ + WFrameMode mode2=frame_mode((WFrame*)mplex); + if(framemode_unalt(mode2)==FRAME_MODE_TRANSIENT) + *mode=mode2; } return (WRegion*)mplex;