diff options
Diffstat (limited to 'sway/workspace.c')
-rw-r--r-- | sway/workspace.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/sway/workspace.c b/sway/workspace.c index cd5472e3..3f4590e2 100644 --- a/sway/workspace.c +++ b/sway/workspace.c | |||
@@ -111,3 +111,53 @@ void workspace_switch(swayc_t *workspace) { | |||
111 | } | 111 | } |
112 | active_workspace = workspace; | 112 | active_workspace = workspace; |
113 | } | 113 | } |
114 | |||
115 | /* XXX:DEBUG:XXX */ | ||
116 | static void container_log(const swayc_t *c) { | ||
117 | fprintf(stderr, "focus:%c|", | ||
118 | c == get_focused_container(&root_container) ? 'F' : //Focused | ||
119 | c == active_workspace ? 'W' : //active workspace | ||
120 | c == &root_container ? 'R' : //root | ||
121 | 'X');//not any others | ||
122 | fprintf(stderr,"(%p)",c); | ||
123 | fprintf(stderr,"(p:%p)",c->parent); | ||
124 | fprintf(stderr,"(f:%p)",c->focused); | ||
125 | fprintf(stderr,"Type:"); | ||
126 | fprintf(stderr, | ||
127 | c->type == C_ROOT ? "Root|" : | ||
128 | c->type == C_OUTPUT ? "Output|" : | ||
129 | c->type == C_WORKSPACE ? "Workspace|" : | ||
130 | c->type == C_CONTAINER ? "Container|" : | ||
131 | c->type == C_VIEW ? "View|" : | ||
132 | "Unknown|"); | ||
133 | fprintf(stderr,"layout:"); | ||
134 | fprintf(stderr, | ||
135 | c->layout == L_NONE ? "NONE|" : | ||
136 | c->layout == L_HORIZ ? "Horiz|": | ||
137 | c->layout == L_VERT ? "Vert|": | ||
138 | c->layout == L_STACKED ? "Stacked|": | ||
139 | c->layout == L_FLOATING ? "Floating|": | ||
140 | "Unknown|"); | ||
141 | fprintf(stderr, "w:%d|h:%d|", c->width, c->height); | ||
142 | fprintf(stderr, "x:%d|y:%d|", c->x, c->y); | ||
143 | fprintf(stderr, "vis:%c|", c->visible?'t':'f'); | ||
144 | fprintf(stderr, "wgt:%d|", c->weight); | ||
145 | fprintf(stderr, "name:%.16s|", c->name); | ||
146 | fprintf(stderr, "children:%d\n",c->children?c->children->length:0); | ||
147 | } | ||
148 | void layout_log(const swayc_t *c, int depth) { | ||
149 | int i; | ||
150 | int e = c->children?c->children->length:0; | ||
151 | for (i = 0; i < depth; ++i) fputc(' ', stderr); | ||
152 | container_log(c); | ||
153 | if (e) { | ||
154 | for (i = 0; i < depth; ++i) fputc(' ', stderr); | ||
155 | fprintf(stderr,"(\n"); | ||
156 | for (i = 0; i < e; ++i) { | ||
157 | layout_log(c->children->items[i], depth + 1); | ||
158 | } | ||
159 | for (i = 0; i < depth; ++i) fputc(' ', stderr); | ||
160 | fprintf(stderr,")\n"); | ||
161 | } | ||
162 | } | ||
163 | /* XXX:DEBUG:XXX */ | ||