From 720dabbaf6719f1808f202ed0b15f5a1be87c1da Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 16 Mar 2008 18:00:49 +0100 Subject: [PATCH] Add support for titlebar on right --- client.c | 9 +++++++++ titlebar.c | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/client.c b/client.c index a6da4090d..58f4e6ea1 100644 --- a/client.c +++ b/client.c @@ -401,6 +401,15 @@ client_manage(Window w, XWindowAttributes *wa, int screen) c->geometry.width + 2 * c->border, 0); break; + case Right: + c->titlebar.sw = simplewindow_new(globalconf.display, + phys_screen, + c->geometry.x + c->geometry.width + 2 * c->border, + c->geometry.y, + titlebar_height, + c->geometry.width + 2 * c->border, + 0); + break; case Off: break; default: diff --git a/titlebar.c b/titlebar.c index 0b139a056..b766da768 100644 --- a/titlebar.c +++ b/titlebar.c @@ -86,6 +86,11 @@ titlebar_update(Client *c) XFreePixmap(globalconf.display, c->titlebar.sw->drawable); c->titlebar.sw->drawable = d; break; + case Right: + d = draw_rotate(ctx, c->titlebar.sw->phys_screen, M_PI_2, + c->titlebar.sw->geometry.width, 0); + XFreePixmap(globalconf.display, c->titlebar.sw->drawable); + c->titlebar.sw->drawable = d; default: break; } @@ -126,6 +131,13 @@ titlebar_update_geometry_floating(Client *c) c->titlebar.sw->geometry.width, c->geometry.height + 2 * c->border); break; + case Right: + simplewindow_move_resize(c->titlebar.sw, + c->geometry.x + c->geometry.width + 2 * c->border, + c->geometry.y, + c->titlebar.sw->geometry.width, + c->geometry.height + 2 * c->border); + break; } titlebar_update(c); @@ -167,6 +179,14 @@ titlebar_update_geometry(Client *c, area_t geometry) geometry.width -= c->titlebar.sw->geometry.width; geometry.x += c->titlebar.sw->geometry.width; break; + case Right: + geometry.width -= c->titlebar.sw->geometry.width; + simplewindow_move_resize(c->titlebar.sw, + geometry.x + geometry.width + 2 * c->border, + geometry.y, + c->titlebar.sw->geometry.width, + geometry.height + 2 * c->border); + break; } titlebar_update(c);