/*
* ion/ioncore/detach.c
*
- * Copyright (c) Tuomo Valkonen 1999-2007.
+ * Copyright (c) Tuomo Valkonen 1999-2008.
*
* See the included file LICENSE for details.
*/
+#include <string.h>
+
#include <libtu/objp.h>
#include <libtu/setparam.h>
#include <libtu/minmax.h>
}
if(framemode!=FRAME_MODE_UNKNOWN){
+ /* TODO: remove/obsolete this special case */
WFramedParam fpa=FRAMEDPARAM_INIT;
fpa.mode=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;
*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;