diff --git a/awesome.c b/awesome.c index a3a3cffed..df55780ba 100644 --- a/awesome.c +++ b/awesome.c @@ -226,30 +226,6 @@ get_windows_area_width(Display *disp, return DisplayWidth(disp, DefaultScreen(disp)); } -void -updatebarpos(Display *disp, Statusbar statusbar) -{ - XEvent ev; - ScreenInfo *si; - - switch (statusbar.position) - { - default: - XMoveWindow(disp, statusbar.window, 0, 0); - break; - case BarBot: - si = get_display_info(disp, statusbar); - XMoveWindow(disp, statusbar.window, 0, si->height); - XFree(si); - break; - case BarOff: - XMoveWindow(disp, statusbar.window, 0, 0 - statusbar.height); - break; - } - XSync(disp, False); - while(XCheckMaskEvent(disp, EnterWindowMask, &ev)); -} - /* There's no way to check accesses to destroyed windows, thus those cases are * ignored (especially on UnmapNotify's). Other types of errors call Xlibs * default error handler, which may call exit. diff --git a/awesome.h b/awesome.h index 955021212..d7977d79a 100644 --- a/awesome.h +++ b/awesome.h @@ -24,8 +24,6 @@ #include "config.h" -Bool gettextprop(Display *, Window, Atom, char *, unsigned int); /* return text property, UTF-8 compliant */ -void updatebarpos(Display *, Statusbar); /* updates the bar position */ void uicb_quit(Display *, DC *, awesome_config *, const char *); /* quit awesome nicely */ int xerror(Display *, XErrorEvent *); /* awesome's X error handler */ int __attribute__ ((deprecated)) get_windows_area_x(Statusbar); diff --git a/config.c b/config.c index 794f655df..932b788c2 100644 --- a/config.c +++ b/config.c @@ -30,8 +30,8 @@ #include "awesome.h" #include "layout.h" #include "tag.h" -#include "util.h" #include "draw.h" +#include "util.h" #include "layouts/tile.h" #include "layouts/spiral.h" #include "layouts/floating.h" diff --git a/draw.h b/draw.h index ce62f6db2..b05e772f8 100644 --- a/draw.h +++ b/draw.h @@ -22,7 +22,7 @@ #ifndef AWESOME_DRAW_H #define AWESOME_DRAW_H -#include "util.h" +#include "config.h" #define textw(set, xfont, text, height) (textnw(set, xfont, text, a_strlen(text)) + height) diff --git a/event.c b/event.c index 655ac5b8c..b3cbbb60c 100644 --- a/event.c +++ b/event.c @@ -25,13 +25,13 @@ #include #include -#include "awesome.h" #include "screen.h" #include "event.h" #include "layout.h" #include "tag.h" #include "draw.h" #include "statusbar.h" +#include "util.h" #include "layouts/tile.h" #include "layouts/floating.h" diff --git a/statusbar.c b/statusbar.c index 92f50c8ce..8e500311e 100644 --- a/statusbar.c +++ b/statusbar.c @@ -22,6 +22,8 @@ #include "layout.h" #include "statusbar.h" #include "draw.h" +#include "screen.h" +#include "util.h" extern Client *clients, *sel, *stack; /* global client list and stack */ @@ -85,3 +87,28 @@ drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf) XCopyArea(disp, awesomeconf->statusbar.drawable, awesomeconf->statusbar.window, drawcontext->gc, 0, 0, DisplayWidth(disp, DefaultScreen(disp)), awesomeconf->statusbar.height, 0, 0); XSync(disp, False); } + + +void +updatebarpos(Display *disp, Statusbar statusbar) +{ + XEvent ev; + ScreenInfo *si; + + switch (statusbar.position) + { + default: + XMoveWindow(disp, statusbar.window, 0, 0); + break; + case BarBot: + si = get_display_info(disp, statusbar); + XMoveWindow(disp, statusbar.window, 0, si->height); + XFree(si); + break; + case BarOff: + XMoveWindow(disp, statusbar.window, 0, 0 - statusbar.height); + break; + } + XSync(disp, False); + while(XCheckMaskEvent(disp, EnterWindowMask, &ev)); +} diff --git a/statusbar.h b/statusbar.h index 9fcfe5082..5cd469101 100644 --- a/statusbar.h +++ b/statusbar.h @@ -25,5 +25,6 @@ #include "config.h" void drawstatusbar(Display *, DC *, awesome_config *); +void updatebarpos(Display *, Statusbar); #endif