bool region_do_rescue_this(WRegion *tosave_, WRescueInfo *info, int ph_flags) { WClientWin *cwin=OBJ_CAST(tosave_, WClientWin); WRegion *tosave=NULL; if(cwin!=NULL){ if(cwin->flags&CLIENTWIN_UNMAP_RQ) return TRUE; tosave=(WRegion*)cwin; }else if(info->flags®ION_RESCUE_NODEEP){ tosave=tosave_; }else{ /* Try to rescue whole groups. */ /*tosave=(WRegion*)OBJ_CAST(tosave_, WGroupCW);*/ } if(tosave==NULL){ return region_rescue_clientwins(tosave_, info); }else{ int phf=(info->flags®ION_RESCUE_PHFLAGS_OK ? ph_flags : 0); WPHolder *ph=rescueinfo_pholder(info); return (ph==NULL ? FALSE : pholder_attach(info->ph, phf, tosave)); } }
bool pholder_attach_mcfgoto(WPHolder *ph, int flags, WRegion *reg) { bool cf=region_may_control_focus(reg); if(!pholder_attach(ph, flags, reg)) return FALSE; if(cf) region_goto(reg); return TRUE; }
bool region_manage_clientwin(WRegion *reg, WClientWin *cwin, const WManageParams *par, int priority) { bool ret; WPHolder *ph=region_prepare_manage(reg, cwin, par, priority); int swf=(par->switchto ? PHOLDER_ATTACH_SWITCHTO : 0); if(ph==NULL) return FALSE; ret=pholder_attach(ph, swf, (WRegion*)cwin); destroy_obj((Obj*)ph); return ret; }
static bool sm_do_manage(WClientWin *cwin, const WManageParams *param) { int transient_mode=TRANSIENT_MODE_OFF; WPHolder *ph; bool ret; if(param->tfor!=NULL) return FALSE; ph=mod_sm_match_cwin_to_saved(cwin); if(ph==NULL) return FALSE; ret=pholder_attach(ph, 0, (WRegion*)cwin); destroy_obj((Obj*)ph); return ret; }
static bool try_fullscreen(WClientWin *cwin, WScreen *dflt, const WManageParams *param) { WScreen *fs_scr=NULL; bool fs=FALSE, tmp; /* Check fullscreen mode. (This is intentionally not done * for transients and windows with target winprops.) */ if(extl_table_gets_b(cwin->proptab, "fullscreen", &tmp)){ if(!tmp) return FALSE; fs_scr=dflt; } if(fs_scr==NULL && netwm_check_initial_fullscreen(cwin)) fs_scr=dflt; if(fs_scr==NULL) fs_scr=clientwin_fullscreen_chkrq(cwin, param->geom.w, param->geom.h); if(fs_scr!=NULL){ WPHolder *fs_ph=region_prepare_manage((WRegion*)fs_scr, cwin, param, MANAGE_PRIORITY_NOREDIR); if(fs_ph!=NULL){ int swf=(param->switchto ? PHOLDER_ATTACH_SWITCHTO : 0); cwin->flags|=CLIENTWIN_FS_RQ; fs=pholder_attach(fs_ph, swf, (WRegion*)cwin); if(!fs) cwin->flags&=~CLIENTWIN_FS_RQ; destroy_obj((Obj*)fs_ph); } } return fs; }