From db0f2d27fd747849b0df382a21553fec2f0e963c Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Thu, 22 Sep 2011 08:34:50 +0200 Subject: [PATCH] Add split_vmirror & split_hmirror layout function: http://ompldr.org/vYWgzZw --- wmfs2/src/config.h | 4 ++++ wmfs2/src/layout.c | 27 +++++++++++++++++++++++++++ wmfs2/src/layout.h | 3 +++ 3 files changed, 34 insertions(+) diff --git a/wmfs2/src/config.h b/wmfs2/src/config.h index d106bf5..edb24ac 100644 --- a/wmfs2/src/config.h +++ b/wmfs2/src/config.h @@ -30,6 +30,10 @@ static const struct { char *name; void (*func)(Uicb cmd); } uicb_list[] = { "tag_next", uicb_tag_next }, { "tag_prev", uicb_tag_prev }, + /* Layout */ + { "split_vmirror", uicb_layout_split_vmirror }, + { "split_hmirror", uicb_layout_split_hmirror }, + /* Client */ { "client_close", uicb_client_close }, { "client_resize_right", uicb_client_resize_Right }, diff --git a/wmfs2/src/layout.c b/wmfs2/src/layout.c index c84bbe8..470894b 100644 --- a/wmfs2/src/layout.c +++ b/wmfs2/src/layout.c @@ -168,3 +168,30 @@ layout_split_integrate(struct client *c, struct client *sc) client_moveresize(c, g); } +/* + * Really simple functions, don't need static no-uicb backend + * so we evitate if(vertical) .. else + */ +void +uicb_layout_split_vmirror(Uicb cmd) +{ + struct client *c; + + SLIST_FOREACH(c, &W->screen->seltag->clients, tnext) + { + c->geo.x = W->screen->ugeo.w - (c->geo.x + c->geo.w); + client_moveresize(c, c->geo); + } +} + +void +uicb_layout_split_hmirror(Uicb cmd) +{ + struct client *c; + + SLIST_FOREACH(c, &W->screen->seltag->clients, tnext) + { + c->geo.y = W->screen->ugeo.h - (c->geo.y + c->geo.h); + client_moveresize(c, c->geo); + } +} diff --git a/wmfs2/src/layout.h b/wmfs2/src/layout.h index 2e7d811..61e5b3b 100644 --- a/wmfs2/src/layout.h +++ b/wmfs2/src/layout.h @@ -31,6 +31,9 @@ void layout_split_integrate(struct client *c, struct client *sc); void layout_split_arrange_closed(struct client *ghost); +void uicb_layout_split_vmirror(Uicb cmd); +void uicb_layout_split_hmirror(Uicb cmd); + #endif /* LAYOUT_H */