diff --git a/draw.c b/draw.c index a5480d803..7b8397d47 100644 --- a/draw.c +++ b/draw.c @@ -126,7 +126,7 @@ drawcircle(Display *disp, int screen, int x, int y, int r, Drawable drawable, in } void -draw_rotate(Display *disp, int screen, Drawable drawable, int dw, int dh, double angle) +draw_rotate(Display *disp, int screen, Drawable drawable, int dw, int dh, double angle, int tx, int ty) { cairo_surface_t *surface, *source; cairo_t *cr; @@ -134,11 +134,12 @@ draw_rotate(Display *disp, int screen, Drawable drawable, int dw, int dh, double surface = cairo_xlib_surface_create(disp, drawable, DefaultVisual(disp, screen), dw, dw); source = cairo_xlib_surface_create(disp, drawable, DefaultVisual(disp, screen), dw, dw); cr = cairo_create (surface); - cairo_rotate(cr, M_PI / 2); - cairo_translate(cr, 0.0, -dh); + + cairo_rotate(cr, angle); + cairo_translate(cr, tx, ty); cairo_set_source_surface(cr, source, 0.0, 0.0); - cairo_paint_with_alpha(cr, 1.0); + cairo_paint(cr); cairo_destroy(cr); cairo_surface_destroy(source); diff --git a/draw.h b/draw.h index 52487f4b2..252b7c7d7 100644 --- a/draw.h +++ b/draw.h @@ -27,7 +27,7 @@ void drawtext(Display *, int, int, int, int, int, Drawable, int, int, XftFont *, const char *, XColor []); void drawrectangle(Display *, int, int, int, int, int, Drawable, int, int, Bool, XColor); void drawcircle(Display *, int, int, int, int, Drawable, int, int, Bool, XColor); -void draw_rotate(Display *, int, Drawable, int, int, double); +void draw_rotate(Display *, int, Drawable, int, int, double, int, int); unsigned short textwidth(Display *, XftFont *, char *); #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/statusbar.c b/statusbar.c index 760039710..03b7c7b75 100644 --- a/statusbar.c +++ b/statusbar.c @@ -161,9 +161,16 @@ drawstatusbar(awesome_config *awesomeconf) if(awesomeconf->statusbar.position == BarRight || awesomeconf->statusbar.position == BarLeft) { - draw_rotate(awesomeconf->display, awesomeconf->phys_screen, - awesomeconf->statusbar.drawable, awesomeconf->statusbar.width, - awesomeconf->statusbar.height, M_PI * 1.5); + if(awesomeconf->statusbar.position == BarRight) + draw_rotate(awesomeconf->display, awesomeconf->phys_screen, + awesomeconf->statusbar.drawable, awesomeconf->statusbar.width, + awesomeconf->statusbar.height, M_PI * 0.5, + 0, -awesomeconf->statusbar.height); + else + draw_rotate(awesomeconf->display, awesomeconf->phys_screen, + awesomeconf->statusbar.drawable, awesomeconf->statusbar.width, + awesomeconf->statusbar.height, M_PI * 0.5, + 0, -awesomeconf->statusbar.height); XCopyArea(awesomeconf->display, awesomeconf->statusbar.drawable, awesomeconf->statusbar.window, DefaultGC(awesomeconf->display, awesomeconf->phys_screen), 0, 0, @@ -250,7 +257,7 @@ updatebarpos(Display *disp, Statusbar statusbar) XMoveWindow(disp, statusbar.window, si[statusbar.screen].x_org, si[statusbar.screen].y_org); break; case BarRight: - XMoveWindow(disp, statusbar.window, si[statusbar.screen].width - statusbar.width, si[statusbar.screen].y_org); + XMoveWindow(disp, statusbar.window, si[statusbar.screen].width - statusbar.height, si[statusbar.screen].y_org); break; case BarBot: XMoveWindow(disp, statusbar.window, si[statusbar.screen].x_org, si[statusbar.screen].height - statusbar.height);