diff --git a/statusbar.c b/statusbar.c index 99653027..3f404fc2 100644 --- a/statusbar.c +++ b/statusbar.c @@ -51,20 +51,17 @@ statusbar_update_position(Statusbar *statusbar) switch(statusbar->position) { case Top: - XMoveWindow(globalconf.display, statusbar->sw->window, - area.x, area.y); + simplewindow_move(statusbar->sw, area.x, area.y); break; case Bottom: - XMoveWindow(globalconf.display, statusbar->sw->window, - area.x, area.height - statusbar->height); + simplewindow_move(statusbar->sw, area.x, area.height - statusbar->sw->geometry.height); break; case Left: - XMoveWindow(globalconf.display, statusbar->sw->window, - area.x - statusbar->height, (area.y + area.height) - statusbar->width); + simplewindow_move(statusbar->sw, area.x - statusbar->sw->geometry.height, + (area.y + area.height) - statusbar->sw->geometry.width); break; case Right: - XMoveWindow(globalconf.display, statusbar->sw->window, - area.x + area.width, area.y); + simplewindow_move(statusbar->sw, area.x + area.width, area.y); break; case Off: XUnmapWindow(globalconf.display, statusbar->sw->window); diff --git a/window.c b/window.c index 6750db88..254c4ab2 100644 --- a/window.c +++ b/window.c @@ -227,4 +227,12 @@ simplewindow_delete(SimpleWindow *sw) p_delete(&sw); } +int +simplewindow_move(SimpleWindow *sw, int x, int y) +{ + sw->geometry.x = x; + sw->geometry.y = y; + XMoveWindow(globalconf.display, sw->window, x, y); +} + // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/window.h b/window.h index db7c74d4..1ddec427 100644 --- a/window.h +++ b/window.h @@ -32,6 +32,7 @@ void window_setshape(int, Window); int window_settrans(Window, double); SimpleWindow * simplewindow_new(int, int, int, unsigned int, unsigned int, unsigned int); void simplewindow_delete(SimpleWindow *); +int simplewindow_move(SimpleWindow *, int, int); #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80