ws->dummywin=XCreateWindow(ioncore_g.dpy, par->win,
fp->g.x, fp->g.y, 1, 1, 0,
ws->dummywin=XCreateWindow(ioncore_g.dpy, par->win,
fp->g.x, fp->g.y, 1, 1, 0,
XDeleteContext(ioncore_g.dpy, ws->dummywin, ioncore_g.win_context);
XDestroyWindow(ioncore_g.dpy, ws->dummywin);
ws->dummywin=None;
XDeleteContext(ioncore_g.dpy, ws->dummywin, ioncore_g.win_context);
XDestroyWindow(ioncore_g.dpy, ws->dummywin);
ws->dummywin=None;
+WPHolder *group_get_rescue_pholder_for(WGroup *ws,
+ WRegion *forwhat)
+{
+ WGroupAttachParams ap=GROUPATTACHPARAMS_INIT;
+ WFramedParam fp=FRAMEDPARAM_INIT;
+ WPHolder *ph;
+
+ ap.geom_set=TRUE;
+ ap.geom=REGION_GEOM(forwhat);
+
+ ap.geom_weak_set=1;
+
+ if(REGION_PARENT(forwhat)==REGION_PARENT(ws)){
+ ap.geom.x-=REGION_GEOM(ws).x;
+ ap.geom.y-=REGION_GEOM(ws).y;
+ }else{
+ ap.geom_weak=REGION_RQGEOM_WEAK_X|REGION_RQGEOM_WEAK_Y;
+ }
+
+ /* frame mode */
+ /*{
+ WFrame *frame=OBJ_CAST(forwhat, WFrame);
+ if(frame!=NULL)
+ fp.mode=frame->mode;
+ }*/
+
+ ph=(WPHolder*)create_grouppholder(ws, NULL, &ap);
+
+ return pholder_either((WPHolder*)create_framedpholder(ph, &fp), ph);
+}
+
+
+
- /* Fit */
- szplcy=(param->szplcy_set
- ? param->szplcy
- : (param->bottom
- ? SIZEPOLICY_FULL_EXACT
- : SIZEPOLICY_UNCONSTRAINED));
-
- weak=(param->geom_weak_set
- ? param->geom_weak
- : (param->geom_set
- ? 0
- : REGION_RQGEOM_WEAK_ALL));
-
- if(param->geom_set)
- geom_group_to_parent(ws, ¶m->geom, &g);
- else
- g=REGION_GEOM(reg);
-
- /* If the requested geometry does not overlap the workspaces's geometry,
- * position request is never honoured.
- */
- if((g.x+g.w<=REGION_GEOM(ws).x) ||
- (g.x>=REGION_GEOM(ws).x+REGION_GEOM(ws).w)){
- weak|=REGION_RQGEOM_WEAK_X;
- }
-
- if((g.y+g.h<=REGION_GEOM(ws).y) ||
- (g.y>=REGION_GEOM(ws).y+REGION_GEOM(ws).h)){
- weak|=REGION_RQGEOM_WEAK_Y;
- }
+ if(!param->whatever){
+ /* Fit */
+ szplcy=(param->szplcy_set
+ ? param->szplcy
+ : (param->bottom
+ ? SIZEPOLICY_FULL_EXACT
+ : SIZEPOLICY_UNCONSTRAINED));
+
+ weak=(param->geom_weak_set
+ ? param->geom_weak
+ : (param->geom_set
+ ? 0
+ : REGION_RQGEOM_WEAK_ALL));
+
+ if(param->geom_set)
+ geom_group_to_parent(ws, ¶m->geom, &g);
+ else
+ g=REGION_GEOM(reg);
+
+ /* If the requested geometry does not overlap the workspaces's geometry,
+ * position request is never honoured.
+ */
+ if((g.x+g.w<=REGION_GEOM(ws).x) ||
+ (g.x>=REGION_GEOM(ws).x+REGION_GEOM(ws).w)){
+ weak|=REGION_RQGEOM_WEAK_X;
+ }
+
+ if((g.y+g.h<=REGION_GEOM(ws).y) ||
+ (g.y>=REGION_GEOM(ws).y+REGION_GEOM(ws).h)){
+ weak|=REGION_RQGEOM_WEAK_Y;
+ }
- if(weak&(REGION_RQGEOM_WEAK_X|REGION_RQGEOM_WEAK_Y) &&
- (szplcy==SIZEPOLICY_UNCONSTRAINED ||
- szplcy==SIZEPOLICY_FREE ||
- szplcy==SIZEPOLICY_FREE_GLUE /* without flags */)){
- /* TODO: use 'weak'? */
- group_calc_placement(ws, level, &g);
- }
+ if(weak&(REGION_RQGEOM_WEAK_X|REGION_RQGEOM_WEAK_Y) &&
+ (szplcy==SIZEPOLICY_UNCONSTRAINED ||
+ szplcy==SIZEPOLICY_FREE ||
+ szplcy==SIZEPOLICY_FREE_GLUE /* without flags */)){
+ /* TODO: use 'weak'? */
+ group_calc_placement(ws, level, &g);
+ }
- sizepolicy(&szplcy, reg, &g, weak, &fp);
+ sizepolicy(&szplcy, reg, &g, weak, &fp);
- if(rectangle_compare(&fp.g, ®ION_GEOM(reg))!=RECTANGLE_SAME)
- region_fitrep(reg, NULL, &fp);
+ if(rectangle_compare(&fp.g, ®ION_GEOM(reg))!=RECTANGLE_SAME)
+ region_fitrep(reg, NULL, &fp);
+ }
/* Add */
st=group_do_add_managed(ws, reg, level, szplcy);
/* Add */
st=group_do_add_managed(ws, reg, level, szplcy);
+static void group_attach_fp(WGroup *ws, const WGroupAttachParams *param,
+ WFitParams *fp)
+{
+ if(param->geom_set){
+ geom_group_to_parent(ws, ¶m->geom, &fp->g);
+ fp->mode=REGION_FIT_EXACT;
+ }else{
+ fp->g=REGION_GEOM(ws);
+ fp->mode=REGION_FIT_BOUNDS|REGION_FIT_WHATEVER;
+ }
+}
+
+
WRegion *group_do_attach(WGroup *ws,
/*const*/ WGroupAttachParams *param,
WRegionAttachData *data)
{
WFitParams fp;
WRegion *group_do_attach(WGroup *ws,
/*const*/ WGroupAttachParams *param,
WRegionAttachData *data)
{
WFitParams fp;
- par=REGION_PARENT(ws);
- assert(par!=NULL);
-
- if(param->geom_set){
- geom_group_to_parent(ws, ¶m->geom, &fp.g);
- fp.mode=REGION_FIT_EXACT;
- }else{
- fp.g=REGION_GEOM(ws);
- fp.mode=REGION_FIT_BOUNDS|REGION_FIT_WHATEVER;
- }
+ group_attach_fp(ws, param, &fp);
- return region_attach_helper((WRegion*) ws, par, &fp,
+ return region_attach_helper((WRegion*) ws, REGION_PARENT(ws), &fp,
(WRegionDoAttachFn*)group_do_attach_final,
/*(const WRegionAttachParams*)*/param, data);
/* ^^^^ doesn't seem to work. */
(WRegionDoAttachFn*)group_do_attach_final,
/*(const WRegionAttachParams*)*/param, data);
/* ^^^^ doesn't seem to work. */
sizepolicy(&ws->managed_stdisp->szplcy, stdisp, NULL, 0, &fp);
region_fitrep(stdisp, NULL, &fp);
sizepolicy(&ws->managed_stdisp->szplcy, stdisp, NULL, 0, &fp);
region_fitrep(stdisp, NULL, &fp);
sizepolicy(&st->szplcy, reg, &rq->geom, rq->flags, &fp);
}
sizepolicy(&st->szplcy, reg, &rq->geom, rq->flags, &fp);
}
n=extl_table_get_n(substab);
for(i=1; i<=n; i++){
if(extl_table_geti_t(substab, i, &subtab)){
n=extl_table_get_n(substab);
for(i=1; i<=n; i++){
if(extl_table_geti_t(substab, i, &subtab)){
- group_attach_new(ws, subtab);
+ WGroupAttachParams par=GROUPATTACHPARAMS_INIT;
+ WRegionAttachData data;
+ WFitParams fp;
+ WPHolder *ph;
+
+ group_get_attach_params(ws, subtab, &par);
+ group_attach_fp(ws, &par, &fp);
+
+ ph=(WPHolder*)create_grouppholder(ws, NULL, &par);
+
+ region_attach_load_helper((WRegion*)ws, REGION_PARENT(ws), &fp,
+ (WRegionDoAttachFn*)group_do_attach_final,
+ (void*)&par, subtab, &ph);
+
+ if(ph!=NULL)
+ destroy_obj((Obj*)ph);
+
{(DynFun*)region_managed_rqorder,
(DynFun*)group_managed_rqorder},
{(DynFun*)region_managed_rqorder,
(DynFun*)group_managed_rqorder},