Skip to content

Commit 7a90854

Browse files
committed
tiling debugging
1 parent ae24a73 commit 7a90854

File tree

5 files changed

+28
-2
lines changed

5 files changed

+28
-2
lines changed

ioncore/frame.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ bool frame_init(WFrame *frame, WWindow *parent, const WFitParams *fp,
6464
WFrameMode mode, char *name)
6565
{
6666
WRectangle mg;
67+
fprintf(stderr, "creating frame at %x\n", frame);
6768

6869
frame->flags=0;
6970
frame->saved_geom.w=0;

libtu/obj.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ void destroy_obj(Obj *obj)
2929
{
3030
ClassDescr *d;
3131

32+
fprintf(stderr, "Destroying object of type %s at %x\n", OBJ_TYPESTR(obj), obj);
33+
3234
if(OBJ_IS_BEING_DESTROYED(obj))
3335
return;
3436

@@ -147,6 +149,7 @@ DynFun *lookup_dynfun(const Obj *obj, DynFun *func,
147149

148150
descr=obj->obj_type;
149151

152+
//fprintf(stderr, "lookup_dynfun for obj %s at %x, obj_type at %x\n", OBJ_TYPESTR(obj), obj, obj->obj_type);
150153
for(; descr!=&Obj_classdescr; descr=descr->ancestor){
151154
if(descr->funtab==NULL)
152155
continue;

mod_tiling/split.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ bool splitinner_init(WSplitInner *split, const WRectangle *geom)
191191

192192
bool splitsplit_init(WSplitSplit *split, const WRectangle *geom, int dir)
193193
{
194+
fprintf(stderr, "creating wsplitsplit at %x\n", split);
194195
splitinner_init(&(split->isplit), geom);
195196
split->dir=dir;
196197
split->tl=NULL;
@@ -274,6 +275,7 @@ void splitsplit_deinit(WSplitSplit *split)
274275
void splitregion_deinit(WSplitRegion *split)
275276
{
276277
if(split->reg!=NULL){
278+
fprintf(stderr, "deinitting splitregion at %x with reg %s %x\n", split, OBJ_TYPESTR(split->reg), split->reg);
277279
set_node_of_reg(split->reg, NULL);
278280
split->reg=NULL;
279281
}
@@ -1863,6 +1865,7 @@ void splitinner_mark_current(WSplitInner *split, WSplit *child)
18631865

18641866
static void splitsplit_forall(WSplitSplit *node, WSplitFn *fn)
18651867
{
1868+
fprintf(stderr, "executing fn for both children of the WSplitSplit at %x: %s %x -> %s %x & %s %x\n", node, OBJ_TYPESTR(node->isplit.split.parent), node->isplit.split.parent, OBJ_TYPESTR(node->tl), node->tl, OBJ_TYPESTR(node->br), node->br);
18661869
fn(node->tl);
18671870
fn(node->br);
18681871
}
@@ -1993,8 +1996,10 @@ void split_map(WSplit *split)
19931996

19941997
static void splitregion_unmap(WSplitRegion *split)
19951998
{
1996-
if(split->reg!=NULL)
1999+
if(split->reg!=NULL) {
2000+
fprintf(stderr, "unmapping splitregion at %x with reg %s %x\n", split, OBJ_TYPESTR(split->reg), split->reg);
19972001
region_unmap(split->reg);
2002+
}
19982003
}
19992004

20002005
static void splitinner_unmap(WSplitInner *split)

mod_tiling/split.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,12 @@ DECLCLASS(WSplitInner){
6161
};
6262

6363

64+
// A split containing 2 WSplit children
6465
DECLCLASS(WSplitSplit){
6566
WSplitInner isplit;
67+
// direction
6668
int dir;
69+
// top/left and bottom/right child
6770
WSplit *tl, *br;
6871
int current;
6972
};
@@ -74,7 +77,7 @@ DECLCLASS(WSplitRegion){
7477
WRegion *reg;
7578
};
7679

77-
80+
// WSplitRegion for holding the stdisp
7881
DECLCLASS(WSplitST){
7982
WSplitRegion regnode;
8083
int orientation;

mod_tiling/tiling.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ bool tiling_managed_add(WTiling *ws, WRegion *reg)
515515
bool tiling_do_attach_initial(WTiling *ws, WRegion *reg)
516516
{
517517
assert(ws->split_tree==NULL);
518+
fprintf(stderr, "tiling_do_attach_initial\n");
518519

519520
ws->split_tree=(WSplit*)create_splitregion(&REGION_GEOM(reg), reg);
520521
if(ws->split_tree==NULL)
@@ -542,6 +543,7 @@ bool tiling_init(WTiling *ws, WWindow *parent, const WFitParams *fp,
542543
WRegionSimpleCreateFn *create_frame_fn, bool ci)
543544
{
544545
const char *p[1];
546+
fprintf(stderr, "tiling_init\n");
545547

546548
ws->split_tree=NULL;
547549
ws->create_frame_fn=(create_frame_fn
@@ -592,6 +594,7 @@ bool tiling_init(WTiling *ws, WWindow *parent, const WFitParams *fp,
592594

593595
region_register(&(ws->reg));
594596
region_add_bindmap((WRegion*)ws, mod_tiling_tiling_bindmap);
597+
fprintf(stderr, "tiling_initted\n");
595598

596599
return TRUE;
597600
}
@@ -1079,13 +1082,20 @@ void do_unsplit(WRegion *reg)
10791082
if(ws==NULL)
10801083
return;
10811084

1085+
fprintf(stderr, "unsplitting %s at %x\n", OBJ_TYPESTR(reg), reg);
1086+
10821087
ph=region_get_rescue_pholder_for((WRegion*)ws, reg);
10831088

10841089
if(ph==NULL){
1090+
fprintf(stderr, "no rescue needed?\n");
10851091
res=!region_rescue_needed(reg);
1092+
fprintf(stderr, "res %d\n", res);
10861093
}else{
1094+
fprintf(stderr, "rescueing\n");
10871095
res=region_rescue(reg, ph);
1096+
fprintf(stderr, "rescued, destroying ph\n");
10881097
destroy_obj((Obj*)ph);
1098+
fprintf(stderr, "destroyed ph\n");
10891099
}
10901100

10911101
if(!res){
@@ -1094,7 +1104,9 @@ void do_unsplit(WRegion *reg)
10941104
return;
10951105
}
10961106

1107+
fprintf(stderr, "destroying %x\n", reg);
10971108
destroy_obj((Obj*)reg);
1109+
fprintf(stderr, "end do_unsplit\n");
10981110
}
10991111

11001112

@@ -1667,6 +1679,7 @@ WRegion *tiling_load(WWindow *par, const WFitParams *fp, ExtlTab tab)
16671679
ws->split_tree=tiling_load_node(ws, &REGION_GEOM(ws), treetab);
16681680
extl_unref_table(treetab);
16691681
}
1682+
fprintf(stderr, "loaded node\n");
16701683

16711684
if(ws->split_tree==NULL){
16721685
warn(TR("The workspace is empty."));
@@ -1677,6 +1690,7 @@ WRegion *tiling_load(WWindow *par, const WFitParams *fp, ExtlTab tab)
16771690
ws->split_tree->ws_if_root=ws;
16781691
split_restack(ws->split_tree, ws->dummywin, Above);
16791692

1693+
fprintf(stderr, "restacked\n");
16801694
return (WRegion*)ws;
16811695
}
16821696

0 commit comments

Comments
 (0)