+/*extern WRegion *ioncore_newly_created;*/
+
+
+static WPHolder *try_target(WClientWin *cwin, const WManageParams *param,
+ const char *target)
+{
+ WRegion *r=ioncore_lookup_region(target, NULL);
+
+ if(r==NULL)
+ return NULL;
+
+ return region_prepare_manage(r, cwin, param, MANAGE_PRIORITY_NONE);
+}
+
+
+static bool handle_target_winprops(WClientWin *cwin, const WManageParams *param,
+ WScreen *scr, WPHolder **ph_ret)
+{
+ char *layout=NULL, *target=NULL;
+ WPHolder *ph=NULL;
+ bool mgd=FALSE;
+
+ if(extl_table_gets_s(cwin->proptab, "target", &target))
+ ph=try_target(cwin, param, target);
+
+ if(ph==NULL && extl_table_gets_s(cwin->proptab, "new_group", &layout)){
+ ExtlTab lo=ioncore_get_layout(layout);
+
+ free(layout);
+
+ if(lo!=extl_table_none()){
+ WMPlexAttachParams par=MPLEXATTACHPARAMS_INIT;
+ int mask=MPLEX_ATTACH_SWITCHTO;
+ WRegion *reg;
+
+ if(param->switchto)
+ par.flags|=MPLEX_ATTACH_SWITCHTO;
+
+ /*ioncore_newly_created=(WRegion*)cwin;*/
+
+ reg=mplex_attach_new_(&scr->mplex, &par, mask, lo);
+
+ extl_unref_table(lo);
+
+ /*ioncore_newly_created=NULL;*/
+
+ mgd=(region_manager((WRegion*)cwin)!=NULL);
+
+ if(reg!=NULL && !mgd){
+ if(target!=NULL)
+ ph=try_target(cwin, param, target);
+
+ if(ph==NULL){
+ ph=region_prepare_manage(reg, cwin, param,
+ MANAGE_PRIORITY_NONE);
+
+ if(ph==NULL)
+ destroy_obj((Obj*)reg);
+ }
+ }
+ }
+ }
+
+ if(target!=NULL)
+ free(target);
+
+ *ph_ret=ph;
+
+ return mgd;
+}
+
+
+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)
+ fs_scr=netwm_check_initial_fullscreen(cwin);
+
+ 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;
+}
+
+