diff options
-rw-r--r-- | sway/commands.c | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/sway/commands.c b/sway/commands.c index a0a95eef..5f378a98 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -299,67 +299,9 @@ static bool cmd_workspace(struct sway_config *config, int argc, char **argv) { | |||
299 | return true; | 299 | return true; |
300 | } | 300 | } |
301 | 301 | ||
302 | /* XXX:DEBUG:XXX */ | ||
303 | static void container_log(const swayc_t *c) { | ||
304 | fprintf(stderr, "focus:%c|", | ||
305 | c == get_focused_container(&root_container) ? 'F' : //Focused | ||
306 | c == active_workspace ? 'W' : //active workspace | ||
307 | c == &root_container ? 'R' : //root | ||
308 | 'X');//not any others | ||
309 | fprintf(stderr,"(%p)",c); | ||
310 | fprintf(stderr,"(p:%p)",c->parent); | ||
311 | fprintf(stderr,"(f:%p)",c->focused); | ||
312 | fprintf(stderr,"Type:"); | ||
313 | fprintf(stderr, | ||
314 | c->type == C_ROOT ? "Root|" : | ||
315 | c->type == C_OUTPUT ? "Output|" : | ||
316 | c->type == C_WORKSPACE ? "Workspace|" : | ||
317 | c->type == C_CONTAINER ? "Container|" : | ||
318 | c->type == C_VIEW ? "View|" : | ||
319 | "Unknown|"); | ||
320 | fprintf(stderr,"layout:"); | ||
321 | fprintf(stderr, | ||
322 | c->layout == L_NONE ? "NONE|" : | ||
323 | c->layout == L_HORIZ ? "Horiz|": | ||
324 | c->layout == L_VERT ? "Vert|": | ||
325 | c->layout == L_STACKED ? "Stacked|": | ||
326 | c->layout == L_FLOATING ? "Floating|": | ||
327 | "Unknown|"); | ||
328 | fprintf(stderr, "w:%d|h:%d|", c->width, c->height); | ||
329 | fprintf(stderr, "x:%d|y:%d|", c->x, c->y); | ||
330 | fprintf(stderr, "vis:%c|", c->visible?'t':'f'); | ||
331 | fprintf(stderr, "wgt:%d|", c->weight); | ||
332 | fprintf(stderr, "name:%.16s|", c->name); | ||
333 | fprintf(stderr, "children:%d\n",c->children?c->children->length:0); | ||
334 | } | ||
335 | void layout_log(const swayc_t *c, int depth) { | ||
336 | int i; | ||
337 | int e = c->children?c->children->length:0; | ||
338 | for (i = 0; i < depth; ++i) fputc(' ', stderr); | ||
339 | container_log(c); | ||
340 | if (e) { | ||
341 | for (i = 0; i < depth; ++i) fputc(' ', stderr); | ||
342 | fprintf(stderr,"(\n"); | ||
343 | for (i = 0; i < e; ++i) { | ||
344 | layout_log(c->children->items[i], depth + 1); | ||
345 | } | ||
346 | for (i = 0; i < depth; ++i) fputc(' ', stderr); | ||
347 | fprintf(stderr,")\n"); | ||
348 | } | ||
349 | } | ||
350 | bool cmd_debug_print_layout(struct sway_config *config, int argc, char **argv) { | ||
351 | fprintf(stderr,"root:%p\nactive workspace:%p\n",&root_container, active_workspace); | ||
352 | layout_log(&root_container, 0); | ||
353 | return true; | ||
354 | } | ||
355 | /* XXX:DEBUG:XXX */ | ||
356 | |||
357 | /* Keep alphabetized */ | 302 | /* Keep alphabetized */ |
358 | static struct cmd_handler handlers[] = { | 303 | static struct cmd_handler handlers[] = { |
359 | { "bindsym", cmd_bindsym }, | 304 | { "bindsym", cmd_bindsym }, |
360 | //DEBUG | ||
361 | { "debug_print_layout", cmd_debug_print_layout }, | ||
362 | //DEBUG | ||
363 | { "exec", cmd_exec }, | 305 | { "exec", cmd_exec }, |
364 | { "exec_always", cmd_exec_always }, | 306 | { "exec_always", cmd_exec_always }, |
365 | { "exit", cmd_exit }, | 307 | { "exit", cmd_exit }, |